Whamcloud - gitweb
LU-11014 mdc: remove obsolete intent opcodes 61/32361/6
authorJohn L. Hammond <john.hammond@intel.com>
Fri, 11 May 2018 17:04:02 +0000 (12:04 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 18 Aug 2018 02:23:36 +0000 (02:23 +0000)
In enum ldlm_intent_flags, remove the obsolete constants IT_UNLINK,
IT_TRUNC, IT_EXEC, IT_PIN, IT_SETXATTR. Remove any handling code for
these opcodes.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I66f20e4c881cb77a481805a148a33f1c2daa5f0c
Reviewed-on: https://review.whamcloud.com/32361
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_req_layout.h
lustre/include/obd.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/ldlm/ldlm_lock.c
lustre/mdc/mdc_locks.c
lustre/ptlrpc/layout.c
lustre/ptlrpc/nrs_tbf.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index 3f4c58d..6a2c154 100644 (file)
@@ -216,7 +216,6 @@ extern struct req_format RQF_LDLM_INTENT_LAYOUT;
 extern struct req_format RQF_LDLM_INTENT_GETATTR;
 extern struct req_format RQF_LDLM_INTENT_OPEN;
 extern struct req_format RQF_LDLM_INTENT_CREATE;
 extern struct req_format RQF_LDLM_INTENT_GETATTR;
 extern struct req_format RQF_LDLM_INTENT_OPEN;
 extern struct req_format RQF_LDLM_INTENT_CREATE;
-extern struct req_format RQF_LDLM_INTENT_UNLINK;
 extern struct req_format RQF_LDLM_INTENT_GETXATTR;
 extern struct req_format RQF_LDLM_INTENT_QUOTA;
 extern struct req_format RQF_LDLM_CANCEL;
 extern struct req_format RQF_LDLM_INTENT_GETXATTR;
 extern struct req_format RQF_LDLM_INTENT_QUOTA;
 extern struct req_format RQF_LDLM_CANCEL;
index f16f2ab..fa3b407 100644 (file)
@@ -791,8 +791,6 @@ static inline int it_to_lock_mode(struct lookup_intent *it)
                return LCK_PR;
        else if (it->it_op &  IT_GETXATTR)
                return LCK_PR;
                return LCK_PR;
        else if (it->it_op &  IT_GETXATTR)
                return LCK_PR;
-       else if (it->it_op &  IT_SETXATTR)
-               return LCK_PW;
 
        LASSERTF(0, "Invalid it_op: %d\n", it->it_op);
        return -EINVAL;
 
        LASSERTF(0, "Invalid it_op: %d\n", it->it_op);
        return -EINVAL;
@@ -821,7 +819,7 @@ enum md_cli_flags {
  */
 static inline bool it_has_reply_body(const struct lookup_intent *it)
 {
  */
 static inline bool it_has_reply_body(const struct lookup_intent *it)
 {
-       return it->it_op & (IT_OPEN | IT_UNLINK | IT_LOOKUP | IT_GETATTR);
+       return it->it_op & (IT_OPEN | IT_LOOKUP | IT_GETATTR);
 }
 
 struct md_op_data {
 }
 
 struct md_op_data {
index 14aa8dd..d97732b 100644 (file)
@@ -2415,19 +2415,19 @@ union ldlm_gl_desc {
 enum ldlm_intent_flags {
        IT_OPEN        = 0x00000001,
        IT_CREAT       = 0x00000002,
 enum ldlm_intent_flags {
        IT_OPEN        = 0x00000001,
        IT_CREAT       = 0x00000002,
-       IT_OPEN_CREAT  = 0x00000003,
-       IT_READDIR     = 0x00000004,
+       IT_OPEN_CREAT  = IT_OPEN | IT_CREAT, /* To allow case label. */
+       IT_READDIR     = 0x00000004, /* Used by mdc, not put on the wire. */
        IT_GETATTR     = 0x00000008,
        IT_LOOKUP      = 0x00000010,
        IT_GETATTR     = 0x00000008,
        IT_LOOKUP      = 0x00000010,
-       IT_UNLINK      = 0x00000020,
-       IT_TRUNC       = 0x00000040,
+/*     IT_UNLINK      = 0x00000020, Obsolete. */
+/*     IT_TRUNC       = 0x00000040, Obsolete. */
        IT_GETXATTR    = 0x00000080,
        IT_GETXATTR    = 0x00000080,
-       IT_EXEC        = 0x00000100,
-       IT_PIN         = 0x00000200,
+/*     IT_EXEC        = 0x00000100, Obsolete. */
+/*     IT_PIN         = 0x00000200, Obsolete. */
        IT_LAYOUT      = 0x00000400,
        IT_QUOTA_DQACQ = 0x00000800,
        IT_QUOTA_CONN  = 0x00001000,
        IT_LAYOUT      = 0x00000400,
        IT_QUOTA_DQACQ = 0x00000800,
        IT_QUOTA_CONN  = 0x00001000,
-       IT_SETXATTR    = 0x00002000,
+/*     IT_SETXATTR    = 0x00002000, Obsolete. */
        IT_GLIMPSE     = 0x00004000,
        IT_BRW         = 0x00008000,
 };
        IT_GLIMPSE     = 0x00004000,
        IT_BRW         = 0x00008000,
 };
index 6b00671..44680dd 100644 (file)
@@ -125,8 +125,6 @@ const char *ldlm_it2str(enum ldlm_intent_flags it)
                return "getattr";
        case IT_LOOKUP:
                return "lookup";
                return "getattr";
        case IT_LOOKUP:
                return "lookup";
-       case IT_UNLINK:
-               return "unlink";
        case IT_GETXATTR:
                return "getxattr";
        case IT_LAYOUT:
        case IT_GETXATTR:
                return "getxattr";
        case IT_LAYOUT:
index d40af3b..32587cf 100644 (file)
@@ -440,43 +440,6 @@ mdc_intent_getxattr_pack(struct obd_export *exp,
        RETURN(req);
 }
 
        RETURN(req);
 }
 
-static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
-                                                     struct lookup_intent *it,
-                                                     struct md_op_data *op_data)
-{
-        struct ptlrpc_request *req;
-        struct obd_device     *obddev = class_exp2obd(exp);
-        struct ldlm_intent    *lit;
-        int                    rc;
-        ENTRY;
-
-        req = ptlrpc_request_alloc(class_exp2cliimp(exp),
-                                   &RQF_LDLM_INTENT_UNLINK);
-        if (req == NULL)
-                RETURN(ERR_PTR(-ENOMEM));
-
-        req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
-                             op_data->op_namelen + 1);
-
-        rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
-        if (rc) {
-                ptlrpc_request_free(req);
-                RETURN(ERR_PTR(rc));
-        }
-
-        /* pack the intent */
-        lit = req_capsule_client_get(&req->rq_pill, &RMF_LDLM_INTENT);
-        lit->opc = (__u64)it->it_op;
-
-        /* pack the intended request */
-        mdc_unlink_pack(req, op_data);
-
-       req_capsule_set_size(&req->rq_pill, &RMF_MDT_MD, RCL_SERVER,
-                            obddev->u.cli.cl_default_mds_easize);
-       ptlrpc_request_set_replen(req);
-       RETURN(req);
-}
-
 static struct ptlrpc_request *
 mdc_intent_getattr_pack(struct obd_export *exp, struct lookup_intent *it,
                        struct md_op_data *op_data, __u32 acl_bufsize)
 static struct ptlrpc_request *
 mdc_intent_getattr_pack(struct obd_export *exp, struct lookup_intent *it,
                        struct md_op_data *op_data, __u32 acl_bufsize)
@@ -827,18 +790,18 @@ static int mdc_enqueue_base(struct obd_export *exp,
                LASSERT(policy == NULL);
 
                saved_flags |= LDLM_FL_HAS_INTENT;
                LASSERT(policy == NULL);
 
                saved_flags |= LDLM_FL_HAS_INTENT;
-               if (it->it_op & (IT_UNLINK | IT_GETATTR | IT_READDIR))
+               if (it->it_op & (IT_GETATTR | IT_READDIR))
                        policy = &update_policy;
                else if (it->it_op & IT_LAYOUT)
                        policy = &layout_policy;
                        policy = &update_policy;
                else if (it->it_op & IT_LAYOUT)
                        policy = &layout_policy;
-               else if (it->it_op & (IT_GETXATTR | IT_SETXATTR))
+               else if (it->it_op & IT_GETXATTR)
                        policy = &getxattr_policy;
                else
                        policy = &lookup_policy;
        }
 
        generation = obddev->u.cli.cl_import->imp_generation;
                        policy = &getxattr_policy;
                else
                        policy = &lookup_policy;
        }
 
        generation = obddev->u.cli.cl_import->imp_generation;
-       if (!it || (it->it_op & (IT_CREAT | IT_OPEN_CREAT)))
+       if (!it || (it->it_op & (IT_OPEN | IT_CREAT)))
                acl_bufsize = imp->imp_connect_data.ocd_max_easize;
        else
                acl_bufsize = LUSTRE_POSIX_ACL_MAX_SIZE_OLD;
                acl_bufsize = imp->imp_connect_data.ocd_max_easize;
        else
                acl_bufsize = LUSTRE_POSIX_ACL_MAX_SIZE_OLD;
@@ -852,8 +815,6 @@ resend:
                res_id.name[3] = LDLM_FLOCK;
        } else if (it->it_op & IT_OPEN) {
                req = mdc_intent_open_pack(exp, it, op_data, acl_bufsize);
                res_id.name[3] = LDLM_FLOCK;
        } else if (it->it_op & IT_OPEN) {
                req = mdc_intent_open_pack(exp, it, op_data, acl_bufsize);
-       } else if (it->it_op & IT_UNLINK) {
-               req = mdc_intent_unlink_pack(exp, it, op_data);
        } else if (it->it_op & (IT_GETATTR | IT_LOOKUP)) {
                req = mdc_intent_getattr_pack(exp, it, op_data, acl_bufsize);
        } else if (it->it_op & IT_READDIR) {
        } else if (it->it_op & (IT_GETATTR | IT_LOOKUP)) {
                req = mdc_intent_getattr_pack(exp, it, op_data, acl_bufsize);
        } else if (it->it_op & IT_READDIR) {
index 161074d..914f151 100644 (file)
@@ -480,15 +480,6 @@ static const struct req_msg_field *ldlm_intent_open_client[] = {
        &RMF_FILE_SECCTX
 };
 
        &RMF_FILE_SECCTX
 };
 
