summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2024-09-05 15:09:35 -0400
committerAnna Schumaker <anna.schumaker@oracle.com>2024-09-23 15:03:29 -0400
commit4806ded4c14c5e8fdc6ce885d83221a78c06a428 (patch)
tree4b7c9f0f0621c4549942126eb99b49da4fb3cc51 /include
parentdfb07e990a0d019d7ae9b78dd4260620ce32e79a (diff)
downloadlwn-4806ded4c14c5e8fdc6ce885d83221a78c06a428.tar.gz
lwn-4806ded4c14c5e8fdc6ce885d83221a78c06a428.zip
nfs_common: factor out nfs_errtbl and nfs_stat_to_errno
Common nfs_stat_to_errno() is used by both fs/nfs/nfs2xdr.c and fs/nfs/nfs3xdr.c Will also be used by fs/nfsd/localio.c Signed-off-by: Mike Snitzer <snitzer@kernel.org> Reviewed-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nfs_common.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/nfs_common.h b/include/linux/nfs_common.h
new file mode 100644
index 000000000000..3395c4a4d372
--- /dev/null
+++ b/include/linux/nfs_common.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This file contains constants and methods used by both NFS client and server.
+ */
+#ifndef _LINUX_NFS_COMMON_H
+#define _LINUX_NFS_COMMON_H
+
+#include <linux/errno.h>
+#include <uapi/linux/nfs.h>
+
+/* Mapping from NFS error code to "errno" error code. */
+#define errno_NFSERR_IO EIO
+
+int nfs_stat_to_errno(enum nfs_stat status);
+
+#endif /* _LINUX_NFS_COMMON_H */