diff options
Diffstat (limited to 'include/linux/nfsd/nfsfh.h')
-rw-r--r-- | include/linux/nfsd/nfsfh.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index f9edcd2ff3c8..069257ea99a0 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
@@ -269,14 +269,8 @@ fill_post_wcc(struct svc_fh *fhp) | |||
269 | fhp->fh_post_uid = inode->i_uid; | 269 | fhp->fh_post_uid = inode->i_uid; |
270 | fhp->fh_post_gid = inode->i_gid; | 270 | fhp->fh_post_gid = inode->i_gid; |
271 | fhp->fh_post_size = inode->i_size; | 271 | fhp->fh_post_size = inode->i_size; |
272 | if (inode->i_blksize) { | 272 | fhp->fh_post_blksize = BLOCK_SIZE; |
273 | fhp->fh_post_blksize = inode->i_blksize; | 273 | fhp->fh_post_blocks = inode->i_blocks; |
274 | fhp->fh_post_blocks = inode->i_blocks; | ||
275 | } else { | ||
276 | fhp->fh_post_blksize = BLOCK_SIZE; | ||
277 | /* how much do we care for accuracy with MinixFS? */ | ||
278 | fhp->fh_post_blocks = (inode->i_size+511) >> 9; | ||
279 | } | ||
280 | fhp->fh_post_rdev[0] = htonl((u32)imajor(inode)); | 274 | fhp->fh_post_rdev[0] = htonl((u32)imajor(inode)); |
281 | fhp->fh_post_rdev[1] = htonl((u32)iminor(inode)); | 275 | fhp->fh_post_rdev[1] = htonl((u32)iminor(inode)); |
282 | fhp->fh_post_atime = inode->i_atime; | 276 | fhp->fh_post_atime = inode->i_atime; |
@@ -296,8 +290,9 @@ fill_post_wcc(struct svc_fh *fhp) | |||
296 | * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once | 290 | * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once |
297 | * so, any changes here should be reflected there. | 291 | * so, any changes here should be reflected there. |
298 | */ | 292 | */ |
293 | |||
299 | static inline void | 294 | static inline void |
300 | fh_lock(struct svc_fh *fhp) | 295 | fh_lock_nested(struct svc_fh *fhp, unsigned int subclass) |
301 | { | 296 | { |
302 | struct dentry *dentry = fhp->fh_dentry; | 297 | struct dentry *dentry = fhp->fh_dentry; |
303 | struct inode *inode; | 298 | struct inode *inode; |
@@ -316,11 +311,17 @@ fh_lock(struct svc_fh *fhp) | |||
316 | } | 311 | } |
317 | 312 | ||
318 | inode = dentry->d_inode; | 313 | inode = dentry->d_inode; |
319 | mutex_lock(&inode->i_mutex); | 314 | mutex_lock_nested(&inode->i_mutex, subclass); |
320 | fill_pre_wcc(fhp); | 315 | fill_pre_wcc(fhp); |
321 | fhp->fh_locked = 1; | 316 | fhp->fh_locked = 1; |
322 | } | 317 | } |
323 | 318 | ||
319 | static inline void | ||
320 | fh_lock(struct svc_fh *fhp) | ||
321 | { | ||
322 | fh_lock_nested(fhp, I_MUTEX_NORMAL); | ||
323 | } | ||
324 | |||
324 | /* | 325 | /* |
325 | * Unlock a file handle/inode | 326 | * Unlock a file handle/inode |
326 | */ | 327 | */ |