aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs3proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-27 22:12:38 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-27 22:12:38 -0400
commit0e574af1be5f569a5d7f2800333b0bfb358a5e34 (patch)
treebb5b62dece21b8906222dfee022020ed6f81e34c /fs/nfs/nfs3proc.c
parent4c2cb58c552a34744979a99ccf01762d5eb7e288 (diff)
NFS: Cleanup initialisation of struct nfs_fattr
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs3proc.c')
-rw-r--r--fs/nfs/nfs3proc.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index e4a1cd48195..4b1b48b139f 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -78,7 +78,7 @@ nfs3_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
78 int status; 78 int status;
79 79
80 dprintk("%s: call fsinfo\n", __FUNCTION__); 80 dprintk("%s: call fsinfo\n", __FUNCTION__);
81 info->fattr->valid = 0; 81 nfs_fattr_init(info->fattr);
82 status = rpc_call(server->client_sys, NFS3PROC_FSINFO, fhandle, info, 0); 82 status = rpc_call(server->client_sys, NFS3PROC_FSINFO, fhandle, info, 0);
83 dprintk("%s: reply fsinfo: %d\n", __FUNCTION__, status); 83 dprintk("%s: reply fsinfo: %d\n", __FUNCTION__, status);
84 if (!(info->fattr->valid & NFS_ATTR_FATTR)) { 84 if (!(info->fattr->valid & NFS_ATTR_FATTR)) {
@@ -98,7 +98,7 @@ nfs3_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
98 int status; 98 int status;
99 99
100 dprintk("NFS call getattr\n"); 100 dprintk("NFS call getattr\n");
101 fattr->valid = 0; 101 nfs_fattr_init(fattr);
102 status = rpc_call(server->client, NFS3PROC_GETATTR, 102 status = rpc_call(server->client, NFS3PROC_GETATTR,
103 fhandle, fattr, 0); 103 fhandle, fattr, 0);
104 dprintk("NFS reply getattr: %d\n", status); 104 dprintk("NFS reply getattr: %d\n", status);
@@ -117,7 +117,7 @@ nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
117 int status; 117 int status;
118 118
119 dprintk("NFS call setattr\n"); 119 dprintk("NFS call setattr\n");
120 fattr->valid = 0; 120 nfs_fattr_init(fattr);
121 status = rpc_call(NFS_CLIENT(inode), NFS3PROC_SETATTR, &arg, fattr, 0); 121 status = rpc_call(NFS_CLIENT(inode), NFS3PROC_SETATTR, &arg, fattr, 0);
122 if (status == 0) 122 if (status == 0)
123 nfs_setattr_update_inode(inode, sattr); 123 nfs_setattr_update_inode(inode, sattr);
@@ -143,8 +143,8 @@ nfs3_proc_lookup(struct inode *dir, struct qstr *name,
143 int status; 143 int status;
144 144
145 dprintk("NFS call lookup %s\n", name->name); 145 dprintk("NFS call lookup %s\n", name->name);
146 dir_attr.valid = 0; 146 nfs_fattr_init(&dir_attr);
147 fattr->valid = 0; 147 nfs_fattr_init(fattr);
148 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_LOOKUP, &arg, &res, 0); 148 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_LOOKUP, &arg, &res, 0);
149 if (status >= 0 && !(fattr->valid & NFS_ATTR_FATTR)) 149 if (status >= 0 && !(fattr->valid & NFS_ATTR_FATTR))
150 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_GETATTR, 150 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_GETATTR,
@@ -174,7 +174,6 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry)
174 int status; 174 int status;
175 175
176 dprintk("NFS call access\n"); 176 dprintk("NFS call access\n");
177 fattr.valid = 0;
178 177
179 if (mode & MAY_READ) 178 if (mode & MAY_READ)
180 arg.access |= NFS3_ACCESS_READ; 179 arg.access |= NFS3_ACCESS_READ;
@@ -189,6 +188,7 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry)
189 if (mode & MAY_EXEC) 188 if (mode & MAY_EXEC)
190 arg.access |= NFS3_ACCESS_EXECUTE; 189 arg.access |= NFS3_ACCESS_EXECUTE;
191 } 190 }
191 nfs_fattr_init(&fattr);
192 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); 192 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
193 nfs_refresh_inode(inode, &fattr); 193 nfs_refresh_inode(inode, &fattr);
194 if (status == 0) { 194 if (status == 0) {
@@ -217,7 +217,7 @@ static int nfs3_proc_readlink(struct inode *inode, struct page *page,
217 int status; 217 int status;
218 218
219 dprintk("NFS call readlink\n"); 219 dprintk("NFS call readlink\n");
220 fattr.valid = 0; 220 nfs_fattr_init(&fattr);
221 status = rpc_call(NFS_CLIENT(inode), NFS3PROC_READLINK, 221 status = rpc_call(NFS_CLIENT(inode), NFS3PROC_READLINK,
222 &args, &fattr, 0); 222 &args, &fattr, 0);
223 nfs_refresh_inode(inode, &fattr); 223 nfs_refresh_inode(inode, &fattr);
@@ -240,7 +240,7 @@ static int nfs3_proc_read(struct nfs_read_data *rdata)
240 240
241 dprintk("NFS call read %d @ %Ld\n", rdata->args.count, 241 dprintk("NFS call read %d @ %Ld\n", rdata->args.count,
242 (long long) rdata->args.offset); 242 (long long) rdata->args.offset);
243 fattr->valid = 0; 243 nfs_fattr_init(fattr);
244 status = rpc_call_sync(NFS_CLIENT(inode), &msg, flags); 244 status = rpc_call_sync(NFS_CLIENT(inode), &msg, flags);
245 if (status >= 0) 245 if (status >= 0)
246 nfs_refresh_inode(inode, fattr); 246 nfs_refresh_inode(inode, fattr);
@@ -263,7 +263,7 @@ static int nfs3_proc_write(struct nfs_write_data *wdata)
263 263
264 dprintk("NFS call write %d @ %Ld\n", wdata->args.count, 264 dprintk("NFS call write %d @ %Ld\n", wdata->args.count,
265 (long long) wdata->args.offset); 265 (long long) wdata->args.offset);
266 fattr->valid = 0; 266 nfs_fattr_init(fattr);
267 status = rpc_call_sync(NFS_CLIENT(inode), &msg, rpcflags); 267 status = rpc_call_sync(NFS_CLIENT(inode), &msg, rpcflags);
268 if (status >= 0) 268 if (status >= 0)
269 nfs_refresh_inode(inode, fattr); 269 nfs_refresh_inode(inode, fattr);
@@ -285,7 +285,7 @@ static int nfs3_proc_commit(struct nfs_write_data *cdata)
285 285
286 dprintk("NFS call commit %d @ %Ld\n", cdata->args.count, 286 dprintk("NFS call commit %d @ %Ld\n", cdata->args.count,
287 (long long) cdata->args.offset); 287 (long long) cdata->args.offset);
288 fattr->valid = 0; 288 nfs_fattr_init(fattr);
289 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); 289 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
290 if (status >= 0) 290 if (status >= 0)
291 nfs_refresh_inode(inode, fattr); 291 nfs_refresh_inode(inode, fattr);
@@ -329,8 +329,8 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
329 sattr->ia_mode &= ~current->fs->umask; 329 sattr->ia_mode &= ~current->fs->umask;
330 330
331again: 331again:
332 dir_attr.valid = 0; 332 nfs_fattr_init(&dir_attr);
333 fattr.valid = 0; 333 nfs_fattr_init(&fattr);
334 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_CREATE, &arg, &res, 0); 334 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_CREATE, &arg, &res, 0);
335 nfs_refresh_inode(dir, &dir_attr); 335 nfs_refresh_inode(dir, &dir_attr);
336 336
@@ -401,7 +401,7 @@ nfs3_proc_remove(struct inode *dir, struct qstr *name)
401 int status; 401 int status;
402 402
403 dprintk("NFS call remove %s\n", name->name); 403 dprintk("NFS call remove %s\n", name->name);
404 dir_attr.valid = 0; 404 nfs_fattr_init(&dir_attr);
405 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 405 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
406 nfs_refresh_inode(dir, &dir_attr); 406 nfs_refresh_inode(dir, &dir_attr);
407 dprintk("NFS reply remove: %d\n", status); 407 dprintk("NFS reply remove: %d\n", status);
@@ -422,7 +422,7 @@ nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr
422 ptr->arg.fh = NFS_FH(dir->d_inode); 422 ptr->arg.fh = NFS_FH(dir->d_inode);
423 ptr->arg.name = name->name; 423 ptr->arg.name = name->name;
424 ptr->arg.len = name->len; 424 ptr->arg.len = name->len;
425 ptr->res.valid = 0; 425 nfs_fattr_init(&ptr->res);
426 msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE]; 426 msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE];
427 msg->rpc_argp = &ptr->arg; 427 msg->rpc_argp = &ptr->arg;
428 msg->rpc_resp = &ptr->res; 428 msg->rpc_resp = &ptr->res;
@@ -465,8 +465,8 @@ nfs3_proc_rename(struct inode *old_dir, struct qstr *old_name,
465 int status; 465 int status;
466 466
467 dprintk("NFS call rename %s -> %s\n", old_name->name, new_name->name); 467 dprintk("NFS call rename %s -> %s\n", old_name->name, new_name->name);
468 old_dir_attr.valid = 0; 468 nfs_fattr_init(&old_dir_attr);
469 new_dir_attr.valid = 0; 469 nfs_fattr_init(&new_dir_attr);
470 status = rpc_call(NFS_CLIENT(old_dir), NFS3PROC_RENAME, &arg, &res, 0); 470 status = rpc_call(NFS_CLIENT(old_dir), NFS3PROC_RENAME, &arg, &res, 0);
471 nfs_refresh_inode(old_dir, &old_dir_attr); 471 nfs_refresh_inode(old_dir, &old_dir_attr);
472 nfs_refresh_inode(new_dir, &new_dir_attr); 472 nfs_refresh_inode(new_dir, &new_dir_attr);
@@ -491,8 +491,8 @@ nfs3_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
491 int status; 491 int status;
492 492
493 dprintk("NFS call link %s\n", name->name); 493 dprintk("NFS call link %s\n", name->name);
494 dir_attr.valid = 0; 494 nfs_fattr_init(&dir_attr);
495 fattr.valid = 0; 495 nfs_fattr_init(&fattr);
496 status = rpc_call(NFS_CLIENT(inode), NFS3PROC_LINK, &arg, &res, 0); 496 status = rpc_call(NFS_CLIENT(inode), NFS3PROC_LINK, &arg, &res, 0);
497 nfs_refresh_inode(dir, &dir_attr); 497 nfs_refresh_inode(dir, &dir_attr);
498 nfs_refresh_inode(inode, &fattr); 498 nfs_refresh_inode(inode, &fattr);
@@ -524,8 +524,8 @@ nfs3_proc_symlink(struct inode *dir, struct qstr *name, struct qstr *path,
524 if (path->len > NFS3_MAXPATHLEN) 524 if (path->len > NFS3_MAXPATHLEN)
525 return -ENAMETOOLONG; 525 return -ENAMETOOLONG;
526 dprintk("NFS call symlink %s -> %s\n", name->name, path->name); 526 dprintk("NFS call symlink %s -> %s\n", name->name, path->name);
527 dir_attr.valid = 0; 527 nfs_fattr_init(&dir_attr);
528 fattr->valid = 0; 528 nfs_fattr_init(fattr);
529 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_SYMLINK, &arg, &res, 0); 529 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_SYMLINK, &arg, &res, 0);
530 nfs_refresh_inode(dir, &dir_attr); 530 nfs_refresh_inode(dir, &dir_attr);
531 dprintk("NFS reply symlink: %d\n", status); 531 dprintk("NFS reply symlink: %d\n", status);
@@ -552,11 +552,11 @@ nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr)
552 int status; 552 int status;
553 553
554 dprintk("NFS call mkdir %s\n", dentry->d_name.name); 554 dprintk("NFS call mkdir %s\n", dentry->d_name.name);
555 dir_attr.valid = 0;
556 fattr.valid = 0;
557 555
558 sattr->ia_mode &= ~current->fs->umask; 556 sattr->ia_mode &= ~current->fs->umask;
559 557
558 nfs_fattr_init(&dir_attr);
559 nfs_fattr_init(&fattr);
560 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_MKDIR, &arg, &res, 0); 560 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_MKDIR, &arg, &res, 0);
561 nfs_refresh_inode(dir, &dir_attr); 561 nfs_refresh_inode(dir, &dir_attr);
562 if (status != 0) 562 if (status != 0)
@@ -582,7 +582,7 @@ nfs3_proc_rmdir(struct inode *dir, struct qstr *name)
582 int status; 582 int status;
583 583
584 dprintk("NFS call rmdir %s\n", name->name); 584 dprintk("NFS call rmdir %s\n", name->name);
585 dir_attr.valid = 0; 585 nfs_fattr_init(&dir_attr);
586 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_RMDIR, &arg, &dir_attr, 0); 586 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_RMDIR, &arg, &dir_attr, 0);
587 nfs_refresh_inode(dir, &dir_attr); 587 nfs_refresh_inode(dir, &dir_attr);
588 dprintk("NFS reply rmdir: %d\n", status); 588 dprintk("NFS reply rmdir: %d\n", status);
@@ -634,7 +634,7 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
634 dprintk("NFS call readdir%s %d\n", 634 dprintk("NFS call readdir%s %d\n",
635 plus? "plus" : "", (unsigned int) cookie); 635 plus? "plus" : "", (unsigned int) cookie);
636 636
637 dir_attr.valid = 0; 637 nfs_fattr_init(&dir_attr);
638 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 638 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
639 nfs_refresh_inode(dir, &dir_attr); 639 nfs_refresh_inode(dir, &dir_attr);
640 dprintk("NFS reply readdir: %d\n", status); 640 dprintk("NFS reply readdir: %d\n", status);
@@ -676,8 +676,8 @@ nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
676 676
677 sattr->ia_mode &= ~current->fs->umask; 677 sattr->ia_mode &= ~current->fs->umask;
678 678
679 dir_attr.valid = 0; 679 nfs_fattr_init(&dir_attr);
680 fattr.valid = 0; 680 nfs_fattr_init(&fattr);
681 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_MKNOD, &arg, &res, 0); 681 status = rpc_call(NFS_CLIENT(dir), NFS3PROC_MKNOD, &arg, &res, 0);
682 nfs_refresh_inode(dir, &dir_attr); 682 nfs_refresh_inode(dir, &dir_attr);
683 if (status != 0) 683 if (status != 0)
@@ -698,7 +698,7 @@ nfs3_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
698 int status; 698 int status;
699 699
700 dprintk("NFS call fsstat\n"); 700 dprintk("NFS call fsstat\n");
701 stat->fattr->valid = 0; 701 nfs_fattr_init(stat->fattr);
702 status = rpc_call(server->client, NFS3PROC_FSSTAT, fhandle, stat, 0); 702 status = rpc_call(server->client, NFS3PROC_FSSTAT, fhandle, stat, 0);
703 dprintk("NFS reply statfs: %d\n", status); 703 dprintk("NFS reply statfs: %d\n", status);
704 return status; 704 return status;
@@ -711,7 +711,7 @@ nfs3_proc_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle,
711 int status; 711 int status;
712 712
713 dprintk("NFS call fsinfo\n"); 713 dprintk("NFS call fsinfo\n");
714 info->fattr->valid = 0; 714 nfs_fattr_init(info->fattr);
715 status = rpc_call(server->client_sys, NFS3PROC_FSINFO, fhandle, info, 0); 715 status = rpc_call(server->client_sys, NFS3PROC_FSINFO, fhandle, info, 0);
716 dprintk("NFS reply fsinfo: %d\n", status); 716 dprintk("NFS reply fsinfo: %d\n", status);
717 return status; 717 return status;
@@ -724,7 +724,7 @@ nfs3_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
724 int status; 724 int status;
725 725
726 dprintk("NFS call pathconf\n"); 726 dprintk("NFS call pathconf\n");
727 info->fattr->valid = 0; 727 nfs_fattr_init(info->fattr);
728 status = rpc_call(server->client, NFS3PROC_PATHCONF, fhandle, info, 0); 728 status = rpc_call(server->client, NFS3PROC_PATHCONF, fhandle, info, 0);
729 dprintk("NFS reply pathconf: %d\n", status); 729 dprintk("NFS reply pathconf: %d\n", status);
730 return status; 730 return status;