Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / include / linux / nfsd / nfsfh.h
index 0798b77..069257e 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <asm/types.h>
 #ifdef __KERNEL__
-# include <linux/config.h>
 # include <linux/types.h>
 # include <linux/string.h>
 # include <linux/fs.h>
@@ -270,14 +269,8 @@ fill_post_wcc(struct svc_fh *fhp)
        fhp->fh_post_uid        = inode->i_uid;
        fhp->fh_post_gid        = inode->i_gid;
        fhp->fh_post_size       = inode->i_size;
-       if (inode->i_blksize) {
-               fhp->fh_post_blksize    = inode->i_blksize;
-               fhp->fh_post_blocks     = inode->i_blocks;
-       } else {
-               fhp->fh_post_blksize    = BLOCK_SIZE;
-               /* how much do we care for accuracy with MinixFS? */
-               fhp->fh_post_blocks     = (inode->i_size+511) >> 9;
-       }
+       fhp->fh_post_blksize    = BLOCK_SIZE;
+       fhp->fh_post_blocks     = inode->i_blocks;
        fhp->fh_post_rdev[0]    = htonl((u32)imajor(inode));
        fhp->fh_post_rdev[1]    = htonl((u32)iminor(inode));
        fhp->fh_post_atime      = inode->i_atime;
@@ -297,8 +290,9 @@ fill_post_wcc(struct svc_fh *fhp)
  * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once
  * so, any changes here should be reflected there.
  */
+
 static inline void
-fh_lock(struct svc_fh *fhp)
+fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
 {
        struct dentry   *dentry = fhp->fh_dentry;
        struct inode    *inode;
@@ -317,11 +311,17 @@ fh_lock(struct svc_fh *fhp)
        }
 
        inode = dentry->d_inode;
-       mutex_lock(&inode->i_mutex);
+       mutex_lock_nested(&inode->i_mutex, subclass);
        fill_pre_wcc(fhp);
        fhp->fh_locked = 1;
 }
 
+static inline void
+fh_lock(struct svc_fh *fhp)
+{
+       fh_lock_nested(fhp, I_MUTEX_NORMAL);
+}
+
 /*
  * Unlock a file handle/inode
  */