summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-10-20 08:28:54 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-20 19:26:41 +0200
commit63f103111fdfc3cba00e4c94921d32362f375d93 (patch)
treeb0c2e195d64ba2f70c982b069c46ba6eec2c4018
parent[PATCH] nfs_common endianness annotations (diff)
downloadlinux-63f103111fdfc3cba00e4c94921d32362f375d93.tar.xz
linux-63f103111fdfc3cba00e4c94921d32362f375d93.zip
[PATCH] nfsd: nfserrno() endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Acked-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/nfsd/nfsproc.c7
-rw-r--r--include/linux/nfsd/export.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index 09030afd7249..03ab6822291f 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -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 @@ nfserrno (int errno)
{ 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;
}
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 6e78ea969f49..27666f5b8b53 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -118,7 +118,7 @@ struct svc_export * exp_parent(struct auth_domain *clp,
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;