-static const struct req_msg_field *ldlm_intent_unlink_client[] = {
-        &RMF_PTLRPC_BODY,
-        &RMF_DLM_REQ,
-        &RMF_LDLM_INTENT,
-        &RMF_REC_REINT,    /* coincides with mds_reint_unlink_client[] */
-        &RMF_CAPA1,
-        &RMF_NAME
-};
-
 static const struct req_msg_field *ldlm_intent_getxattr_client[] = {
        &RMF_PTLRPC_BODY,
        &RMF_DLM_REQ,
 static const struct req_msg_field *ldlm_intent_getxattr_client[] = {
        &RMF_PTLRPC_BODY,
        &RMF_DLM_REQ,
@@ -809,7 +800,6 @@ static struct req_format *req_formats[] = {
        &RQF_LDLM_INTENT_GETATTR,
        &RQF_LDLM_INTENT_OPEN,
        &RQF_LDLM_INTENT_CREATE,
        &RQF_LDLM_INTENT_GETATTR,
        &RQF_LDLM_INTENT_OPEN,
        &RQF_LDLM_INTENT_CREATE,
-       &RQF_LDLM_INTENT_UNLINK,
        &RQF_LDLM_INTENT_GETXATTR,
        &RQF_LDLM_INTENT_QUOTA,
        &RQF_QUOTA_DQACQ,
        &RQF_LDLM_INTENT_GETXATTR,
        &RQF_LDLM_INTENT_QUOTA,
        &RQF_QUOTA_DQACQ,
@@ -1547,11 +1537,6 @@ struct req_format RQF_LDLM_INTENT_CREATE =
                         ldlm_intent_create_client, ldlm_intent_getattr_server);
 EXPORT_SYMBOL(RQF_LDLM_INTENT_CREATE);
 
                         ldlm_intent_create_client, ldlm_intent_getattr_server);
 EXPORT_SYMBOL(RQF_LDLM_INTENT_CREATE);
 
-struct req_format RQF_LDLM_INTENT_UNLINK =
-        DEFINE_REQ_FMT0("LDLM_INTENT_UNLINK",
-                        ldlm_intent_unlink_client, ldlm_intent_server);
-EXPORT_SYMBOL(RQF_LDLM_INTENT_UNLINK);
-
 struct req_format RQF_LDLM_INTENT_GETXATTR =
        DEFINE_REQ_FMT0("LDLM_INTENT_GETXATTR",
                        ldlm_intent_getxattr_client,
 struct req_format RQF_LDLM_INTENT_GETXATTR =
        DEFINE_REQ_FMT0("LDLM_INTENT_GETXATTR",
                        ldlm_intent_getxattr_client,
index 182515c..5ab39e1 100644 (file)
@@ -1486,8 +1486,6 @@ static struct req_format *intent_req_fmt(__u32 it_opc)
                return &RQF_LDLM_INTENT_OPEN;
        else if (it_opc & (IT_GETATTR | IT_LOOKUP))
                return &RQF_LDLM_INTENT_GETATTR;
                return &RQF_LDLM_INTENT_OPEN;
        else if (it_opc & (IT_GETATTR | IT_LOOKUP))
                return &RQF_LDLM_INTENT_GETATTR;
-       else if (it_opc & IT_UNLINK)
-               return &RQF_LDLM_INTENT_UNLINK;
        else if (it_opc & IT_GETXATTR)
                return &RQF_LDLM_INTENT_GETXATTR;
        else if (it_opc & (IT_GLIMPSE | IT_BRW))
        else if (it_opc & IT_GETXATTR)
                return &RQF_LDLM_INTENT_GETXATTR;
        else if (it_opc & (IT_GLIMPSE | IT_BRW))
index 7f038ba..2883dc9 100644 (file)
@@ -3468,24 +3468,14 @@ void lustre_assert_wire_constants(void)
                 (long long)IT_GETATTR);
        LASSERTF(IT_LOOKUP == 16, "found %lld\n",
                 (long long)IT_LOOKUP);
                 (long long)IT_GETATTR);
        LASSERTF(IT_LOOKUP == 16, "found %lld\n",
                 (long long)IT_LOOKUP);
-       LASSERTF(IT_UNLINK == 32, "found %lld\n",
-                (long long)IT_UNLINK);
-       LASSERTF(IT_TRUNC == 64, "found %lld\n",
-                (long long)IT_TRUNC);
        LASSERTF(IT_GETXATTR == 128, "found %lld\n",
                 (long long)IT_GETXATTR);
        LASSERTF(IT_GETXATTR == 128, "found %lld\n",
                 (long long)IT_GETXATTR);
-       LASSERTF(IT_EXEC == 256, "found %lld\n",
-                (long long)IT_EXEC);
-       LASSERTF(IT_PIN == 512, "found %lld\n",
-                (long long)IT_PIN);
        LASSERTF(IT_LAYOUT == 1024, "found %lld\n",
                 (long long)IT_LAYOUT);
        LASSERTF(IT_QUOTA_DQACQ == 2048, "found %lld\n",
                 (long long)IT_QUOTA_DQACQ);
        LASSERTF(IT_QUOTA_CONN == 4096, "found %lld\n",
                 (long long)IT_QUOTA_CONN);
        LASSERTF(IT_LAYOUT == 1024, "found %lld\n",
                 (long long)IT_LAYOUT);
        LASSERTF(IT_QUOTA_DQACQ == 2048, "found %lld\n",
                 (long long)IT_QUOTA_DQACQ);
        LASSERTF(IT_QUOTA_CONN == 4096, "found %lld\n",
                 (long long)IT_QUOTA_CONN);
-       LASSERTF(IT_SETXATTR == 8192, "found %lld\n",
-                (long long)IT_SETXATTR);
 
        /* Checks for struct ldlm_resource_desc */
        LASSERTF((int)sizeof(struct ldlm_resource_desc) == 40, "found %lld\n",
 
        /* Checks for struct ldlm_resource_desc */
        LASSERTF((int)sizeof(struct ldlm_resource_desc) == 40, "found %lld\n",
index c943663..91afeb5 100644 (file)
@@ -1476,15 +1476,10 @@ check_ldlm_intent(void)
        CHECK_VALUE(IT_READDIR);
        CHECK_VALUE(IT_GETATTR);
        CHECK_VALUE(IT_LOOKUP);
        CHECK_VALUE(IT_READDIR);
        CHECK_VALUE(IT_GETATTR);
        CHECK_VALUE(IT_LOOKUP);
-       CHECK_VALUE(IT_UNLINK);
-       CHECK_VALUE(IT_TRUNC);
        CHECK_VALUE(IT_GETXATTR);
        CHECK_VALUE(IT_GETXATTR);
-       CHECK_VALUE(IT_EXEC);
-       CHECK_VALUE(IT_PIN);
        CHECK_VALUE(IT_LAYOUT);
        CHECK_VALUE(IT_QUOTA_DQACQ);
        CHECK_VALUE(IT_QUOTA_CONN);
        CHECK_VALUE(IT_LAYOUT);
        CHECK_VALUE(IT_QUOTA_DQACQ);
        CHECK_VALUE(IT_QUOTA_CONN);
-       CHECK_VALUE(IT_SETXATTR);
 }
 
 static void
 }
 
 static void
index 3b502ae..f61f37b 100644 (file)
@@ -3489,24 +3489,14 @@ void lustre_assert_wire_constants(void)
                 (long long)IT_GETATTR);
        LASSERTF(IT_LOOKUP == 16, "found %lld\n",
                 (long long)IT_LOOKUP);
                 (long long)IT_GETATTR);
        LASSERTF(IT_LOOKUP == 16, "found %lld\n",
                 (long long)IT_LOOKUP);
