xfs
[Top] [All Lists]

Re: how to free a used ag?

To: Markus Lidel <Markus.Lidel@xxxxxxxxxxxxxxxxx>
Subject: Re: how to free a used ag?
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 16 Aug 2004 23:54:05 +0100
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <412136CC.5070708@xxxxxxxxxxxxxxxxx>; from Markus.Lidel@xxxxxxxxxxxxxxxxx on Tue, Aug 17, 2004 at 12:35:56AM +0200
References: <412136CC.5070708@xxxxxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
On Tue, Aug 17, 2004 at 12:35:56AM +0200, Markus Lidel wrote:
> 1. Is there a facility to iterate over each used inode?

xfs_bulkstat. although I doubt it fits your needs.

> 2. how could i easily copy the inode to a free space outside the current
>     agi (i thought of setting pag.pagf_freeblks, pag.pagf_flcount,
>     pag.pagf_longest to 0).

You could try by marking the AG unavailable to the allocator and use
xfs_swapext()

> 3. have i missed something or is there a better way to do it?

As it seems you're trying to implement online shrinking of a filesystem,
remember that moving an inode around actually changes the inode number
in XFS, which will you get all kinds of funnies not only with the kernel
but also userspace and nfs clients.


<Prev in Thread] Current Thread [Next in Thread>