Commit 62d86355 authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

[PATCH] A basic NFSv4 client for 2.5.x

This patch changes the interface of the ->setattr() nfs_rpc_op
so that its first argument is a dentry instead of an inode.

[Explanation: The dentry is required because in NFSv4, we may
 need to OPEN the file before doing the SETATTR.  (This is
 required if the file size is changed as part of the setattr.)
 Opening the file requires making use of the containing
 directory's inode.]
parent 40a4b2a4
...@@ -781,7 +781,7 @@ printk("nfs_setattr: revalidate failed, error=%d\n", error); ...@@ -781,7 +781,7 @@ printk("nfs_setattr: revalidate failed, error=%d\n", error);
if (error) if (error)
goto out; goto out;
error = NFS_PROTO(inode)->setattr(inode, &fattr, attr); error = NFS_PROTO(inode)->setattr(dentry, &fattr, attr);
if (error) if (error)
goto out; goto out;
/* /*
......
...@@ -86,9 +86,10 @@ nfs3_proc_getattr(struct inode *inode, struct nfs_fattr *fattr) ...@@ -86,9 +86,10 @@ nfs3_proc_getattr(struct inode *inode, struct nfs_fattr *fattr)
} }
static int static int
nfs3_proc_setattr(struct inode *inode, struct nfs_fattr *fattr, nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
struct iattr *sattr) struct iattr *sattr)
{ {
struct inode *inode = dentry->d_inode;
struct nfs3_sattrargs arg = { struct nfs3_sattrargs arg = {
.fh = NFS_FH(inode), .fh = NFS_FH(inode),
.sattr = sattr, .sattr = sattr,
......
...@@ -78,9 +78,10 @@ nfs_proc_getattr(struct inode *inode, struct nfs_fattr *fattr) ...@@ -78,9 +78,10 @@ nfs_proc_getattr(struct inode *inode, struct nfs_fattr *fattr)
} }
static int static int
nfs_proc_setattr(struct inode *inode, struct nfs_fattr *fattr, nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
struct iattr *sattr) struct iattr *sattr)
{ {
struct inode *inode = dentry->d_inode;
struct nfs_sattrargs arg = { struct nfs_sattrargs arg = {
.fh = NFS_FH(inode), .fh = NFS_FH(inode),
.sattr = sattr .sattr = sattr
......
...@@ -307,7 +307,7 @@ struct nfs_rpc_ops { ...@@ -307,7 +307,7 @@ struct nfs_rpc_ops {
int (*getroot) (struct nfs_server *, struct nfs_fh *, int (*getroot) (struct nfs_server *, struct nfs_fh *,
struct nfs_fattr *); struct nfs_fattr *);
int (*getattr) (struct inode *, struct nfs_fattr *); int (*getattr) (struct inode *, struct nfs_fattr *);
int (*setattr) (struct inode *, struct nfs_fattr *, int (*setattr) (struct dentry *, struct nfs_fattr *,
struct iattr *); struct iattr *);
int (*lookup) (struct inode *, struct qstr *, int (*lookup) (struct inode *, struct qstr *,
struct nfs_fh *, struct nfs_fattr *); struct nfs_fh *, struct nfs_fattr *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment