xfs
[Top] [All Lists]

how to free a used ag?

To: linux-xfs@xxxxxxxxxxx
Subject: how to free a used ag?
From: Markus Lidel <Markus.Lidel@xxxxxxxxxxxxxxxxx>
Date: Tue, 17 Aug 2004 00:35:56 +0200
Organization: Shadow Connect
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803
Hi...

could someone help me with freeing a used ag?

I want to do it inside the kernel and while the fs is mounted. I've already looked at the code, and it looks to me that freeing the agi of an ag is the easier part, so i want to start with it. I thought i could look at each inode of the agi i want to free, but i think i must iterate over each inode when freeing the used blocks anyway. So i iterate over each inode (starting with the root inode) and move the inode to a new one if it is inside the ag which should be freed. The second step is to look at the inode itself. If the data block is inside the ag it could be moved outside the ag too.

If i missed something until here, please let me know:-)

My questions are:
1. Is there a facility to iterate over each used inode?
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).
3. have i missed something or is there a better way to do it?

Any help is appreciated.

Thank you very much in advance.

Best regards,


Markus Lidel ------------------------------------------ Markus Lidel (Senior IT Consultant)

Shadow Connect GmbH
Carl-Reisch-Weg 12
D-86381 Krumbach
Germany

Phone:  +49 82 82/99 51-0
Fax:    +49 82 82/99 51-11

E-Mail: Markus.Lidel@xxxxxxxxxxxxxxxxx
URL:    http://www.shadowconnect.com


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