Skip to contentSkip to conversation

porting xfs_reno to linux

DISCUSSION Ruben Porras 2 participants 3 messages Nov 13, 2007 – Nov 14, 2007

lore
Share & tools
lore
#0 lore raw

Let's go back to the shrink xfs theme.

Quoted 5 lines

2. Move inodes out of offline AGs
- On Irix, we have a program called 'xfs_reno' which converts 64 bit inode filesystems to 32 bit inode filesystems. This needs to be:
- released under the GPL (should not be a problem).

done

Quoted 1 line

- ported to linux

Do you mean, rewrite the program to work on kernel space, or just port it to glibc?

Doing most of it on user land is easier, xfs_reno is already there, but it requires the AGs of the file system which are going to disappear to be traversed several times. It is needed to traverse each 'marked' AG one time to find its list of inodes. Then these inodes are going to be looked up during xfs_reno operation again several times (e.g. while copying attributes, linking and unlinking files...) is these information cached?

On the other side on kernel space it can be done without going through the ioctls.

Quoted 4 lines

- modified to understand inodes sit in certain AGs and to move them out of those AGs as needed.
- requires filesystem traversal to find all the inodes to be moved.

To accomplish this I would write a function that traverses all the 'marked' AGs and return the list of ids to reallocate. These list could be exported through an ioctl to user space if needed. I don't find any function that traverses an AG, I've only seen functions to look up the records of an inode. Is there any function that do something similar or do I need to write if from scratch? Where can I find examples of it? is xfs_inobt_lookup the best one?

Thanks.

Signature · 2 lines
Rubén Porras
LinWorks GmbH
#1 lore raw
Quoted 8 lines · Ruben Porras

Let's go back to the shrink xfs theme.

Quoted 5 lines

2. Move inodes out of offline AGs
- On Irix, we have a program called 'xfs_reno' which converts 64 bit inode filesystems to 32 bit inode filesystems. This needs to be:
- released under the GPL (should not be a problem).

Quoted 5 lines

done

Quoted 1 line

- ported to linux

Do you mean, rewrite the program to work on kernel space,

No.

Quoted 2 lines

or just port it
to glibc?

Port to linux. i.e. make it work and remove any tainted code that it might contain from Irix so we can open source it. Barry has already done this; the patch is here:

http://oss.sgi.com/archives/xfs/2007-10/msg00054.html

All it needs is reviewing and then xfs_reno for linux is done.

Cheers,

Dave.

Signature · 3 lines
Dave Chinner
Principal Engineer
SGI Australian Software Group
#2 lore raw
Quoted 25 lines · David Chinner
Quoted 9 lines · Ruben Porras

Let's go back to the shrink xfs theme.

Quoted 6 lines

2. Move inodes out of offline AGs
- On Irix, we have a program called 'xfs_reno' which converts 64 bit inode filesystems to 32 bit inode filesystems. This needs to be:
- released under the GPL (should not be a problem).

Quoted 7 lines

done

Quoted 2 lines

- ported to linux

Do you mean, rewrite the program to work on kernel space,

No.

Quoted 2 lines

or just port it to glibc?

Quoted 9 lines

Port to linux. i.e. make it work and remove any tainted code that it might contain from Irix so we can open source it. Barry has already done this; the patch is here:

http://oss.sgi.com/archives/xfs/2007-10/msg00054.html

All it needs is reviewing and then xfs_reno for linux is done.

Sorry, I didn't exlplain myself well enough. I already saw the mail from Barry, but the program needs not only a review. Now xfs_reno filter the inodes with nftw and the stat info. The problem is that we need to filter the inodes according to the AG where they are. Currently there is no way to find this out. Possibilities:

a) Extend the bulkstat structure to include the AG number (better not)
b) A new ioctl to find out the AG of an inode. and call the ioctl for each file on the fs.
c) Find all the inodes in 'marked' AGs. Export it through a new ioctl. xfs_reno needs to find later which files on the fs were on the list.

The second way would be to do everything in kernel space. The steps would be:

a) Find all the inodes in 'marked' AGs
b) Allocate a new inode for each one
c) Move the information from each old inode to the new one and unlink the old one. (This is what Barry suggest to do anyway in kernel space)

xfs_reno does only steps b) and c).

The second needs more work, but it doesn't need to traverse the filesystem several times.

Quoted 4 lines

Cheers,

Dave.

Signature · 2 lines
Rubén Porras
LinWorks GmbH