aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/proc.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /fs/nfs/proc.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'fs/nfs/proc.c')
-rw-r--r--fs/nfs/proc.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 611bec22f552..ac40b8535d7e 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -177,7 +177,7 @@ nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
177} 177}
178 178
179static int 179static int
180nfs_proc_lookup(struct inode *dir, struct qstr *name, 180nfs_proc_lookup(struct rpc_clnt *clnt, struct inode *dir, struct qstr *name,
181 struct nfs_fh *fhandle, struct nfs_fattr *fattr) 181 struct nfs_fh *fhandle, struct nfs_fattr *fattr)
182{ 182{
183 struct nfs_diropargs arg = { 183 struct nfs_diropargs arg = {
@@ -258,7 +258,7 @@ static void nfs_free_createdata(const struct nfs_createdata *data)
258 258
259static int 259static int
260nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, 260nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
261 int flags, struct nameidata *nd) 261 int flags, struct nfs_open_context *ctx)
262{ 262{
263 struct nfs_createdata *data; 263 struct nfs_createdata *data;
264 struct rpc_message msg = { 264 struct rpc_message msg = {
@@ -365,17 +365,32 @@ static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir)
365 return 1; 365 return 1;
366} 366}
367 367
368static void
369nfs_proc_rename_setup(struct rpc_message *msg, struct inode *dir)
370{
371 msg->rpc_proc = &nfs_procedures[NFSPROC_RENAME];
372}
373
374static int
375nfs_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
376 struct inode *new_dir)
377{
378 if (nfs_async_handle_expired_key(task))
379 return 0;
380 nfs_mark_for_revalidate(old_dir);
381 nfs_mark_for_revalidate(new_dir);
382 return 1;
383}
384
368static int 385static int
369nfs_proc_rename(struct inode *old_dir, struct qstr *old_name, 386nfs_proc_rename(struct inode *old_dir, struct qstr *old_name,
370 struct inode *new_dir, struct qstr *new_name) 387 struct inode *new_dir, struct qstr *new_name)
371{ 388{
372 struct nfs_renameargs arg = { 389 struct nfs_renameargs arg = {
373 .fromfh = NFS_FH(old_dir), 390 .old_dir = NFS_FH(old_dir),
374 .fromname = old_name->name, 391 .old_name = old_name,
375 .fromlen = old_name->len, 392 .new_dir = NFS_FH(new_dir),
376 .tofh = NFS_FH(new_dir), 393 .new_name = new_name,
377 .toname = new_name->name,
378 .tolen = new_name->len
379 }; 394 };
380 struct rpc_message msg = { 395 struct rpc_message msg = {
381 .rpc_proc = &nfs_procedures[NFSPROC_RENAME], 396 .rpc_proc = &nfs_procedures[NFSPROC_RENAME],
@@ -443,7 +458,7 @@ nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page,
443 fattr = nfs_alloc_fattr(); 458 fattr = nfs_alloc_fattr();
444 status = -ENOMEM; 459 status = -ENOMEM;
445 if (fh == NULL || fattr == NULL) 460 if (fh == NULL || fattr == NULL)
446 goto out; 461 goto out_free;
447 462
448 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 463 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
449 nfs_mark_for_revalidate(dir); 464 nfs_mark_for_revalidate(dir);
@@ -456,6 +471,7 @@ nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page,
456 if (status == 0) 471 if (status == 0)
457 status = nfs_instantiate(dentry, fh, fattr); 472 status = nfs_instantiate(dentry, fh, fattr);
458 473
474out_free:
459 nfs_free_fattr(fattr); 475 nfs_free_fattr(fattr);
460 nfs_free_fhandle(fh); 476 nfs_free_fhandle(fh);
461out: 477out:
@@ -519,14 +535,14 @@ nfs_proc_rmdir(struct inode *dir, struct qstr *name)
519 */ 535 */
520static int 536static int
521nfs_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 537nfs_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
522 u64 cookie, struct page *page, unsigned int count, int plus) 538 u64 cookie, struct page **pages, unsigned int count, int plus)
523{ 539{
524 struct inode *dir = dentry->d_inode; 540 struct inode *dir = dentry->d_inode;
525 struct nfs_readdirargs arg = { 541 struct nfs_readdirargs arg = {
526 .fh = NFS_FH(dir), 542 .fh = NFS_FH(dir),
527 .cookie = cookie, 543 .cookie = cookie,
528 .count = count, 544 .count = count,
529 .pages = &page, 545 .pages = pages,
530 }; 546 };
531 struct rpc_message msg = { 547 struct rpc_message msg = {
532 .rpc_proc = &nfs_procedures[NFSPROC_READDIR], 548 .rpc_proc = &nfs_procedures[NFSPROC_READDIR],
@@ -705,6 +721,8 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
705 .unlink_setup = nfs_proc_unlink_setup, 721 .unlink_setup = nfs_proc_unlink_setup,
706 .unlink_done = nfs_proc_unlink_done, 722 .unlink_done = nfs_proc_unlink_done,
707 .rename = nfs_proc_rename, 723 .rename = nfs_proc_rename,
724 .rename_setup = nfs_proc_rename_setup,
725 .rename_done = nfs_proc_rename_done,
708 .link = nfs_proc_link, 726 .link = nfs_proc_link,
709 .symlink = nfs_proc_symlink, 727 .symlink = nfs_proc_symlink,
710 .mkdir = nfs_proc_mkdir, 728 .mkdir = nfs_proc_mkdir,
@@ -714,7 +732,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
714 .statfs = nfs_proc_statfs, 732 .statfs = nfs_proc_statfs,
715 .fsinfo = nfs_proc_fsinfo, 733 .fsinfo = nfs_proc_fsinfo,
716 .pathconf = nfs_proc_pathconf, 734 .pathconf = nfs_proc_pathconf,
717 .decode_dirent = nfs_decode_dirent, 735 .decode_dirent = nfs2_decode_dirent,
718 .read_setup = nfs_proc_read_setup, 736 .read_setup = nfs_proc_read_setup,
719 .read_done = nfs_read_done, 737 .read_done = nfs_read_done,
720 .write_setup = nfs_proc_write_setup, 738 .write_setup = nfs_proc_write_setup,
@@ -723,4 +741,5 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
723 .lock = nfs_proc_lock, 741 .lock = nfs_proc_lock,
724 .lock_check_bounds = nfs_lock_check_bounds, 742 .lock_check_bounds = nfs_lock_check_bounds,
725 .close_context = nfs_close_context, 743 .close_context = nfs_close_context,
744 .init_client = nfs_init_client,
726}; 745};