diff options
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 127 |
1 files changed, 55 insertions, 72 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index e8bbfa5b3500..e605d695dbcb 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -121,7 +121,7 @@ static void nfs_clear_inode(struct inode *inode) | |||
121 | void nfs_evict_inode(struct inode *inode) | 121 | void nfs_evict_inode(struct inode *inode) |
122 | { | 122 | { |
123 | truncate_inode_pages(&inode->i_data, 0); | 123 | truncate_inode_pages(&inode->i_data, 0); |
124 | end_writeback(inode); | 124 | clear_inode(inode); |
125 | nfs_clear_inode(inode); | 125 | nfs_clear_inode(inode); |
126 | } | 126 | } |
127 | 127 | ||
@@ -285,9 +285,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
285 | inode->i_mode = fattr->mode; | 285 | inode->i_mode = fattr->mode; |
286 | if ((fattr->valid & NFS_ATTR_FATTR_MODE) == 0 | 286 | if ((fattr->valid & NFS_ATTR_FATTR_MODE) == 0 |
287 | && nfs_server_capable(inode, NFS_CAP_MODE)) | 287 | && nfs_server_capable(inode, NFS_CAP_MODE)) |
288 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 288 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
289 | | NFS_INO_INVALID_ACCESS | ||
290 | | NFS_INO_INVALID_ACL; | ||
291 | /* Why so? Because we want revalidate for devices/FIFOs, and | 289 | /* Why so? Because we want revalidate for devices/FIFOs, and |
292 | * that's precisely what we have in nfs_file_inode_operations. | 290 | * that's precisely what we have in nfs_file_inode_operations. |
293 | */ | 291 | */ |
@@ -300,8 +298,6 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
300 | inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops; | 298 | inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops; |
301 | inode->i_fop = &nfs_dir_operations; | 299 | inode->i_fop = &nfs_dir_operations; |
302 | inode->i_data.a_ops = &nfs_dir_aops; | 300 | inode->i_data.a_ops = &nfs_dir_aops; |
303 | if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS)) | ||
304 | set_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags); | ||
305 | /* Deal with crossing mountpoints */ | 301 | /* Deal with crossing mountpoints */ |
306 | if (fattr->valid & NFS_ATTR_FATTR_MOUNTPOINT || | 302 | if (fattr->valid & NFS_ATTR_FATTR_MOUNTPOINT || |
307 | fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) { | 303 | fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) { |
@@ -327,6 +323,8 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
327 | inode->i_gid = -2; | 323 | inode->i_gid = -2; |
328 | inode->i_blocks = 0; | 324 | inode->i_blocks = 0; |
329 | memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); | 325 | memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); |
326 | nfsi->write_io = 0; | ||
327 | nfsi->read_io = 0; | ||
330 | 328 | ||
331 | nfsi->read_cache_jiffies = fattr->time_start; | 329 | nfsi->read_cache_jiffies = fattr->time_start; |
332 | nfsi->attr_gencount = fattr->gencount; | 330 | nfsi->attr_gencount = fattr->gencount; |
@@ -337,24 +335,19 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
337 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) | 335 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) |
338 | inode->i_mtime = fattr->mtime; | 336 | inode->i_mtime = fattr->mtime; |
339 | else if (nfs_server_capable(inode, NFS_CAP_MTIME)) | 337 | else if (nfs_server_capable(inode, NFS_CAP_MTIME)) |
340 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 338 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
341 | | NFS_INO_INVALID_DATA; | ||
342 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) | 339 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) |
343 | inode->i_ctime = fattr->ctime; | 340 | inode->i_ctime = fattr->ctime; |
344 | else if (nfs_server_capable(inode, NFS_CAP_CTIME)) | 341 | else if (nfs_server_capable(inode, NFS_CAP_CTIME)) |
345 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 342 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
346 | | NFS_INO_INVALID_ACCESS | ||
347 | | NFS_INO_INVALID_ACL; | ||
348 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) | 343 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) |
349 | inode->i_version = fattr->change_attr; | 344 | inode->i_version = fattr->change_attr; |
350 | else if (nfs_server_capable(inode, NFS_CAP_CHANGE_ATTR)) | 345 | else if (nfs_server_capable(inode, NFS_CAP_CHANGE_ATTR)) |
351 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 346 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
352 | | NFS_INO_INVALID_DATA; | ||
353 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) | 347 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) |
354 | inode->i_size = nfs_size_to_loff_t(fattr->size); | 348 | inode->i_size = nfs_size_to_loff_t(fattr->size); |
355 | else | 349 | else |
356 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 350 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR |
357 | | NFS_INO_INVALID_DATA | ||
358 | | NFS_INO_REVAL_PAGECACHE; | 351 | | NFS_INO_REVAL_PAGECACHE; |
359 | if (fattr->valid & NFS_ATTR_FATTR_NLINK) | 352 | if (fattr->valid & NFS_ATTR_FATTR_NLINK) |
360 | set_nlink(inode, fattr->nlink); | 353 | set_nlink(inode, fattr->nlink); |
@@ -363,15 +356,11 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
363 | if (fattr->valid & NFS_ATTR_FATTR_OWNER) | 356 | if (fattr->valid & NFS_ATTR_FATTR_OWNER) |
364 | inode->i_uid = fattr->uid; | 357 | inode->i_uid = fattr->uid; |
365 | else if (nfs_server_capable(inode, NFS_CAP_OWNER)) | 358 | else if (nfs_server_capable(inode, NFS_CAP_OWNER)) |
366 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 359 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
367 | | NFS_INO_INVALID_ACCESS | ||
368 | | NFS_INO_INVALID_ACL; | ||
369 | if (fattr->valid & NFS_ATTR_FATTR_GROUP) | 360 | if (fattr->valid & NFS_ATTR_FATTR_GROUP) |
370 | inode->i_gid = fattr->gid; | 361 | inode->i_gid = fattr->gid; |
371 | else if (nfs_server_capable(inode, NFS_CAP_OWNER_GROUP)) | 362 | else if (nfs_server_capable(inode, NFS_CAP_OWNER_GROUP)) |
372 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 363 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
373 | | NFS_INO_INVALID_ACCESS | ||
374 | | NFS_INO_INVALID_ACL; | ||
375 | if (fattr->valid & NFS_ATTR_FATTR_BLOCKS_USED) | 364 | if (fattr->valid & NFS_ATTR_FATTR_BLOCKS_USED) |
376 | inode->i_blocks = fattr->du.nfs2.blocks; | 365 | inode->i_blocks = fattr->du.nfs2.blocks; |
377 | if (fattr->valid & NFS_ATTR_FATTR_SPACE_USED) { | 366 | if (fattr->valid & NFS_ATTR_FATTR_SPACE_USED) { |
@@ -429,8 +418,10 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
429 | return 0; | 418 | return 0; |
430 | 419 | ||
431 | /* Write all dirty data */ | 420 | /* Write all dirty data */ |
432 | if (S_ISREG(inode->i_mode)) | 421 | if (S_ISREG(inode->i_mode)) { |
422 | nfs_inode_dio_wait(inode); | ||
433 | nfs_wb_all(inode); | 423 | nfs_wb_all(inode); |
424 | } | ||
434 | 425 | ||
435 | fattr = nfs_alloc_fattr(); | 426 | fattr = nfs_alloc_fattr(); |
436 | if (fattr == NULL) | 427 | if (fattr == NULL) |
@@ -514,6 +505,7 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | |||
514 | 505 | ||
515 | /* Flush out writes to the server in order to update c/mtime. */ | 506 | /* Flush out writes to the server in order to update c/mtime. */ |
516 | if (S_ISREG(inode->i_mode)) { | 507 | if (S_ISREG(inode->i_mode)) { |
508 | nfs_inode_dio_wait(inode); | ||
517 | err = filemap_write_and_wait(inode->i_mapping); | 509 | err = filemap_write_and_wait(inode->i_mapping); |
518 | if (err) | 510 | if (err) |
519 | goto out; | 511 | goto out; |
@@ -654,6 +646,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f | |||
654 | nfs_init_lock_context(&ctx->lock_context); | 646 | nfs_init_lock_context(&ctx->lock_context); |
655 | ctx->lock_context.open_context = ctx; | 647 | ctx->lock_context.open_context = ctx; |
656 | INIT_LIST_HEAD(&ctx->list); | 648 | INIT_LIST_HEAD(&ctx->list); |
649 | ctx->mdsthreshold = NULL; | ||
657 | return ctx; | 650 | return ctx; |
658 | } | 651 | } |
659 | 652 | ||
@@ -682,6 +675,7 @@ static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync) | |||
682 | put_rpccred(ctx->cred); | 675 | put_rpccred(ctx->cred); |
683 | dput(ctx->dentry); | 676 | dput(ctx->dentry); |
684 | nfs_sb_deactive(sb); | 677 | nfs_sb_deactive(sb); |
678 | kfree(ctx->mdsthreshold); | ||
685 | kfree(ctx); | 679 | kfree(ctx); |
686 | } | 680 | } |
687 | 681 | ||
@@ -870,6 +864,15 @@ static int nfs_invalidate_mapping(struct inode *inode, struct address_space *map | |||
870 | return 0; | 864 | return 0; |
871 | } | 865 | } |
872 | 866 | ||
867 | static bool nfs_mapping_need_revalidate_inode(struct inode *inode) | ||
868 | { | ||
869 | if (nfs_have_delegated_attributes(inode)) | ||
870 | return false; | ||
871 | return (NFS_I(inode)->cache_validity & NFS_INO_REVAL_PAGECACHE) | ||
872 | || nfs_attribute_timeout(inode) | ||
873 | || NFS_STALE(inode); | ||
874 | } | ||
875 | |||
873 | /** | 876 | /** |
874 | * nfs_revalidate_mapping - Revalidate the pagecache | 877 | * nfs_revalidate_mapping - Revalidate the pagecache |
875 | * @inode - pointer to host inode | 878 | * @inode - pointer to host inode |
@@ -880,9 +883,7 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) | |||
880 | struct nfs_inode *nfsi = NFS_I(inode); | 883 | struct nfs_inode *nfsi = NFS_I(inode); |
881 | int ret = 0; | 884 | int ret = 0; |
882 | 885 | ||
883 | if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) | 886 | if (nfs_mapping_need_revalidate_inode(inode)) { |
884 | || nfs_attribute_cache_expired(inode) | ||
885 | || NFS_STALE(inode)) { | ||
886 | ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); | 887 | ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); |
887 | if (ret < 0) | 888 | if (ret < 0) |
888 | goto out; | 889 | goto out; |
@@ -948,6 +949,8 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat | |||
948 | unsigned long invalid = 0; | 949 | unsigned long invalid = 0; |
949 | 950 | ||
950 | 951 | ||
952 | if (nfs_have_delegated_attributes(inode)) | ||
953 | return 0; | ||
951 | /* Has the inode gone and changed behind our back? */ | 954 | /* Has the inode gone and changed behind our back? */ |
952 | if ((fattr->valid & NFS_ATTR_FATTR_FILEID) && nfsi->fileid != fattr->fileid) | 955 | if ((fattr->valid & NFS_ATTR_FATTR_FILEID) && nfsi->fileid != fattr->fileid) |
953 | return -EIO; | 956 | return -EIO; |
@@ -960,7 +963,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat | |||
960 | 963 | ||
961 | /* Verify a few of the more important attributes */ | 964 | /* Verify a few of the more important attributes */ |
962 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec_equal(&inode->i_mtime, &fattr->mtime)) | 965 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec_equal(&inode->i_mtime, &fattr->mtime)) |
963 | invalid |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE; | 966 | invalid |= NFS_INO_INVALID_ATTR; |
964 | 967 | ||
965 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) { | 968 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) { |
966 | cur_size = i_size_read(inode); | 969 | cur_size = i_size_read(inode); |
@@ -1279,14 +1282,26 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1279 | nfs_display_fhandle_hash(NFS_FH(inode)), | 1282 | nfs_display_fhandle_hash(NFS_FH(inode)), |
1280 | atomic_read(&inode->i_count), fattr->valid); | 1283 | atomic_read(&inode->i_count), fattr->valid); |
1281 | 1284 | ||
1282 | if ((fattr->valid & NFS_ATTR_FATTR_FILEID) && nfsi->fileid != fattr->fileid) | 1285 | if ((fattr->valid & NFS_ATTR_FATTR_FILEID) && nfsi->fileid != fattr->fileid) { |
1283 | goto out_fileid; | 1286 | printk(KERN_ERR "NFS: server %s error: fileid changed\n" |
1287 | "fsid %s: expected fileid 0x%Lx, got 0x%Lx\n", | ||
1288 | NFS_SERVER(inode)->nfs_client->cl_hostname, | ||
1289 | inode->i_sb->s_id, (long long)nfsi->fileid, | ||
1290 | (long long)fattr->fileid); | ||
1291 | goto out_err; | ||
1292 | } | ||
1284 | 1293 | ||
1285 | /* | 1294 | /* |
1286 | * Make sure the inode's type hasn't changed. | 1295 | * Make sure the inode's type hasn't changed. |
1287 | */ | 1296 | */ |
1288 | if ((fattr->valid & NFS_ATTR_FATTR_TYPE) && (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) | 1297 | if ((fattr->valid & NFS_ATTR_FATTR_TYPE) && (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) { |
1289 | goto out_changed; | 1298 | /* |
1299 | * Big trouble! The inode has become a different object. | ||
1300 | */ | ||
1301 | printk(KERN_DEBUG "NFS: %s: inode %ld mode changed, %07o to %07o\n", | ||
1302 | __func__, inode->i_ino, inode->i_mode, fattr->mode); | ||
1303 | goto out_err; | ||
1304 | } | ||
1290 | 1305 | ||
1291 | server = NFS_SERVER(inode); | 1306 | server = NFS_SERVER(inode); |
1292 | /* Update the fsid? */ | 1307 | /* Update the fsid? */ |
@@ -1314,7 +1329,11 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1314 | if (inode->i_version != fattr->change_attr) { | 1329 | if (inode->i_version != fattr->change_attr) { |
1315 | dprintk("NFS: change_attr change on server for file %s/%ld\n", | 1330 | dprintk("NFS: change_attr change on server for file %s/%ld\n", |
1316 | inode->i_sb->s_id, inode->i_ino); | 1331 | inode->i_sb->s_id, inode->i_ino); |
1317 | invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; | 1332 | invalid |= NFS_INO_INVALID_ATTR |
1333 | | NFS_INO_INVALID_DATA | ||
1334 | | NFS_INO_INVALID_ACCESS | ||
1335 | | NFS_INO_INVALID_ACL | ||
1336 | | NFS_INO_REVAL_PAGECACHE; | ||
1318 | if (S_ISDIR(inode->i_mode)) | 1337 | if (S_ISDIR(inode->i_mode)) |
1319 | nfs_force_lookup_revalidate(inode); | 1338 | nfs_force_lookup_revalidate(inode); |
1320 | inode->i_version = fattr->change_attr; | 1339 | inode->i_version = fattr->change_attr; |
@@ -1323,38 +1342,15 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1323 | invalid |= save_cache_validity; | 1342 | invalid |= save_cache_validity; |
1324 | 1343 | ||
1325 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) { | 1344 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) { |
1326 | /* NFSv2/v3: Check if the mtime agrees */ | 1345 | memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); |
1327 | if (!timespec_equal(&inode->i_mtime, &fattr->mtime)) { | ||
1328 | dprintk("NFS: mtime change on server for file %s/%ld\n", | ||
1329 | inode->i_sb->s_id, inode->i_ino); | ||
1330 | invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA; | ||
1331 | if (S_ISDIR(inode->i_mode)) | ||
1332 | nfs_force_lookup_revalidate(inode); | ||
1333 | memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); | ||
1334 | } | ||
1335 | } else if (server->caps & NFS_CAP_MTIME) | 1346 | } else if (server->caps & NFS_CAP_MTIME) |
1336 | invalid |= save_cache_validity & (NFS_INO_INVALID_ATTR | 1347 | invalid |= save_cache_validity & (NFS_INO_INVALID_ATTR |
1337 | | NFS_INO_INVALID_DATA | ||
1338 | | NFS_INO_REVAL_PAGECACHE | ||
1339 | | NFS_INO_REVAL_FORCED); | 1348 | | NFS_INO_REVAL_FORCED); |
1340 | 1349 | ||
1341 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) { | 1350 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) { |
1342 | /* If ctime has changed we should definitely clear access+acl caches */ | 1351 | memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime)); |
1343 | if (!timespec_equal(&inode->i_ctime, &fattr->ctime)) { | ||
1344 | invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; | ||
1345 | /* and probably clear data for a directory too as utimes can cause | ||
1346 | * havoc with our cache. | ||
1347 | */ | ||
1348 | if (S_ISDIR(inode->i_mode)) { | ||
1349 | invalid |= NFS_INO_INVALID_DATA; | ||
1350 | nfs_force_lookup_revalidate(inode); | ||
1351 | } | ||
1352 | memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime)); | ||
1353 | } | ||
1354 | } else if (server->caps & NFS_CAP_CTIME) | 1352 | } else if (server->caps & NFS_CAP_CTIME) |
1355 | invalid |= save_cache_validity & (NFS_INO_INVALID_ATTR | 1353 | invalid |= save_cache_validity & (NFS_INO_INVALID_ATTR |
1356 | | NFS_INO_INVALID_ACCESS | ||
1357 | | NFS_INO_INVALID_ACL | ||
1358 | | NFS_INO_REVAL_FORCED); | 1354 | | NFS_INO_REVAL_FORCED); |
1359 | 1355 | ||
1360 | /* Check if our cached file size is stale */ | 1356 | /* Check if our cached file size is stale */ |
@@ -1466,12 +1462,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1466 | nfsi->cache_validity |= invalid; | 1462 | nfsi->cache_validity |= invalid; |
1467 | 1463 | ||
1468 | return 0; | 1464 | return 0; |
1469 | out_changed: | ||
1470 | /* | ||
1471 | * Big trouble! The inode has become a different object. | ||
1472 | */ | ||
1473 | printk(KERN_DEBUG "NFS: %s: inode %ld mode changed, %07o to %07o\n", | ||
1474 | __func__, inode->i_ino, inode->i_mode, fattr->mode); | ||
1475 | out_err: | 1465 | out_err: |
1476 | /* | 1466 | /* |
1477 | * No need to worry about unhashing the dentry, as the | 1467 | * No need to worry about unhashing the dentry, as the |
@@ -1480,13 +1470,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1480 | */ | 1470 | */ |
1481 | nfs_invalidate_inode(inode); | 1471 | nfs_invalidate_inode(inode); |
1482 | return -ESTALE; | 1472 | return -ESTALE; |
1483 | |||
1484 | out_fileid: | ||
1485 | printk(KERN_ERR "NFS: server %s error: fileid changed\n" | ||
1486 | "fsid %s: expected fileid 0x%Lx, got 0x%Lx\n", | ||
1487 | NFS_SERVER(inode)->nfs_client->cl_hostname, inode->i_sb->s_id, | ||
1488 | (long long)nfsi->fileid, (long long)fattr->fileid); | ||
1489 | goto out_err; | ||
1490 | } | 1473 | } |
1491 | 1474 | ||
1492 | 1475 | ||
@@ -1500,7 +1483,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1500 | void nfs4_evict_inode(struct inode *inode) | 1483 | void nfs4_evict_inode(struct inode *inode) |
1501 | { | 1484 | { |
1502 | truncate_inode_pages(&inode->i_data, 0); | 1485 | truncate_inode_pages(&inode->i_data, 0); |
1503 | end_writeback(inode); | 1486 | clear_inode(inode); |
1504 | pnfs_return_layout(inode); | 1487 | pnfs_return_layout(inode); |
1505 | pnfs_destroy_layout(NFS_I(inode)); | 1488 | pnfs_destroy_layout(NFS_I(inode)); |
1506 | /* If we are holding a delegation, return it! */ | 1489 | /* If we are holding a delegation, return it! */ |
@@ -1547,7 +1530,7 @@ static inline void nfs4_init_once(struct nfs_inode *nfsi) | |||
1547 | nfsi->delegation_state = 0; | 1530 | nfsi->delegation_state = 0; |
1548 | init_rwsem(&nfsi->rwsem); | 1531 | init_rwsem(&nfsi->rwsem); |
1549 | nfsi->layout = NULL; | 1532 | nfsi->layout = NULL; |
1550 | atomic_set(&nfsi->commits_outstanding, 0); | 1533 | atomic_set(&nfsi->commit_info.rpcs_out, 0); |
1551 | #endif | 1534 | #endif |
1552 | } | 1535 | } |
1553 | 1536 | ||
@@ -1559,9 +1542,9 @@ static void init_once(void *foo) | |||
1559 | INIT_LIST_HEAD(&nfsi->open_files); | 1542 | INIT_LIST_HEAD(&nfsi->open_files); |
1560 | INIT_LIST_HEAD(&nfsi->access_cache_entry_lru); | 1543 | INIT_LIST_HEAD(&nfsi->access_cache_entry_lru); |
1561 | INIT_LIST_HEAD(&nfsi->access_cache_inode_lru); | 1544 | INIT_LIST_HEAD(&nfsi->access_cache_inode_lru); |
1562 | INIT_LIST_HEAD(&nfsi->commit_list); | 1545 | INIT_LIST_HEAD(&nfsi->commit_info.list); |
1563 | nfsi->npages = 0; | 1546 | nfsi->npages = 0; |
1564 | nfsi->ncommit = 0; | 1547 | nfsi->commit_info.ncommit = 0; |
1565 | atomic_set(&nfsi->silly_count, 1); | 1548 | atomic_set(&nfsi->silly_count, 1); |
1566 | INIT_HLIST_HEAD(&nfsi->silly_list); | 1549 | INIT_HLIST_HEAD(&nfsi->silly_list); |
1567 | init_waitqueue_head(&nfsi->waitqueue); | 1550 | init_waitqueue_head(&nfsi->waitqueue); |