-       LASSERTF(IT_UNLINK == 32, "found %lld\n",
-                (long long)IT_UNLINK);
-       LASSERTF(IT_TRUNC == 64, "found %lld\n",
-                (long long)IT_TRUNC);
        LASSERTF(IT_GETXATTR == 128, "found %lld\n",
                 (long long)IT_GETXATTR);
        LASSERTF(IT_GETXATTR == 128, "found %lld\n",
                 (long long)IT_GETXATTR);
-       LASSERTF(IT_EXEC == 256, "found %lld\n",
-                (long long)IT_EXEC);
-       LASSERTF(IT_PIN == 512, "found %lld\n",
-                (long long)IT_PIN);
        LASSERTF(IT_LAYOUT == 1024, "found %lld\n",
                 (long long)IT_LAYOUT);
        LASSERTF(IT_QUOTA_DQACQ == 2048, "found %lld\n",
                 (long long)IT_QUOTA_DQACQ);
        LASSERTF(IT_QUOTA_CONN == 4096, "found %lld\n",
                 (long long)IT_QUOTA_CONN);
        LASSERTF(IT_LAYOUT == 1024, "found %lld\n",
                 (long long)IT_LAYOUT);
        LASSERTF(IT_QUOTA_DQACQ == 2048, "found %lld\n",
                 (long long)IT_QUOTA_DQACQ);
        LASSERTF(IT_QUOTA_CONN == 4096, "found %lld\n",
                 (long long)IT_QUOTA_CONN);
-       LASSERTF(IT_SETXATTR == 8192, "found %lld\n",
-                (long long)IT_SETXATTR);
 
        /* Checks for struct ldlm_resource_desc */
        LASSERTF((int)sizeof(struct ldlm_resource_desc) == 40, "found %lld\n",
 
        /* Checks for struct ldlm_resource_desc */
        LASSERTF((int)sizeof(struct ldlm_resource_desc) == 40, "found %lld\n",