]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: lustre: osc: remove remaining bits for capa support
authorJohn L. Hammond <john.hammond@intel.com>
Mon, 3 Oct 2016 02:28:35 +0000 (22:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2016 08:24:40 +0000 (10:24 +0200)
With capa support removed from the OSC layer a few more bits
can be cleaned up. Convert the OBD getattr and setattr paths
to use struct obdo rather than struct obd_info. Remove
the oi_policy, oi_oa, and oi_capa members from struct obd_info.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3105
Reviewed-on: http://review.whamcloud.com/14640
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/obd.h
drivers/staging/lustre/lustre/include/obd_class.h
drivers/staging/lustre/lustre/llite/vvp_internal.h
drivers/staging/lustre/lustre/lov/lov_obd.c
drivers/staging/lustre/lustre/lov/lov_request.c
drivers/staging/lustre/lustre/obdecho/echo_client.c
drivers/staging/lustre/lustre/osc/osc_cl_internal.h
drivers/staging/lustre/lustre/osc/osc_internal.h
drivers/staging/lustre/lustre/osc/osc_io.c
drivers/staging/lustre/lustre/osc/osc_request.c

index a97738852dd0e088e2b6368944f368ba4b0ff8ad..f63336fd801c6df32aa6353f3a9deff476066628 100644 (file)
@@ -126,17 +126,10 @@ typedef int (*obd_enqueue_update_f)(void *cookie, int rc);
 
 /* obd info for a particular level (lov, osc). */
 struct obd_info {
-       /* Flags used for set request specific flags:
-          - while lock handling, the flags obtained on the enqueue
-          request are set here.
-          - while stats, the flags used for control delay/resend.
-          - while setattr, the flags used for distinguish punch operation
-        */
+       /* OBD_STATFS_* flags */
        __u64              oi_flags;
        /* lsm data specific for every OSC. */
        struct lov_stripe_md   *oi_md;
-       /* obdo data specific for every OSC, if needed at all. */
-       struct obdo         *oi_oa;
        /* statfs data specific for every OSC, if needed at all. */
        struct obd_statfs      *oi_osfs;
        /* An update callback which is called to update some data on upper
@@ -871,9 +864,9 @@ struct obd_ops {
        int (*destroy)(const struct lu_env *env, struct obd_export *exp,
                       struct obdo *oa);
        int (*setattr)(const struct lu_env *, struct obd_export *exp,
-                      struct obd_info *oinfo);
+                      struct obdo *oa);
        int (*getattr)(const struct lu_env *env, struct obd_export *exp,
-                      struct obd_info *oinfo);
+                      struct obdo *oa);
        int (*preprw)(const struct lu_env *env, int cmd,
                      struct obd_export *exp, struct obdo *oa, int objcount,
                      struct obd_ioobj *obj, struct niobuf_remote *remote,
index 7d8f0628d38d08b2340d78d023de46f778ed8b5b..0eaea549dd6f52c993c0310b1bafc52090c7df07 100644 (file)
@@ -705,26 +705,26 @@ static inline int obd_destroy(const struct lu_env *env, struct obd_export *exp,
 }
 
 static inline int obd_getattr(const struct lu_env *env, struct obd_export *exp,
-                             struct obd_info *oinfo)
+                             struct obdo *oa)
 {
        int rc;
 
        EXP_CHECK_DT_OP(exp, getattr);
        EXP_COUNTER_INCREMENT(exp, getattr);
 
-       rc = OBP(exp->exp_obd, getattr)(env, exp, oinfo);
+       rc = OBP(exp->exp_obd, getattr)(env, exp, oa);
        return rc;
 }
 
 static inline int obd_setattr(const struct lu_env *env, struct obd_export *exp,
-                             struct obd_info *oinfo)
+                             struct obdo *oa)
 {
        int rc;
 
        EXP_CHECK_DT_OP(exp, setattr);
        EXP_COUNTER_INCREMENT(exp, setattr);
 
-       rc = OBP(exp->exp_obd, setattr)(env, exp, oinfo);
+       rc = OBP(exp->exp_obd, setattr)(env, exp, oa);
        return rc;
 }
 
@@ -991,15 +991,16 @@ static inline int obd_statfs_rqset(struct obd_export *exp,
                                   __u32 flags)
 {
        struct ptlrpc_request_set *set = NULL;
-       struct obd_info oinfo = { };
+       struct obd_info oinfo = {
+               .oi_osfs = osfs,
+               .oi_flags = flags,
+       };
        int rc = 0;
 
-       set =  ptlrpc_prep_set();
+       set = ptlrpc_prep_set();
        if (!set)
                return -ENOMEM;
 
-       oinfo.oi_osfs = osfs;
-       oinfo.oi_flags = flags;
        rc = obd_statfs_async(exp, &oinfo, max_age, set);
        if (rc == 0)
                rc = ptlrpc_set_wait(set);
index a8e6aeb6aacdca685b71ec4d7b34e3a4bef2063e..891227c25031bda33271cb72b0521a6001246be0 100644 (file)
@@ -44,7 +44,6 @@ enum obd_notify_event;
 struct inode;
 struct lov_stripe_md;
 struct lustre_md;
-struct obd_capa;
 struct obd_device;
 struct obd_export;
 struct page;
index 18cb92d2f2f97b93c28fcf67bde24d13badfd71f..6530187389953d4fb5639f935126df209ffa4b59 100644 (file)
@@ -1033,7 +1033,10 @@ static int lov_statfs(const struct lu_env *env, struct obd_export *exp,
                      struct obd_statfs *osfs, __u64 max_age, __u32 flags)
 {
        struct ptlrpc_request_set *set = NULL;
-       struct obd_info oinfo = { };
+       struct obd_info oinfo = {
+               .oi_osfs = osfs,
+               .oi_flags = flags,
+       };
        int rc = 0;
 
        /* for obdclass we forbid using obd_statfs_rqset, but prefer using async
@@ -1043,8 +1046,6 @@ static int lov_statfs(const struct lu_env *env, struct obd_export *exp,
        if (!set)
                return -ENOMEM;
 
-       oinfo.oi_osfs = osfs;
-       oinfo.oi_flags = flags;
        rc = lov_statfs_async(exp, &oinfo, max_age, set);
        if (rc == 0)
                rc = ptlrpc_set_wait(set);
index c8734a6ea502bcdb2ac81785044d93fb3242e7c3..d43cc88ae6418da45d1b84d13f46b90478d4e727 100644 (file)
@@ -60,8 +60,6 @@ void lov_finish_set(struct lov_request_set *set)
                                                         rq_link);
                list_del_init(&req->rq_link);
 
-               if (req->rq_oi.oi_oa)
-                       kmem_cache_free(obdo_cachep, req->rq_oi.oi_oa);
                kfree(req->rq_oi.oi_osfs);
                kfree(req);
        }
index df6fbed58aa49bd415f611bfdf147f22a75f7d96..d8e3e96b8e54e5995cbea46b026b261fdcf5a866 100644 (file)
@@ -1542,11 +1542,7 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
        case OBD_IOC_GETATTR:
                rc = echo_get_object(&eco, ed, oa);
                if (rc == 0) {
-                       struct obd_info oinfo = {
-                               .oi_oa = oa,
-                       };
-
-                       rc = obd_getattr(env, ec->ec_exp, &oinfo);
+                       rc = obd_getattr(env, ec->ec_exp, oa);
                        echo_put_object(eco);
                }
                goto out;
@@ -1559,11 +1555,7 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 
                rc = echo_get_object(&eco, ed, oa);
                if (rc == 0) {
-                       struct obd_info oinfo = {
-                               .oi_oa = oa,
-                       };
-
-                       rc = obd_setattr(env, ec->ec_exp, &oinfo);
+                       rc = obd_setattr(env, ec->ec_exp, oa);
                        echo_put_object(eco);
                }
                goto out;
index 9c8de15c309c8060e48ae68df7bfc9abd0ff4f4c..8a554128ed7fbbf4a7252d23231594a9249c81bb 100644 (file)
@@ -77,7 +77,6 @@ struct osc_io {
 
        /** write osc_lock for this IO, used by osc_extent_find(). */
        struct osc_lock   *oi_write_osclock;
-       struct obd_info    oi_info;
        struct obdo     oi_oa;
        struct osc_async_cbargs {
                bool              opc_rpc_sent;
index 61bfacb29759b5357a009ae46fc42f4b6727f96a..dc708ea17b293f8d389092e500fc2a2ed115351e 100644 (file)
@@ -118,13 +118,13 @@ int osc_match_base(struct obd_export *exp, struct ldlm_res_id *res_id,
                   __u64 *flags, void *data, struct lustre_handle *lockh,
                   int unref);
 
-int osc_setattr_async(struct obd_export *exp, struct obd_info *oinfo,
+int osc_setattr_async(struct obd_export *exp, struct obdo *oa,
                      obd_enqueue_update_f upcall, void *cookie,
                      struct ptlrpc_request_set *rqset);
-int osc_punch_base(struct obd_export *exp, struct obd_info *oinfo,
+int osc_punch_base(struct obd_export *exp, struct obdo *oa,
                   obd_enqueue_update_f upcall, void *cookie,
                   struct ptlrpc_request_set *rqset);
-int osc_sync_base(struct obd_export *exp, struct obd_info *oinfo,
+int osc_sync_base(struct obd_export *exp, struct obdo *oa,
                  obd_enqueue_update_f upcall, void *cookie,
                  struct ptlrpc_request_set *rqset);
 
index b4e062df389fca315e564081baafb3b8cc070286..8eb42757a675f487be8fc2ecc19ebe7a5f55a344 100644 (file)
@@ -484,7 +484,6 @@ static int osc_io_setattr_start(const struct lu_env *env,
        __u64 size = io->u.ci_setattr.sa_attr.lvb_size;
        unsigned int ia_valid = io->u.ci_setattr.sa_valid;
        int result = 0;
-       struct obd_info oinfo = { };
 
        /* truncate cache dirty pages first */
        if (cl_io_is_trunc(io))
@@ -554,16 +553,15 @@ static int osc_io_setattr_start(const struct lu_env *env,
                        oa->o_valid |= OBD_MD_FLFLAGS;
                }
 
-               oinfo.oi_oa = oa;
                init_completion(&cbargs->opc_sync);
 
                if (ia_valid & ATTR_SIZE)
                        result = osc_punch_base(osc_export(cl2osc(obj)),
-                                               &oinfo, osc_async_upcall,
+                                               oa, osc_async_upcall,
                                                cbargs, PTLRPCD_SET);
                else
                        result = osc_setattr_async(osc_export(cl2osc(obj)),
-                                                  &oinfo, osc_async_upcall,
+                                                  oa, osc_async_upcall,
                                                   cbargs, PTLRPCD_SET);
                cbargs->opc_rpc_sent = result == 0;
        }
@@ -745,7 +743,6 @@ static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
 {
        struct osc_io *oio = osc_env_io(env);
        struct obdo *oa = &oio->oi_oa;
-       struct obd_info *oinfo = &oio->oi_info;
        struct lov_oinfo *loi = obj->oo_oinfo;
        struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
        int rc = 0;
@@ -761,11 +758,9 @@ static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
 
        obdo_set_parent_fid(oa, fio->fi_fid);
 
-       memset(oinfo, 0, sizeof(*oinfo));
-       oinfo->oi_oa = oa;
        init_completion(&cbargs->opc_sync);
 
-       rc = osc_sync_base(osc_export(obj), oinfo, osc_async_upcall, cbargs,
+       rc = osc_sync_base(osc_export(obj), oa, osc_async_upcall, cbargs,
                           PTLRPCD_SET);
        return rc;
 }
index 64d95c1bb4979cda529dd3c334450ee790a48b62..0985bdae11eb815ffcbd86d88042511d2d17bc10 100644 (file)
@@ -82,7 +82,7 @@ struct osc_setattr_args {
 };
 
 struct osc_fsync_args {
-       struct obd_info     *fa_oi;
+       struct obdo             *fa_oa;
        obd_enqueue_update_f fa_upcall;
        void            *fa_cookie;
 };
@@ -166,19 +166,18 @@ static int osc_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
 }
 
 static inline void osc_pack_req_body(struct ptlrpc_request *req,
-                                    struct obd_info *oinfo)
+                                    struct obdo *oa)
 {
        struct ost_body *body;
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
        LASSERT(body);
 
-       lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa,
-                            oinfo->oi_oa);
+       lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa);
 }
 
 static int osc_getattr(const struct lu_env *env, struct obd_export *exp,
-                      struct obd_info *oinfo)
+                      struct obdo *oa)
 {
        struct ptlrpc_request *req;
        struct ost_body *body;
@@ -194,7 +193,7 @@ static int osc_getattr(const struct lu_env *env, struct obd_export *exp,
                return rc;
        }
 
-       osc_pack_req_body(req, oinfo);
+       osc_pack_req_body(req, oa);
 
        ptlrpc_request_set_replen(req);
 
@@ -209,11 +208,11 @@ static int osc_getattr(const struct lu_env *env, struct obd_export *exp,
        }
 
        CDEBUG(D_INODE, "mode: %o\n", body->oa.o_mode);
-       lustre_get_wire_obdo(&req->rq_import->imp_connect_data, oinfo->oi_oa,
+       lustre_get_wire_obdo(&req->rq_import->imp_connect_data, oa,
                             &body->oa);
 
-       oinfo->oi_oa->o_blksize = cli_brw_size(exp->exp_obd);
-       oinfo->oi_oa->o_valid |= OBD_MD_FLBLKSZ;
+       oa->o_blksize = cli_brw_size(exp->exp_obd);
+       oa->o_valid |= OBD_MD_FLBLKSZ;
 
  out:
        ptlrpc_req_finished(req);
@@ -221,13 +220,13 @@ static int osc_getattr(const struct lu_env *env, struct obd_export *exp,
 }
 
 static int osc_setattr(const struct lu_env *env, struct obd_export *exp,
-                      struct obd_info *oinfo)
+                      struct obdo *oa)
 {
        struct ptlrpc_request *req;
        struct ost_body *body;
        int rc;
 
-       LASSERT(oinfo->oi_oa->o_valid & OBD_MD_FLGROUP);
+       LASSERT(oa->o_valid & OBD_MD_FLGROUP);
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_OST_SETATTR);
        if (!req)
@@ -239,7 +238,7 @@ static int osc_setattr(const struct lu_env *env, struct obd_export *exp,
                return rc;
        }
 
-       osc_pack_req_body(req, oinfo);
+       osc_pack_req_body(req, oa);
 
        ptlrpc_request_set_replen(req);
 
@@ -253,7 +252,7 @@ static int osc_setattr(const struct lu_env *env, struct obd_export *exp,
                goto out;
        }
 
-       lustre_get_wire_obdo(&req->rq_import->imp_connect_data, oinfo->oi_oa,
+       lustre_get_wire_obdo(&req->rq_import->imp_connect_data, oa,
                             &body->oa);
 
 out:
@@ -283,7 +282,7 @@ out:
        return rc;
 }
 
-int osc_setattr_async(struct obd_export *exp, struct obd_info *oinfo,
+int osc_setattr_async(struct obd_export *exp, struct obdo *oa,
                      obd_enqueue_update_f upcall, void *cookie,
                      struct ptlrpc_request_set *rqset)
 {
@@ -301,7 +300,7 @@ int osc_setattr_async(struct obd_export *exp, struct obd_info *oinfo,
                return rc;
        }
 
-       osc_pack_req_body(req, oinfo);
+       osc_pack_req_body(req, oa);
 
        ptlrpc_request_set_replen(req);
 
@@ -315,7 +314,7 @@ int osc_setattr_async(struct obd_export *exp, struct obd_info *oinfo,
 
                CLASSERT(sizeof(*sa) <= sizeof(req->rq_async_args));
                sa = ptlrpc_req_async_args(req);
-               sa->sa_oa = oinfo->oi_oa;
+               sa->sa_oa = oa;
                sa->sa_upcall = upcall;
                sa->sa_cookie = cookie;
 
@@ -382,7 +381,7 @@ out:
        return rc;
 }
 
-int osc_punch_base(struct obd_export *exp, struct obd_info *oinfo,
+int osc_punch_base(struct obd_export *exp, struct obdo *oa,
                   obd_enqueue_update_f upcall, void *cookie,
                   struct ptlrpc_request_set *rqset)
 {
@@ -406,14 +405,14 @@ int osc_punch_base(struct obd_export *exp, struct obd_info *oinfo,
        body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
        LASSERT(body);
        lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa,
-                            oinfo->oi_oa);
+                            oa);
 
        ptlrpc_request_set_replen(req);
 
        req->rq_interpret_reply = (ptlrpc_interpterer_t)osc_setattr_interpret;
        CLASSERT(sizeof(*sa) <= sizeof(req->rq_async_args));
        sa = ptlrpc_req_async_args(req);
-       sa->sa_oa = oinfo->oi_oa;
+       sa->sa_oa = oa;
        sa->sa_upcall = upcall;
        sa->sa_cookie = cookie;
        if (rqset == PTLRPCD_SET)
@@ -441,13 +440,13 @@ static int osc_sync_interpret(const struct lu_env *env,
                goto out;
        }
 
-       *fa->fa_oi->oi_oa = body->oa;
+       *fa->fa_oa = body->oa;
 out:
        rc = fa->fa_upcall(fa->fa_cookie, rc);
        return rc;
 }
 
-int osc_sync_base(struct obd_export *exp, struct obd_info *oinfo,
+int osc_sync_base(struct obd_export *exp, struct obdo *oa,
                  obd_enqueue_update_f upcall, void *cookie,
                  struct ptlrpc_request_set *rqset)
 {
@@ -470,14 +469,14 @@ int osc_sync_base(struct obd_export *exp, struct obd_info *oinfo,
        body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
        LASSERT(body);
        lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa,
-                            oinfo->oi_oa);
+                            oa);
 
        ptlrpc_request_set_replen(req);
        req->rq_interpret_reply = osc_sync_interpret;
 
        CLASSERT(sizeof(*fa) <= sizeof(req->rq_async_args));
        fa = ptlrpc_req_async_args(req);
-       fa->fa_oi = oinfo;
+       fa->fa_oa = oa;
        fa->fa_upcall = upcall;
        fa->fa_cookie = cookie;