NFSv4, NFSD: move enum nfs_cb_opnum4 to include/linux/nfs4.h
authorChenXiaoSong <chenxiaosong@kylinos.cn>
Sat, 2 Dec 2023 21:07:25 +0000 (21:07 +0000)
committerChuck Lever <chuck.lever@oracle.com>
Sun, 7 Jan 2024 22:54:26 +0000 (17:54 -0500)
Callback operations enum is defined in client and server, move it to
common header file.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Anna Schumaker <Anna.Schumaker@netapp.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfs/callback.h
fs/nfsd/nfs4callback.c
include/linux/nfs4.h

index ccd4f245cae240b812c3a7e6d44e2de32de819c5..0279b78b5fc90391c9b7bba52e3bb4cb8290658e 100644 (file)
@@ -19,25 +19,6 @@ enum nfs4_callback_procnum {
        CB_COMPOUND = 1,
 };
 
-enum nfs4_callback_opnum {
-       OP_CB_GETATTR = 3,
-       OP_CB_RECALL  = 4,
-/* Callback operations new to NFSv4.1 */
-       OP_CB_LAYOUTRECALL  = 5,
-       OP_CB_NOTIFY        = 6,
-       OP_CB_PUSH_DELEG    = 7,
-       OP_CB_RECALL_ANY    = 8,
-       OP_CB_RECALLABLE_OBJ_AVAIL = 9,
-       OP_CB_RECALL_SLOT   = 10,
-       OP_CB_SEQUENCE      = 11,
-       OP_CB_WANTS_CANCELLED = 12,
-       OP_CB_NOTIFY_LOCK   = 13,
-       OP_CB_NOTIFY_DEVICEID = 14,
-/* Callback operations new to NFSv4.2 */
-       OP_CB_OFFLOAD = 15,
-       OP_CB_ILLEGAL = 10044,
-};
-
 struct nfs4_slot;
 struct cb_process_state {
        __be32                  drc_status;
index 4039ffcf90ba5879bb38583b4a11efeb729f49e6..926c29879c6ab892e4d12329169eb1b5b43d2649 100644 (file)
@@ -31,6 +31,7 @@
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <linux/nfs4.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/xprt.h>
 #include <linux/sunrpc/svc_xprt.h>
@@ -87,31 +88,6 @@ static void encode_bitmap4(struct xdr_stream *xdr, const __u32 *bitmap,
        WARN_ON_ONCE(xdr_stream_encode_uint32_array(xdr, bitmap, len) < 0);
 }
 
-/*
- *     nfs_cb_opnum4
- *
- *     enum nfs_cb_opnum4 {
- *             OP_CB_GETATTR           = 3,
- *               ...
- *     };
- */
-enum nfs_cb_opnum4 {
-       OP_CB_GETATTR                   = 3,
-       OP_CB_RECALL                    = 4,
-       OP_CB_LAYOUTRECALL              = 5,
-       OP_CB_NOTIFY                    = 6,
-       OP_CB_PUSH_DELEG                = 7,
-       OP_CB_RECALL_ANY                = 8,
-       OP_CB_RECALLABLE_OBJ_AVAIL      = 9,
-       OP_CB_RECALL_SLOT               = 10,
-       OP_CB_SEQUENCE                  = 11,
-       OP_CB_WANTS_CANCELLED           = 12,
-       OP_CB_NOTIFY_LOCK               = 13,
-       OP_CB_NOTIFY_DEVICEID           = 14,
-       OP_CB_OFFLOAD                   = 15,
-       OP_CB_ILLEGAL                   = 10044
-};
-
 static void encode_nfs_cb_opnum4(struct xdr_stream *xdr, enum nfs_cb_opnum4 op)
 {
        __be32 *p;
index c11c4db3463936995ed6b85dd02a90c95d5ac5f0..ef8d2d618d5b343b5c831ca0fccd639fa3ce7e2f 100644 (file)
@@ -869,4 +869,26 @@ enum {
        RCA4_TYPE_MASK_OTHER_LAYOUT_MAX = 15,
 };
 
+enum nfs_cb_opnum4 {
+       OP_CB_GETATTR = 3,
+       OP_CB_RECALL  = 4,
+
+       /* Callback operations new to NFSv4.1 */
+       OP_CB_LAYOUTRECALL  = 5,
+       OP_CB_NOTIFY        = 6,
+       OP_CB_PUSH_DELEG    = 7,
+       OP_CB_RECALL_ANY    = 8,
+       OP_CB_RECALLABLE_OBJ_AVAIL = 9,
+       OP_CB_RECALL_SLOT   = 10,
+       OP_CB_SEQUENCE      = 11,
+       OP_CB_WANTS_CANCELLED = 12,
+       OP_CB_NOTIFY_LOCK   = 13,
+       OP_CB_NOTIFY_DEVICEID = 14,
+
+       /* Callback operations new to NFSv4.2 */
+       OP_CB_OFFLOAD = 15,
+
+       OP_CB_ILLEGAL = 10044,
+};
+
 #endif