Commit 85ac427f authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: use the (more efficient) NFSv2/v3-like XDR scheme for generating

GETATTR RPC calls.
parent 9c0c8d90
......@@ -876,18 +876,25 @@ nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
return nfs4_proc_fsinfo(server, fhandle, info);
}
static int
nfs4_proc_getattr(struct inode *inode, struct nfs_fattr *fattr)
static int nfs4_proc_getattr(struct inode *inode, struct nfs_fattr *fattr)
{
struct nfs4_compound compound;
struct nfs4_op ops[2];
struct nfs4_getattr_arg args = {
.fh = NFS_FH(inode),
.bitmask = nfs4_fattr_bitmap,
};
struct nfs4_getattr_res res = {
.fattr = fattr,
.server = NFS_SERVER(inode),
};
struct rpc_message msg = {
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_GETATTR],
.rpc_argp = &args,
.rpc_resp = &res,
};
fattr->valid = 0;
nfs4_setup_compound(&compound, ops, NFS_SERVER(inode), "getattr");
nfs4_setup_putfh(&compound, NFS_FH(inode));
nfs4_setup_getattr(&compound, fattr);
return nfs4_map_errors(nfs4_call_compound(&compound, NULL, 0));
return nfs4_map_errors(rpc_call_sync(NFS_CLIENT(inode), &msg, 0));
}
/*
......
This diff is collapsed.
......@@ -304,6 +304,7 @@ enum {
NFSPROC4_CLNT_LOCKT,
NFSPROC4_CLNT_LOCKU,
NFSPROC4_CLNT_ACCESS,
NFSPROC4_CLNT_GETATTR,
};
#endif
......
......@@ -3,6 +3,11 @@
#include <linux/sunrpc/xprt.h>
struct nfs4_fsid {
__u64 major;
__u64 minor;
};
struct nfs_fattr {
unsigned short valid; /* which fields are valid */
__u64 pre_size; /* pre_op_attr.size */
......@@ -26,10 +31,7 @@ struct nfs_fattr {
dev_t rdev;
union {
__u64 nfs3; /* also nfs2 */
struct {
__u64 major;
__u64 minor;
} nfs4;
struct nfs4_fsid nfs4;
} fsid_u;
__u64 fileid;
struct timespec atime;
......@@ -528,6 +530,16 @@ struct nfs4_getattr {
struct nfs_pathconf * gt_pathconf; /* response */
};
struct nfs4_getattr_arg {
const struct nfs_fh * fh;
const u32 * bitmask;
};
struct nfs4_getattr_res {
const struct nfs_server * server;
struct nfs_fattr * fattr;
};
struct nfs4_getfh {
struct nfs_fh * gf_fhandle; /* response */
};
......
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