linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / include / linux / nfsd / nfsfh.h
index 069257e..0798b77 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <asm/types.h>
 #ifdef __KERNEL__
+# include <linux/config.h>
 # include <linux/types.h>
 # include <linux/string.h>
 # include <linux/fs.h>
@@ -269,8 +270,14 @@ 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;
-       fhp->fh_post_blksize    = BLOCK_SIZE;
-       fhp->fh_post_blocks     = inode->i_blocks;
+       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_rdev[0]    = htonl((u32)imajor(inode));
        fhp->fh_post_rdev[1]    = htonl((u32)iminor(inode));
        fhp->fh_post_atime      = inode->i_atime;
@@ -290,9 +297,8 @@ 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_nested(struct svc_fh *fhp, unsigned int subclass)
+fh_lock(struct svc_fh *fhp)
 {
        struct dentry   *dentry = fhp->fh_dentry;
        struct inode    *inode;
@@ -311,17 +317,11 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
        }
 
        inode = dentry->d_inode;
-       mutex_lock_nested(&inode->i_mutex, subclass);
+       mutex_lock(&inode->i_mutex);
        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
  */