aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-27 22:12:39 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-27 22:12:39 -0400
commitdecf491f3076190262d4c649bed877650623903a (patch)
tree8f67577349fe451b0267b68435db1578ec1273a4 /fs/nfs/proc.c
parent33801147a8fda6b04d7e9afe1d42f1c01d3d6837 (diff)
NFS: Don't let nfs_end_data_update() clobber attribute update information
Since we almost always call nfs_end_data_update() after we called nfs_refresh_inode(), we now end up marking the inode metadata as needing revalidation immediately after having updated it. This patch rearranges things so that we mark the inode as needing revalidation _before_ we call nfs_refresh_inode() on those operations that need it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/proc.c')
-rw-r--r--fs/nfs/proc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 5ef28f08f424..a48a003242c0 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -206,7 +206,7 @@ static int nfs_proc_write(struct nfs_write_data *wdata)
206 nfs_fattr_init(fattr); 206 nfs_fattr_init(fattr);
207 status = rpc_call_sync(NFS_CLIENT(inode), &msg, flags); 207 status = rpc_call_sync(NFS_CLIENT(inode), &msg, flags);
208 if (status >= 0) { 208 if (status >= 0) {
209 nfs_refresh_inode(inode, fattr); 209 nfs_post_op_update_inode(inode, fattr);
210 wdata->res.count = wdata->args.count; 210 wdata->res.count = wdata->args.count;
211 wdata->verf.committed = NFS_FILE_SYNC; 211 wdata->verf.committed = NFS_FILE_SYNC;
212 } 212 }
@@ -275,6 +275,7 @@ nfs_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
275 275
276 nfs_fattr_init(&fattr); 276 nfs_fattr_init(&fattr);
277 status = rpc_call(NFS_CLIENT(dir), NFSPROC_CREATE, &arg, &res, 0); 277 status = rpc_call(NFS_CLIENT(dir), NFSPROC_CREATE, &arg, &res, 0);
278 nfs_mark_for_revalidate(dir);
278 279
279 if (status == -EINVAL && S_ISFIFO(mode)) { 280 if (status == -EINVAL && S_ISFIFO(mode)) {
280 sattr->ia_mode = mode; 281 sattr->ia_mode = mode;
@@ -305,6 +306,7 @@ nfs_proc_remove(struct inode *dir, struct qstr *name)
305 306
306 dprintk("NFS call remove %s\n", name->name); 307 dprintk("NFS call remove %s\n", name->name);
307 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 308 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
309 nfs_mark_for_revalidate(dir);
308 310
309 dprintk("NFS reply remove: %d\n", status); 311 dprintk("NFS reply remove: %d\n", status);
310 return status; 312 return status;
@@ -331,8 +333,10 @@ nfs_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
331{ 333{
332 struct rpc_message *msg = &task->tk_msg; 334 struct rpc_message *msg = &task->tk_msg;
333 335
334 if (msg->rpc_argp) 336 if (msg->rpc_argp) {
337 nfs_mark_for_revalidate(dir->d_inode);
335 kfree(msg->rpc_argp); 338 kfree(msg->rpc_argp);
339 }
336 return 0; 340 return 0;
337} 341}
338 342
@@ -352,6 +356,8 @@ nfs_proc_rename(struct inode *old_dir, struct qstr *old_name,
352 356
353 dprintk("NFS call rename %s -> %s\n", old_name->name, new_name->name); 357 dprintk("NFS call rename %s -> %s\n", old_name->name, new_name->name);
354 status = rpc_call(NFS_CLIENT(old_dir), NFSPROC_RENAME, &arg, NULL, 0); 358 status = rpc_call(NFS_CLIENT(old_dir), NFSPROC_RENAME, &arg, NULL, 0);
359 nfs_mark_for_revalidate(old_dir);
360 nfs_mark_for_revalidate(new_dir);
355 dprintk("NFS reply rename: %d\n", status); 361 dprintk("NFS reply rename: %d\n", status);
356 return status; 362 return status;
357} 363}
@@ -369,6 +375,7 @@ nfs_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
369 375
370 dprintk("NFS call link %s\n", name->name); 376 dprintk("NFS call link %s\n", name->name);
371 status = rpc_call(NFS_CLIENT(inode), NFSPROC_LINK, &arg, NULL, 0); 377 status = rpc_call(NFS_CLIENT(inode), NFSPROC_LINK, &arg, NULL, 0);
378 nfs_mark_for_revalidate(dir);
372 dprintk("NFS reply link: %d\n", status); 379 dprintk("NFS reply link: %d\n", status);
373 return status; 380 return status;
374} 381}
@@ -394,6 +401,7 @@ nfs_proc_symlink(struct inode *dir, struct qstr *name, struct qstr *path,
394 nfs_fattr_init(fattr); 401 nfs_fattr_init(fattr);
395 fhandle->size = 0; 402 fhandle->size = 0;
396 status = rpc_call(NFS_CLIENT(dir), NFSPROC_SYMLINK, &arg, NULL, 0); 403 status = rpc_call(NFS_CLIENT(dir), NFSPROC_SYMLINK, &arg, NULL, 0);
404 nfs_mark_for_revalidate(dir);
397 dprintk("NFS reply symlink: %d\n", status); 405 dprintk("NFS reply symlink: %d\n", status);
398 return status; 406 return status;
399} 407}
@@ -418,6 +426,7 @@ nfs_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr)
418 dprintk("NFS call mkdir %s\n", dentry->d_name.name); 426 dprintk("NFS call mkdir %s\n", dentry->d_name.name);
419 nfs_fattr_init(&fattr); 427 nfs_fattr_init(&fattr);
420 status = rpc_call(NFS_CLIENT(dir), NFSPROC_MKDIR, &arg, &res, 0); 428 status = rpc_call(NFS_CLIENT(dir), NFSPROC_MKDIR, &arg, &res, 0);
429 nfs_mark_for_revalidate(dir);
421 if (status == 0) 430 if (status == 0)
422 status = nfs_instantiate(dentry, &fhandle, &fattr); 431 status = nfs_instantiate(dentry, &fhandle, &fattr);
423 dprintk("NFS reply mkdir: %d\n", status); 432 dprintk("NFS reply mkdir: %d\n", status);
@@ -436,6 +445,7 @@ nfs_proc_rmdir(struct inode *dir, struct qstr *name)
436 445
437 dprintk("NFS call rmdir %s\n", name->name); 446 dprintk("NFS call rmdir %s\n", name->name);
438 status = rpc_call(NFS_CLIENT(dir), NFSPROC_RMDIR, &arg, NULL, 0); 447 status = rpc_call(NFS_CLIENT(dir), NFSPROC_RMDIR, &arg, NULL, 0);
448 nfs_mark_for_revalidate(dir);
439 dprintk("NFS reply rmdir: %d\n", status); 449 dprintk("NFS reply rmdir: %d\n", status);
440 return status; 450 return status;
441} 451}
@@ -579,7 +589,7 @@ nfs_write_done(struct rpc_task *task)
579 struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata; 589 struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata;
580 590
581 if (task->tk_status >= 0) 591 if (task->tk_status >= 0)
582 nfs_refresh_inode(data->inode, data->res.fattr); 592 nfs_post_op_update_inode(data->inode, data->res.fattr);
583 nfs_writeback_done(task); 593 nfs_writeback_done(task);
584} 594}
585 595