Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 229160
b: refs/heads/master
c: 8582849
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Dec 16, 2010
1 parent 8ad8f90 commit 4e71558
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 282ac2a573dd1be4230710932cd471ed5a3a94b8
refs/heads/master: 858284932462cec260f3d1d7426aeb03f5dbc2ad
2 changes: 1 addition & 1 deletion trunk/fs/nfs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ extern int __init nfs_init_directcache(void);
extern void nfs_destroy_directcache(void);

/* nfs2xdr.c */
extern int nfs_stat_to_errno(int);
extern int nfs_stat_to_errno(enum nfs_stat);
extern struct rpc_procinfo nfs_procedures[];
extern __be32 *nfs_decode_dirent(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int);

Expand Down
18 changes: 10 additions & 8 deletions trunk/fs/nfs/nfs2xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ nfs_xdr_statfsres(struct rpc_rqst *req, __be32 *p, struct nfs2_fsstat *res)
* We need to translate between nfs status return values and
* the local errno values which may not be the same.
*/
static struct {
static const struct {
int stat;
int errno;
} nfs_errtbl[] = {
Expand Down Expand Up @@ -844,20 +844,22 @@ static struct {
{ -1, -EIO }
};

/*
* Convert an NFS error code to a local one.
* This one is used jointly by NFSv2 and NFSv3.
/**
* nfs_stat_to_errno - convert an NFS status code to a local errno
* @status: NFS status code to convert
*
* Returns a local errno value, or -EIO if the NFS status code is
* not recognized. This function is used jointly by NFSv2 and NFSv3.
*/
int
nfs_stat_to_errno(int stat)
int nfs_stat_to_errno(enum nfs_stat status)
{
int i;

for (i = 0; nfs_errtbl[i].stat != -1; i++) {
if (nfs_errtbl[i].stat == stat)
if (nfs_errtbl[i].stat == (int)status)
return nfs_errtbl[i].errno;
}
dprintk("nfs_stat_to_errno: bad nfs status return value: %d\n", stat);
dprintk("NFS: Unrecognized nfs status value: %u\n", status);
return nfs_errtbl[i].errno;
}

Expand Down

0 comments on commit 4e71558

Please sign in to comment.