Skip to contentSkip to conversation

nfsd: nfserrno() endianness annotations

PATCH New Al Viro 1 participant 1 message Oct 10, 2006 NFS server

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 13/25 nfsd: nfserrno() endianness annotations

---
 fs/nfsd/nfsproc.c           |    7 +++----
 include/linux/nfsd/export.h |    2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)
fs/nfsd/nfsproc.c +3 -4
index 09030af..03ab682 100644
@@ -579,11 +579,11 @@ struct svc_version	nfsd_version2 = {
 /*
  * Map errnos to NFS errnos.
  */
-int
+__be32
 nfserrno (int errno)
 {
 	static struct {
-		int	nfserr;
+		__be32	nfserr;
 		int	syserr;
 	} nfs_errtbl[] = {
 		{ nfs_ok, 0 },
@@ -615,11 +615,10 @@ #endif
 		{ nfserr_badname, -ESRCH },
 		{ nfserr_io, -ETXTBSY },
 		{ nfserr_notsupp, -EOPNOTSUPP },
-		{ -1, -EIO }
 	};
 	int	i;
 
-	for (i = 0; nfs_errtbl[i].nfserr != -1; i++) {
+	for (i = 0; i < ARRAY_SIZE(nfs_errtbl); i++) {
 		if (nfs_errtbl[i].syserr == errno)
 			return nfs_errtbl[i].nfserr;
 	}
include/linux/nfsd/export.h +1 -1
index 6e78ea9..27666f5 100644
@@ -118,7 +118,7 @@ struct svc_export *	exp_parent(struct au
 int			exp_rootfh(struct auth_domain *, 
 					char *path, struct knfsd_fh *, int maxsize);
 int			exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq);
-int			nfserrno(int errno);
+__be32			nfserrno(int errno);
 
 extern struct cache_detail svc_export_cache;
 
Signature · 1 line
1.4.2.GIT