aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/internal.h2
-rw-r--r--fs/nfs/nfs2xdr.c18
2 files changed, 11 insertions, 9 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index e6356b750b77..8c2d9d83771e 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -185,7 +185,7 @@ extern int __init nfs_init_directcache(void);
185extern void nfs_destroy_directcache(void); 185extern void nfs_destroy_directcache(void);
186 186
187/* nfs2xdr.c */ 187/* nfs2xdr.c */
188extern int nfs_stat_to_errno(int); 188extern int nfs_stat_to_errno(enum nfs_stat);
189extern struct rpc_procinfo nfs_procedures[]; 189extern struct rpc_procinfo nfs_procedures[];
190extern __be32 *nfs_decode_dirent(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int); 190extern __be32 *nfs_decode_dirent(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int);
191 191
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index c79977304af8..2da9824d432a 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -804,7 +804,7 @@ nfs_xdr_statfsres(struct rpc_rqst *req, __be32 *p, struct nfs2_fsstat *res)
804 * We need to translate between nfs status return values and 804 * We need to translate between nfs status return values and
805 * the local errno values which may not be the same. 805 * the local errno values which may not be the same.
806 */ 806 */
807static struct { 807static const struct {
808 int stat; 808 int stat;
809 int errno; 809 int errno;
810} nfs_errtbl[] = { 810} nfs_errtbl[] = {
@@ -844,20 +844,22 @@ static struct {
844 { -1, -EIO } 844 { -1, -EIO }
845}; 845};
846 846
847/* 847/**
848 * Convert an NFS error code to a local one. 848 * nfs_stat_to_errno - convert an NFS status code to a local errno
849 * This one is used jointly by NFSv2 and NFSv3. 849 * @status: NFS status code to convert
850 *
851 * Returns a local errno value, or -EIO if the NFS status code is
852 * not recognized. This function is used jointly by NFSv2 and NFSv3.
850 */ 853 */
851int 854int nfs_stat_to_errno(enum nfs_stat status)
852nfs_stat_to_errno(int stat)
853{ 855{
854 int i; 856 int i;
855 857
856 for (i = 0; nfs_errtbl[i].stat != -1; i++) { 858 for (i = 0; nfs_errtbl[i].stat != -1; i++) {
857 if (nfs_errtbl[i].stat == stat) 859 if (nfs_errtbl[i].stat == (int)status)
858 return nfs_errtbl[i].errno; 860 return nfs_errtbl[i].errno;
859 } 861 }
860 dprintk("nfs_stat_to_errno: bad nfs status return value: %d\n", stat); 862 dprintk("NFS: Unrecognized nfs status value: %u\n", status);
861 return nfs_errtbl[i].errno; 863 return nfs_errtbl[i].errno;
862} 864}
863 865