On Feb 16, 2008, at 5:46 PM, Pete Wyckoff wrote:

If anyone is excited about tracking the latest kernels,

Oh, so very.

pvfs kmod
breaks on 2.6.25-rc1 and later due to this commit.  It's a bit too
deep for me to handle.

More config checks and #ifdefs. We basically can call our read_inode directly (which does a getattr to fill in the inode) if its no longer part of the super_operations struct. We were doing this before, but through the actual s_ops->read_inode pointer. Can you try the attached patch? It compiles against the latest tree, but I don't have a machine that I can run that kernel on at the moment.

Also, I didn't include configure in this patch so you'll have to ./ prepare.

The #ifdefs around the iget4, iget5_locked, etc. code are especially nasty. iget5_locked has been defined in all versions of the 2.6 kernel, so it would be really nice to just whack those #ifdefs if we were to decide not to support 2.4 kernels in future releases.

Thanks,
-sam

Attachment: nomo-read-inode.patch
Description: Binary data







                -- Pete


commit 12debc4248a4a7f1873e47cda2cdd7faca80b099
Author: David Howells <[EMAIL PROTECTED]>
Date:   Thu Feb 7 00:15:52 2008 -0800

iget: remove iget() and the read_inode() super op as being obsolete

Remove the old iget() call and the read_inode() superblock operation it uses as these are really obsolete, and the use of read_inode() does not produce proper error handling (no distinction between ENOMEM and EIO when marking an
inode bad).

Furthermore, this removes the temptation to use iget() to find an inode by
number in a filesystem from code outside that filesystem.

iget_locked() should be used instead. A new function is added in an earlier patch (iget_failed) that is to be called to mark an inode as bad, unlock it and release it should the get routine fail. Mark iget() and read_inode() as
being obsolete and remove references to them from the documentation.

Typically a filesystem will be modified such that the read_inode function
becomes an internal iget function, for example the following:

   void thingyfs_read_inode(struct inode *inode)
   {
            ...
   }

would be changed into something like:

struct inode *thingyfs_iget(struct super_block *sp, unsigned long ino)
   {
            struct inode *inode;
            int ret;

            inode = iget_locked(sb, ino);
            if (!inode)
                    return ERR_PTR(-ENOMEM);
            if (!(inode->i_state & I_NEW))
                    return inode;

            ...
            unlock_new_inode(inode);
            return inode;
   error:
            iget_failed(inode);
            return ERR_PTR(ret);
   }

and then thingyfs_iget() would be called rather than iget(), for example:

   ret = -EINVAL;
   inode = iget(sb, ino);
   if (!inode || is_bad_inode(inode))
            goto error;

becomes:

   inode = thingyfs_iget(sb, ino);
   if (IS_ERR(inode)) {
            ret = PTR_ERR(inode);
            goto error;
   }

Note that is_bad_inode() does not need to be called. The error returned by
thingyfs_iget() should render it unnecessary.

_______________________________________________
Pvfs2-developers mailing list
Pvfs2-developers@beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers


_______________________________________________
Pvfs2-developers mailing list
Pvfs2-developers@beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to