mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
NFSD: Rework be32 nfserr definitions
fs/nfsd/nfserr.h builds NFSD's internal __be32 nfserr_* values by wrapping the version-agnostic NFSERR_* status codes from uapi/linux/nfs.h in cpu_to_be32(), which it reaches through its include of linux/nfs.h. A subsequent patch replaces that include with the xdrgen-generated linux/sunrpc/xdrgen/nfs2.h. The generated header re-supplies only the eighteen NFSv2 status codes; the NFSv3 and NFSv4 codes that nfserr.h also uses (NFSERR_INVAL, NFSERR_JUKEBOX, NFSERR_RESOURCE, and the rest) would be left undeclared. Respell those definitions in terms of the version-specific NFS3ERR_* and NFS4ERR_* codes from linux/nfs3.h and linux/nfs4.h, and switch the one bare NFSERR_MOVED in nfs4xdr.c to NFS4ERR_MOVED. The wire values are unchanged; NFSD no longer depends on the version-agnostic NFSv3 and NFSv4 names. Reviewed-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260826194444.148243-2-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
This commit is contained in:
parent
6c1ea6dbf2
commit
75a69e5085
|
|
@ -3213,7 +3213,7 @@ static __be32 fattr_handle_absent_fs(u32 *bmval0, u32 *bmval1, u32 *bmval2, u32
|
|||
*bmval1 & ~WORD1_ABSENT_FS_ATTRS) {
|
||||
if (*bmval0 & FATTR4_WORD0_RDATTR_ERROR ||
|
||||
*bmval0 & FATTR4_WORD0_FS_LOCATIONS)
|
||||
*rdattr_err = NFSERR_MOVED;
|
||||
*rdattr_err = NFS4ERR_MOVED;
|
||||
else
|
||||
return nfserr_moved;
|
||||
}
|
||||
|
|
|
|||
129
fs/nfsd/nfserr.h
129
fs/nfsd/nfserr.h
|
|
@ -11,76 +11,77 @@
|
|||
#define LINUX_NFSD_NFSERR_H
|
||||
|
||||
#include <linux/nfs.h>
|
||||
#include <linux/nfs3.h>
|
||||
#include <linux/nfs4.h>
|
||||
|
||||
/*
|
||||
* These macros provide pre-xdr'ed values for faster operation.
|
||||
*/
|
||||
#define nfs_ok cpu_to_be32(NFS_OK)
|
||||
#define nfserr_perm cpu_to_be32(NFSERR_PERM)
|
||||
#define nfserr_noent cpu_to_be32(NFSERR_NOENT)
|
||||
#define nfserr_io cpu_to_be32(NFSERR_IO)
|
||||
#define nfserr_nxio cpu_to_be32(NFSERR_NXIO)
|
||||
#define nfserr_acces cpu_to_be32(NFSERR_ACCES)
|
||||
#define nfserr_exist cpu_to_be32(NFSERR_EXIST)
|
||||
#define nfserr_xdev cpu_to_be32(NFSERR_XDEV)
|
||||
#define nfserr_nodev cpu_to_be32(NFSERR_NODEV)
|
||||
#define nfserr_notdir cpu_to_be32(NFSERR_NOTDIR)
|
||||
#define nfserr_isdir cpu_to_be32(NFSERR_ISDIR)
|
||||
#define nfserr_inval cpu_to_be32(NFSERR_INVAL)
|
||||
#define nfserr_fbig cpu_to_be32(NFSERR_FBIG)
|
||||
#define nfserr_nospc cpu_to_be32(NFSERR_NOSPC)
|
||||
#define nfserr_rofs cpu_to_be32(NFSERR_ROFS)
|
||||
#define nfserr_mlink cpu_to_be32(NFSERR_MLINK)
|
||||
#define nfserr_nametoolong cpu_to_be32(NFSERR_NAMETOOLONG)
|
||||
#define nfserr_notempty cpu_to_be32(NFSERR_NOTEMPTY)
|
||||
#define nfserr_dquot cpu_to_be32(NFSERR_DQUOT)
|
||||
#define nfserr_stale cpu_to_be32(NFSERR_STALE)
|
||||
#define nfserr_remote cpu_to_be32(NFSERR_REMOTE)
|
||||
#define nfserr_wflush cpu_to_be32(NFSERR_WFLUSH)
|
||||
#define nfserr_badhandle cpu_to_be32(NFSERR_BADHANDLE)
|
||||
#define nfserr_notsync cpu_to_be32(NFSERR_NOT_SYNC)
|
||||
#define nfserr_badcookie cpu_to_be32(NFSERR_BAD_COOKIE)
|
||||
#define nfserr_notsupp cpu_to_be32(NFSERR_NOTSUPP)
|
||||
#define nfserr_toosmall cpu_to_be32(NFSERR_TOOSMALL)
|
||||
#define nfserr_serverfault cpu_to_be32(NFSERR_SERVERFAULT)
|
||||
#define nfserr_badtype cpu_to_be32(NFSERR_BADTYPE)
|
||||
#define nfserr_jukebox cpu_to_be32(NFSERR_JUKEBOX)
|
||||
#define nfserr_denied cpu_to_be32(NFSERR_DENIED)
|
||||
#define nfserr_deadlock cpu_to_be32(NFSERR_DEADLOCK)
|
||||
#define nfserr_expired cpu_to_be32(NFSERR_EXPIRED)
|
||||
#define nfserr_bad_cookie cpu_to_be32(NFSERR_BAD_COOKIE)
|
||||
#define nfserr_same cpu_to_be32(NFSERR_SAME)
|
||||
#define nfserr_clid_inuse cpu_to_be32(NFSERR_CLID_INUSE)
|
||||
#define nfserr_stale_clientid cpu_to_be32(NFSERR_STALE_CLIENTID)
|
||||
#define nfserr_resource cpu_to_be32(NFSERR_RESOURCE)
|
||||
#define nfserr_moved cpu_to_be32(NFSERR_MOVED)
|
||||
#define nfserr_nofilehandle cpu_to_be32(NFSERR_NOFILEHANDLE)
|
||||
#define nfserr_minor_vers_mismatch cpu_to_be32(NFSERR_MINOR_VERS_MISMATCH)
|
||||
#define nfserr_share_denied cpu_to_be32(NFSERR_SHARE_DENIED)
|
||||
#define nfserr_stale_stateid cpu_to_be32(NFSERR_STALE_STATEID)
|
||||
#define nfserr_old_stateid cpu_to_be32(NFSERR_OLD_STATEID)
|
||||
#define nfserr_bad_stateid cpu_to_be32(NFSERR_BAD_STATEID)
|
||||
#define nfserr_bad_seqid cpu_to_be32(NFSERR_BAD_SEQID)
|
||||
#define nfserr_symlink cpu_to_be32(NFSERR_SYMLINK)
|
||||
#define nfserr_not_same cpu_to_be32(NFSERR_NOT_SAME)
|
||||
#define nfserr_lock_range cpu_to_be32(NFSERR_LOCK_RANGE)
|
||||
#define nfserr_restorefh cpu_to_be32(NFSERR_RESTOREFH)
|
||||
#define nfserr_attrnotsupp cpu_to_be32(NFSERR_ATTRNOTSUPP)
|
||||
#define nfserr_bad_xdr cpu_to_be32(NFSERR_BAD_XDR)
|
||||
#define nfserr_openmode cpu_to_be32(NFSERR_OPENMODE)
|
||||
#define nfserr_badowner cpu_to_be32(NFSERR_BADOWNER)
|
||||
#define nfserr_locks_held cpu_to_be32(NFSERR_LOCKS_HELD)
|
||||
#define nfserr_op_illegal cpu_to_be32(NFSERR_OP_ILLEGAL)
|
||||
#define nfserr_grace cpu_to_be32(NFSERR_GRACE)
|
||||
#define nfserr_no_grace cpu_to_be32(NFSERR_NO_GRACE)
|
||||
#define nfserr_reclaim_bad cpu_to_be32(NFSERR_RECLAIM_BAD)
|
||||
#define nfserr_badname cpu_to_be32(NFSERR_BADNAME)
|
||||
#define nfserr_admin_revoked cpu_to_be32(NFS4ERR_ADMIN_REVOKED)
|
||||
#define nfserr_cb_path_down cpu_to_be32(NFSERR_CB_PATH_DOWN)
|
||||
#define nfserr_locked cpu_to_be32(NFSERR_LOCKED)
|
||||
#define nfserr_wrongsec cpu_to_be32(NFSERR_WRONGSEC)
|
||||
#define nfs_ok cpu_to_be32(NFS_OK)
|
||||
#define nfserr_perm cpu_to_be32(NFSERR_PERM)
|
||||
#define nfserr_noent cpu_to_be32(NFSERR_NOENT)
|
||||
#define nfserr_io cpu_to_be32(NFSERR_IO)
|
||||
#define nfserr_nxio cpu_to_be32(NFSERR_NXIO)
|
||||
#define nfserr_acces cpu_to_be32(NFSERR_ACCES)
|
||||
#define nfserr_exist cpu_to_be32(NFSERR_EXIST)
|
||||
#define nfserr_xdev cpu_to_be32(NFS3ERR_XDEV)
|
||||
#define nfserr_nodev cpu_to_be32(NFSERR_NODEV)
|
||||
#define nfserr_notdir cpu_to_be32(NFSERR_NOTDIR)
|
||||
#define nfserr_isdir cpu_to_be32(NFSERR_ISDIR)
|
||||
#define nfserr_inval cpu_to_be32(NFS3ERR_INVAL)
|
||||
#define nfserr_fbig cpu_to_be32(NFSERR_FBIG)
|
||||
#define nfserr_nospc cpu_to_be32(NFSERR_NOSPC)
|
||||
#define nfserr_rofs cpu_to_be32(NFSERR_ROFS)
|
||||
#define nfserr_mlink cpu_to_be32(NFS3ERR_MLINK)
|
||||
#define nfserr_nametoolong cpu_to_be32(NFSERR_NAMETOOLONG)
|
||||
#define nfserr_notempty cpu_to_be32(NFSERR_NOTEMPTY)
|
||||
#define nfserr_dquot cpu_to_be32(NFSERR_DQUOT)
|
||||
#define nfserr_stale cpu_to_be32(NFSERR_STALE)
|
||||
#define nfserr_remote cpu_to_be32(NFS3ERR_REMOTE)
|
||||
#define nfserr_wflush cpu_to_be32(NFSERR_WFLUSH)
|
||||
#define nfserr_badhandle cpu_to_be32(NFS3ERR_BADHANDLE)
|
||||
#define nfserr_notsync cpu_to_be32(NFS3ERR_NOT_SYNC)
|
||||
#define nfserr_badcookie cpu_to_be32(NFS3ERR_BAD_COOKIE)
|
||||
#define nfserr_notsupp cpu_to_be32(NFS3ERR_NOTSUPP)
|
||||
#define nfserr_toosmall cpu_to_be32(NFS3ERR_TOOSMALL)
|
||||
#define nfserr_serverfault cpu_to_be32(NFS3ERR_SERVERFAULT)
|
||||
#define nfserr_badtype cpu_to_be32(NFS3ERR_BADTYPE)
|
||||
#define nfserr_jukebox cpu_to_be32(NFS3ERR_JUKEBOX)
|
||||
#define nfserr_delay cpu_to_be32(NFS4ERR_DELAY)
|
||||
#define nfserr_same cpu_to_be32(NFS4ERR_SAME)
|
||||
#define nfserr_denied cpu_to_be32(NFS4ERR_DENIED)
|
||||
#define nfserr_deadlock cpu_to_be32(NFS4ERR_DEADLOCK)
|
||||
#define nfserr_expired cpu_to_be32(NFS4ERR_EXPIRED)
|
||||
#define nfserr_bad_cookie cpu_to_be32(NFS4ERR_BAD_COOKIE)
|
||||
#define nfserr_clid_inuse cpu_to_be32(NFS4ERR_CLID_INUSE)
|
||||
#define nfserr_stale_clientid cpu_to_be32(NFS4ERR_STALE_CLIENTID)
|
||||
#define nfserr_resource cpu_to_be32(NFS4ERR_RESOURCE)
|
||||
#define nfserr_moved cpu_to_be32(NFS4ERR_MOVED)
|
||||
#define nfserr_nofilehandle cpu_to_be32(NFS4ERR_NOFILEHANDLE)
|
||||
#define nfserr_minor_vers_mismatch cpu_to_be32(NFS4ERR_MINOR_VERS_MISMATCH)
|
||||
#define nfserr_share_denied cpu_to_be32(NFS4ERR_SHARE_DENIED)
|
||||
#define nfserr_stale_stateid cpu_to_be32(NFS4ERR_STALE_STATEID)
|
||||
#define nfserr_old_stateid cpu_to_be32(NFS4ERR_OLD_STATEID)
|
||||
#define nfserr_bad_stateid cpu_to_be32(NFS4ERR_BAD_STATEID)
|
||||
#define nfserr_bad_seqid cpu_to_be32(NFS4ERR_BAD_SEQID)
|
||||
#define nfserr_symlink cpu_to_be32(NFS4ERR_SYMLINK)
|
||||
#define nfserr_not_same cpu_to_be32(NFS4ERR_NOT_SAME)
|
||||
#define nfserr_lock_range cpu_to_be32(NFS4ERR_LOCK_RANGE)
|
||||
#define nfserr_restorefh cpu_to_be32(NFS4ERR_RESTOREFH)
|
||||
#define nfserr_attrnotsupp cpu_to_be32(NFS4ERR_ATTRNOTSUPP)
|
||||
#define nfserr_bad_xdr cpu_to_be32(NFS4ERR_BADXDR)
|
||||
#define nfserr_openmode cpu_to_be32(NFS4ERR_OPENMODE)
|
||||
#define nfserr_badowner cpu_to_be32(NFS4ERR_BADOWNER)
|
||||
#define nfserr_locks_held cpu_to_be32(NFS4ERR_LOCKS_HELD)
|
||||
#define nfserr_op_illegal cpu_to_be32(NFS4ERR_OP_ILLEGAL)
|
||||
#define nfserr_grace cpu_to_be32(NFS4ERR_GRACE)
|
||||
#define nfserr_no_grace cpu_to_be32(NFS4ERR_NO_GRACE)
|
||||
#define nfserr_reclaim_bad cpu_to_be32(NFS4ERR_RECLAIM_BAD)
|
||||
#define nfserr_badname cpu_to_be32(NFS4ERR_BADNAME)
|
||||
#define nfserr_admin_revoked cpu_to_be32(NFS4ERR_ADMIN_REVOKED)
|
||||
#define nfserr_cb_path_down cpu_to_be32(NFS4ERR_CB_PATH_DOWN)
|
||||
#define nfserr_locked cpu_to_be32(NFS4ERR_LOCKED)
|
||||
#define nfserr_wrongsec cpu_to_be32(NFS4ERR_WRONGSEC)
|
||||
#define nfserr_badiomode cpu_to_be32(NFS4ERR_BADIOMODE)
|
||||
#define nfserr_badlayout cpu_to_be32(NFS4ERR_BADLAYOUT)
|
||||
#define nfserr_bad_session_digest cpu_to_be32(NFS4ERR_BAD_SESSION_DIGEST)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user