Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153634
b: refs/heads/master
c: 4fdcd99
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jun 18, 2009
1 parent 6101e63 commit 56e8ebf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fb12529577541aa02f9c3d9e325329f9568dfb58
refs/heads/master: 4fdcd9966d8469be26a6f12122ac21ffce19fc20
39 changes: 39 additions & 0 deletions trunk/fs/nfs/mount_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#define encode_dirpath_sz (1 + XDR_QUADLEN(MNTPATHLEN))
#define MNT_status_sz (1)
#define MNT_fhs_status_sz (1)
#define MNT_fhandle_sz XDR_QUADLEN(NFS2_FHSIZE)
#define MNT_fhandle3_sz (1 + XDR_QUADLEN(NFS3_FHSIZE))

/*
* XDR argument and result sizes
Expand Down Expand Up @@ -272,6 +274,20 @@ static int decode_status(struct xdr_stream *xdr, struct mountres *res)
return 0;
}

static int decode_fhandle(struct xdr_stream *xdr, struct mountres *res)
{
struct nfs_fh *fh = res->fh;
__be32 *p;

p = xdr_inline_decode(xdr, NFS2_FHSIZE);
if (unlikely(p == NULL))
return -EIO;

fh->size = NFS2_FHSIZE;
memcpy(fh->data, p, NFS2_FHSIZE);
return 0;
}

static int decode_fhs_status(struct xdr_stream *xdr, struct mountres *res)
{
unsigned int i;
Expand All @@ -295,6 +311,29 @@ static int decode_fhs_status(struct xdr_stream *xdr, struct mountres *res)
return 0;
}

static int decode_fhandle3(struct xdr_stream *xdr, struct mountres *res)
{
struct nfs_fh *fh = res->fh;
u32 size;
__be32 *p;

p = xdr_inline_decode(xdr, sizeof(size));
if (unlikely(p == NULL))
return -EIO;

size = ntohl(*p++);
if (size > NFS3_FHSIZE || size == 0)
return -EIO;

p = xdr_inline_decode(xdr, size);
if (unlikely(p == NULL))
return -EIO;

fh->size = size;
memcpy(fh->data, p, size);
return 0;
}

static int xdr_decode_fhstatus3(struct rpc_rqst *req, __be32 *p,
struct mnt_fhstatus *res)
{
Expand Down

0 comments on commit 56e8ebf

Please sign in to comment.