Whamcloud - gitweb
LU-3105 osd: remove capa related stuff from servers 72/5572/47
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Wed, 10 Dec 2014 11:11:22 +0000 (14:11 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 31 Mar 2015 19:42:16 +0000 (19:42 +0000)
capability feature is broken. it's not going to be used
anytime soon. the related tests are removed as well.

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: I865a92b57abaae679d7ff8319e0e3fda603beff9
Reviewed-on: http://review.whamcloud.com/5572
Tested-by: Jenkins
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
77 files changed:
lustre/doc/osd-api.txt
lustre/fid/fid_store.c
lustre/fid/lproc_fid.c
lustre/fld/fld_index.c
lustre/fld/lproc_fld.c
lustre/include/dt_object.h
lustre/include/lu_target.h
lustre/include/lustre_capa.h
lustre/include/md_object.h
lustre/include/obd.h
lustre/include/obd_class.h
lustre/include/obd_target.h
lustre/lfsck/lfsck_engine.c
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/lfsck/lfsck_namespace.c
lustre/lfsck/lfsck_striped_dir.c
lustre/lod/lod_dev.c
lustre/lod/lod_lov.c
lustre/lod/lod_object.c
lustre/mdd/mdd_compat.c
lustre/mdd/mdd_device.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_object.c
lustre/mdd/mdd_orphans.c
lustre/mdd/mdd_permission.c
lustre/mdt/Makefile.in
lustre/mdt/mdt_capa.c [deleted file]
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_hsm.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lib.c
lustre/mdt/mdt_lproc.c
lustre/mdt/mdt_open.c
lustre/mdt/mdt_recovery.c
lustre/mdt/mdt_reint.c
lustre/mgs/mgs_llog.c
lustre/obdclass/dt_object.c
lustre/obdclass/llog_osd.c
lustre/obdclass/llog_test.c
lustre/obdclass/local_storage.c
lustre/obdecho/echo.c
lustre/obdecho/echo_client.c
lustre/ofd/Makefile.in
lustre/ofd/lproc_ofd.c
lustre/ofd/ofd_capa.c [deleted file]
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_fs.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_io.c
lustre/ofd/ofd_objects.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_io.c
lustre/osd-ldiskfs/osd_quota.c
lustre/osd-ldiskfs/osd_scrub.c
lustre/osd-zfs/osd_handler.c
lustre/osd-zfs/osd_index.c
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_io.c
lustre/osd-zfs/osd_object.c
lustre/osd-zfs/osd_quota.c
lustre/osd-zfs/osd_xattr.c
lustre/osp/osp_dev.c
lustre/osp/osp_internal.h
lustre/osp/osp_md_object.c
lustre/osp/osp_object.c
lustre/quota/lproc_quota.c
lustre/quota/lquota_disk.c
lustre/quota/lquota_lib.c
lustre/quota/qsd_reint.c
lustre/target/out_handler.c
lustre/target/tgt_handler.c
lustre/target/tgt_lastrcvd.c
lustre/target/tgt_main.c
lustre/tests/sanity-sec.sh

index d66baad..c4e9907 100644 (file)
@@ -575,8 +575,6 @@ void  (*dt_conf_get)(const struct lu_env *, const struct dt_device *,
 int   (*dt_sync)(const struct lu_env *, struct dt_device *);
 int   (*dt_ro)(const struct lu_env *, struct dt_device *);
 int   (*dt_commit_async)(const struct lu_env *, struct dt_device *);
-int   (*dt_init_capa_ctxt)(const struct lu_env *, struct dt_device *, int,
-                          unsigned long, __u32, struct lustre_capa_key *);
 
 dt_trans_create
 dt_trans_start
@@ -600,8 +598,6 @@ dt_commit_async
        called to notify OSD/backend that higher level need transaction to be
        flushed as soon as possible. Used by Commit-on-Share feature.
        Should return immediately and not block for long.
-dt_init_capa_ctxt
-       called to initialize context for capabilities. not in use currently.
 
 2. Data Objects
 ===============
@@ -633,26 +629,25 @@ void (*do_read_unlock)(const struct lu_env *, struct dt_object *);
 void (*do_write_unlock)(const struct lu_env *, struct dt_object *);
 int  (*do_write_locked)(const struct lu_env *, struct dt_object *);
 int  (*do_attr_get)(const struct lu_env *, struct dt_object *,
-                    struct lu_attr *, struct lustre_capa *);
+                    struct lu_attr *);
 int  (*do_declare_attr_set)(const struct lu_env *, struct dt_object *,
                             const struct lu_attr *, struct thandle *);
 int  (*do_attr_set)(const struct lu_env *, struct dt_object *,
-                   const struct lu_attr *, struct thandle *,
-                   struct lustre_capa *);
+                   const struct lu_attr *, struct thandle *);
 int  (*do_xattr_get)(const struct lu_env *, struct dt_object *,
-                     struct lu_buf *, const char *, struct lustre_capa *);
+                     struct lu_buf *, const char *);
 int  (*do_declare_xattr_set)(const struct lu_env *, struct dt_object *,
                              const struct lu_buf *, const char *, int,
                             struct thandle *);
 int  (*do_xattr_set)(const struct lu_env *, struct dt_object *,
                      const struct lu_buf *, const char *, int,
-                     struct thandle *, struct lustre_capa *);
+                     struct thandle *);
 int  (*do_declare_xattr_del)(const struct lu_env *, struct dt_object *,
                              const char *, struct thandle *);
 int  (*do_xattr_del)(const struct lu_env *, struct dt_object *, const char *,
-                     struct thandle *, struct lustre_capa *);
+                     struct thandle *);
 int  (*do_xattr_list)(const struct lu_env *, struct dt_object *,
-                       struct lu_buf *, struct lustre_capa *);
+                       struct lu_buf *);
 void (*do_ah_init)(const struct lu_env *, struct dt_allocation_hint *,
                     struct dt_object *, struct dt_object *, cfs_umode_t);
 int  (*do_declare_create)(const struct lu_env *, struct dt_object *,
@@ -672,8 +667,6 @@ int  (*do_ref_add)(const struct lu_env *, struct dt_object *, struct thandle *);
 int  (*do_declare_ref_del)(const struct lu_env *, struct dt_object *,
                           struct thandle *);
 int  (*do_ref_del)(const struct lu_env *, struct dt_object *, struct thandle *);
-struct obd_capa *(*do_capa_get)(const struct lu_env *, struct dt_object *,
-                                struct lustre_capa *, __u64);
 int  (*do_object_sync)(const struct lu_env *, struct dt_object *);
 
 do_read_lock
@@ -769,8 +762,6 @@ do_ref_del
        called to decrement nlink attribute in a specified transaction.
        This is typically done on an object when a record referring to it is
        deleted from an index object. The object must exist.
-do_capa_get
-       called to get a capability for a specified object. not used currently.
 do_object_sync
        called to flush a given object on-disk. It’s a fine grained version of
        ->do_sync() method which should make sure an object is stored on-disk.
@@ -787,14 +778,13 @@ Set of methods described in struct dt_body_operations which should be used with
 regular objects storing unstructured data:
 
 ssize_t (*dbo_read)(const struct lu_env *, struct dt_object *, struct lu_buf *,
-                   loff_t *pos, struct lustre_capa *);
+                   loff_t *pos);
 ssize_t (*dbo_declare_write)(const struct lu_env *, struct dt_object *,
                             const loff_t, loff_t, struct thandle *);
 ssize_t (*dbo_write)(const struct lu_env , struct dt_object *,
-                    const struct lu_buf *, loff_t *, struct thandle *,
-                    struct lustre_capa *, int);
+                    const struct lu_buf *, loff_t *, struct thandle *, int);
 int (*dbo_bufs_get)(const struct lu_env *, struct dt_object *, loff_t,
-                   ssize_t, struct niobuf_local *, int, struct lustre_capa *);
+                   ssize_t, struct niobuf_local *, int);
 int (*dbo_bufs_put)(const struct lu_env *, struct dt_object *,
                    struct niobuf_local *, int);
 int (*dbo_write_prep)(const struct lu_env *, struct dt_object *,
@@ -810,7 +800,7 @@ int (*dbo_fiemap_get)(const struct lu_env *, struct dt_object *,
 int (*dbo_declare_punch)(const struct lu_env*, struct dt_object *, __u64,
                          __u64,struct thandle *);
 int (*dbo_punch)(const struct lu_env *, struct dt_object *, __u64, __u64,
-               struct thandle *, struct lustre_capa *);
+               struct thandle *);
 
 dbo_read
        is called to read raw unstructured data from a specified range of an
@@ -891,18 +881,17 @@ to maintain user-visible namespace, FLD, index of unlinked files, etc.
 The method prototypes are defined in dt_index_operations as follows:
 
 int (*dio_lookup)(const struct lu_env *, struct dt_object *, struct dt_rec *,
-                 const struct dt_key *, struct lustre_capa *);
+                 const struct dt_key *);
 int (*dio_declare_insert)(const struct lu_env *, struct dt_object *,
                          const struct dt_rec *, const struct dt_key *,
                          struct thandle *);
 int (*dio_insert)(const struct lu_env *, struct dt_object *,
                  const struct dt_rec *, const struct dt_key *,
-                 struct thandle *, struct lustre_capa *, int);
+                 struct thandle *, int);
 int (*dio_declare_delete)(const struct lu_env *, struct dt_object *,
                           const struct dt_key *, struct thandle *);
 int (*dio_delete)(const struct lu_env *, struct dt_object *,
-                 const struct dt_key *, struct thandle *,
-                 struct lustre_capa *);
+                 const struct dt_key *, struct thandle *);
 
 dio_lookup
        is called to lookup exact key=value pair. A value is copied into a
@@ -927,8 +916,7 @@ dio_delete
 To iterate over all key=value pair stored in an index, OSD should provide the
 following set of methods:
 
-struct dt_it *(*init)(const struct lu_env *, struct dt_object *, __u32,
-                      struct lustre_capa *);
+struct dt_it *(*init)(const struct lu_env *, struct dt_object *, __u32);
 void  (*fini)(const struct lu_env *, struct dt_it *);
 int   (*get)(const struct lu_env *, struct dt_it *, const struct dt_key *);
 void  (*put)(const struct lu_env *, struct dt_it *);
index 5ed1c3c..184dd37 100644 (file)
@@ -180,9 +180,7 @@ int seq_store_read(struct lu_server_seq *seq,
         info = lu_context_key_get(&env->le_ctx, &seq_thread_key);
         LASSERT(info != NULL);
 
-       rc = seq->lss_obj->do_body_ops->dbo_read(env, seq->lss_obj,
-                                                seq_store_buf(info),
-                                                &pos, BYPASS_CAPA);
+       rc = dt_read(env, seq->lss_obj, seq_store_buf(info), &pos);
 
         if (rc == sizeof(info->sti_space)) {
                 range_le_to_cpu(&seq->lss_space, &info->sti_space);
index 6c1dfe9..bacaa8e 100644 (file)
@@ -386,7 +386,7 @@ static int fldb_seq_open(struct inode *inode, struct file *file)
 
        env_init = 1;
        iops = &obj->do_index_ops->dio_it;
-       param->fsp_it = iops->init(&param->fsp_env, obj, 0, NULL);
+       param->fsp_it = iops->init(&param->fsp_env, obj, 0);
        if (IS_ERR(param->fsp_it))
                GOTO(out, rc = PTR_ERR(param->fsp_it));
 
index db7b60d..efff9fe 100644 (file)
@@ -185,8 +185,7 @@ int fld_index_create(const struct lu_env *env, struct lu_server_fld *fld,
            range_compare_loc(new_range, range) == 0) {
                range_cpu_to_be(tmp, range);
                rc = dt_delete(env, fld->lsf_obj,
-                              (struct dt_key *)&tmp->lsr_start, th,
-                               BYPASS_CAPA);
+                              (struct dt_key *)&tmp->lsr_start, th);
                if (rc != 0)
                        GOTO(out, rc);
                *tmp = *new_range;
@@ -198,7 +197,7 @@ int fld_index_create(const struct lu_env *env, struct lu_server_fld *fld,
 
        range_cpu_to_be(tmp, tmp);
        rc = dt_insert(env, fld->lsf_obj, (struct dt_rec *)tmp,
-                      (struct dt_key *)&tmp->lsr_start, th, BYPASS_CAPA, 1);
+                      (struct dt_key *)&tmp->lsr_start, th, 1);
        if (rc != 0) {
                CERROR("%s: insert range "DRANGE" failed: rc = %d\n",
                       fld->lsf_name, PRANGE(new_range), rc);
@@ -385,7 +384,7 @@ int fld_index_init(const struct lu_env *env, struct lu_server_fld *fld,
        range = &info->fti_rec;
        /* Load fld entry to cache */
        iops = &dt_obj->do_index_ops->dio_it;
-       it = iops->init(env, dt_obj, 0, NULL);
+       it = iops->init(env, dt_obj, 0);
        if (IS_ERR(it))
                GOTO(out, rc = PTR_ERR(it));
 
@@ -470,7 +469,7 @@ int fld_server_read(const struct lu_env *env, struct lu_server_fld *fld,
 
        lsra->lsra_count = 0;
        iops = &dt_obj->do_index_ops->dio_it;
-       it = iops->init(env, dt_obj, 0, NULL);
+       it = iops->init(env, dt_obj, 0);
        if (IS_ERR(it))
                RETURN(PTR_ERR(it));
 
index ca329b8..b231c16 100644 (file)
@@ -304,7 +304,7 @@ static int fldb_seq_open(struct inode *inode, struct file *file)
 
        env_init = 1;
        iops = &obj->do_index_ops->dio_it;
-       param->fsp_it = iops->init(&param->fsp_env, obj, 0, NULL);
+       param->fsp_it = iops->init(&param->fsp_env, obj, 0);
        if (IS_ERR(param->fsp_it))
                GOTO(out, rc = PTR_ERR(param->fsp_it));
 
index 146aceb..797b207 100644 (file)
@@ -304,16 +304,6 @@ struct dt_device_operations {
         */
          int   (*dt_commit_async)(const struct lu_env *env,
                                   struct dt_device *dev);
-
-        /**
-         * Not used, subject to removal.
-         */
-        int   (*dt_init_capa_ctxt)(const struct lu_env *env,
-                                   struct dt_device *dev,
-                                   int mode,
-                                   unsigned long timeout,
-                                   __u32 alg,
-                                   struct lustre_capa_key *keys);
 };
 
 struct dt_index_features {
@@ -501,14 +491,12 @@ struct dt_object_operations {
         *
         * \param[in] env       execution environment for this thread
         * \param[in] dt        object
-        * \param[in] capa      unused
         *
         * \retval 0            on success
         * \retval negative     negated errno on error
         */
        int   (*do_declare_attr_get)(const struct lu_env *env,
-                                    struct dt_object *dt,
-                                    struct lustre_capa *capa);
+                                    struct dt_object *dt);
 
        /**
         * Return regular attributes.
@@ -522,15 +510,13 @@ struct dt_object_operations {
         * \param[in] env       execution environment for this thread
         * \param[in] dt        object
         * \param[out] attr     attributes to fill
-        * \param[in] capa      unused
         *
         * \retval 0            on success
         * \retval negative     negated errno on error
         */
        int   (*do_attr_get)(const struct lu_env *env,
                             struct dt_object *dt,
-                            struct lu_attr *attr,
-                            struct lustre_capa *capa);
+                            struct lu_attr *attr);
 
        /**
         * Declare intention to change regular object's attributes.
@@ -568,7 +554,6 @@ struct dt_object_operations {
         * \param[in] dt        object
         * \param[in] attr      new attributes to apply
         * \param[in] th        transaction handle
-        * \param[in] capa      unused
         *
         * \retval 0            on success
         * \retval negative     negated errno on error
@@ -576,8 +561,7 @@ struct dt_object_operations {
         int   (*do_attr_set)(const struct lu_env *env,
                              struct dt_object *dt,
                              const struct lu_attr *attr,
-                            struct thandle *th,
-                             struct lustre_capa *capa);
+                            struct thandle *th);
 
        /**
         * Declare intention to request extented attribute.
@@ -593,7 +577,6 @@ struct dt_object_operations {
         * \param[in] dt        object
         * \param[in] buf       unused, may be removed in the future
         * \param[in] name      name of the extended attribute
-        * \param[in] capa      unused, may be removed in the future
         *
         * \retval 0            on success
         * \retval negative     negated errno on error
@@ -601,8 +584,7 @@ struct dt_object_operations {
        int   (*do_declare_xattr_get)(const struct lu_env *env,
                                      struct dt_object *dt,
                                      struct lu_buf *buf,
-                                     const char *name,
-                                     struct lustre_capa *capa);
+                                     const char *name);
 
        /**
         * Return a value of an extended attribute.
@@ -614,7 +596,6 @@ struct dt_object_operations {
         * \param[in] dt        object
         * \param[out] buf      buffer in which to store the value
         * \param[in] name      name of the extended attribute
-        * \param[in] capa      unused
         *
         * \retval 0            on success
         * \retval -ERANGE      if \a buf is too small
@@ -624,8 +605,7 @@ struct dt_object_operations {
        int   (*do_xattr_get)(const struct lu_env *env,
                              struct dt_object *dt,
                              struct lu_buf *buf,
-                             const char *name,
-                             struct lustre_capa *capa);
+                             const char *name);
 
        /**
         * Declare intention to change an extended attribute.
@@ -670,7 +650,6 @@ struct dt_object_operations {
         * \param[in] name      name of the attribute
         * \param[in] fl        flags indicating EA creation or replacement
         * \param[in] th        transaction handle
-        * \param[in] capa      unused
         *
         * \retval 0            on success
         * \retval negative     negated errno on error
@@ -680,8 +659,7 @@ struct dt_object_operations {
                              const struct lu_buf *buf,
                              const char *name,
                              int fl,
-                             struct thandle *th,
-                             struct lustre_capa *capa);
+                             struct thandle *th);
 
        /**
         * Declare intention to delete an extended attribute.
@@ -715,7 +693,6 @@ struct dt_object_operations {
         * \param[in] dt        object
         * \param[in] name      name of the attribute
         * \param[in] th        transaction handle
-        * \param[in] capa      unused
         *
         * \retval 0            on success
         * \retval negative     negated errno on error
@@ -723,8 +700,7 @@ struct dt_object_operations {
        int   (*do_xattr_del)(const struct lu_env *env,
                              struct dt_object *dt,
                              const char *name,
-                             struct thandle *th,
-                             struct lustre_capa *capa);
+                             struct thandle *th);
 
        /**
         * Return a list of the extended attributes.
@@ -736,15 +712,13 @@ struct dt_object_operations {
         * \param[in] env       execution environment for this thread
         * \param[in] dt        object
         * \param[out] buf      buffer to put the list in
-        * \param[in] capa      unused
         *
         * \retval positive     bytes used/required in the buffer
         * \retval negative     negated errno on error
          */
        int   (*do_xattr_list)(const struct lu_env *env,
                               struct dt_object *dt,
-                              const struct lu_buf *buf,
-                              struct lustre_capa *capa);
+                              const struct lu_buf *buf);
 
        /**
         * Prepare allocation hint for a new object.
@@ -969,14 +943,6 @@ struct dt_object_operations {
                            struct thandle *th);
 
        /**
-        * Not used, subject to removal.
-        */
-       struct obd_capa *(*do_capa_get)(const struct lu_env *env,
-                                       struct dt_object *dt,
-                                       struct lustre_capa *old,
-                                       __u64 opc);
-
-       /**
         * Sync obect.
         *
         * The method is called to sync specified range of the object to a
@@ -1003,13 +969,6 @@ struct dt_object_operations {
                              __u64 end);
 
        /**
-        * Not used, subject to removal.
-        */
-       int (*do_data_get)(const struct lu_env *env,
-                          struct dt_object *dt,
-                          void **data);
-
-       /**
         * Lock object.
         *
         * Lock object(s) using Distributed Lock Manager (LDLM).
@@ -1067,7 +1026,6 @@ struct dt_body_operations {
         * \param[out] buf      buffer (including size) to copy data in
         * \param[in] pos       position in the object to start
         * \param[out] pos      original value of \a pos + bytes returned
-        * \param[in] capa      unused
         *
         * \retval positive     bytes read on success
         * \retval negative     negated errno on error
@@ -1075,8 +1033,7 @@ struct dt_body_operations {
        ssize_t (*dbo_read)(const struct lu_env *env,
                            struct dt_object *dt,
                            struct lu_buf *buf,
-                           loff_t *pos,
-                           struct lustre_capa *capa);
+                           loff_t *pos);
 
        /**
         * Declare intention to write data to object.
@@ -1122,7 +1079,6 @@ struct dt_body_operations {
         * \param[in] pos       position in the object to start
         * \param[out] pos      \a pos + bytes written
         * \param[in] th        transaction handle
-        * \param[in] capa      unused
         * \param[in] ignore    unused (was used to request quota ignorance)
         *
         * \retval positive     bytes written on success
@@ -1133,7 +1089,6 @@ struct dt_body_operations {
                             const struct lu_buf *buf,
                             loff_t *pos,
                             struct thandle *th,
-                            struct lustre_capa *capa,
                             int ignore);
 
        /**
@@ -1164,7 +1119,6 @@ struct dt_body_operations {
         * \param[in] len       size of region in bytes
         * \param[out] lb       array of descriptors to fill
         * \param[in] rw        0 if used to read, 1 if used for write
-        * \param[in] capa      unused
         *
         * \retval positive     number of descriptors on success
         * \retval negative     negated errno on error
@@ -1174,8 +1128,7 @@ struct dt_body_operations {
                            loff_t pos,
                            ssize_t len,
                            struct niobuf_local *lb,
-                           int rw,
-                           struct lustre_capa *capa);
+                           int rw);
 
        /**
         * Release reference granted by ->dbo_bufs_get().
@@ -1350,7 +1303,6 @@ struct dt_body_operations {
         * \param[in] start     the start of the region to deallocate
         * \param[in] end       the end of the region to deallocate
         * \param[in] th        transaction handle
-        * \param[in] capa      unused
         *
         * \retval 0            on success
         * \retval negative     negated errno on error
@@ -1359,8 +1311,7 @@ struct dt_body_operations {
                           struct dt_object *dt,
                           __u64 start,
                           __u64 end,
-                          struct thandle *th,
-                          struct lustre_capa *capa);
+                          struct thandle *th);
 };
 
 /**
@@ -1401,7 +1352,6 @@ struct dt_index_operations {
         * \param[in] dt        object
         * \param[out] rec      buffer where value will be stored
         * \param[in] key       key
-        * \param[in] capa      unused
         *
         * \retval 0            on success
         * \retval -ENOENT      if key isn't found
@@ -1410,8 +1360,7 @@ struct dt_index_operations {
        int (*dio_lookup)(const struct lu_env *env,
                          struct dt_object *dt,
                          struct dt_rec *rec,
-                         const struct dt_key *key,
-                         struct lustre_capa *capa);
+                         const struct dt_key *key);
 
        /**
         * Declare intention to insert a key/value into an index.
@@ -1452,7 +1401,6 @@ struct dt_index_operations {
         * \param[in] rec       buffer storing value
         * \param[in] key       key
         * \param[in] th        transaction handle
-        * \param[in] capa      unused
         * \param[in] ignore    unused (was used to request quota ignorance)
         *
         * \retval 0            on success
@@ -1463,7 +1411,6 @@ struct dt_index_operations {
                          const struct dt_rec *rec,
                          const struct dt_key *key,
                          struct thandle *th,
-                         struct lustre_capa *capa,
                          int ignore);
 
        /**
@@ -1501,7 +1448,6 @@ struct dt_index_operations {
         * \param[in] dt        object
         * \param[in] key       key
         * \param[in] th        transaction handle
-        * \param[in] capa      unused
         *
         * \retval 0            on success
         * \retval negative     negated errno on error
@@ -1509,8 +1455,7 @@ struct dt_index_operations {
        int (*dio_delete)(const struct lu_env *env,
                          struct dt_object *dt,
                          const struct dt_key *key,
-                         struct thandle *th,
-                         struct lustre_capa *capa);
+                         struct thandle *th);
 
         /**
         * Iterator interface.
@@ -1531,15 +1476,13 @@ struct dt_index_operations {
                 * \param[in] dt        object
                 * \param[in] attr      ask the iterator to return part of
                                        the records, see LUDA_* for details
-                * \param[in] capa      unused
                 *
                 * \retval pointer      iterator pointer on success
                 * \retval ERR_PTR(errno)       on error
                  */
                 struct dt_it *(*init)(const struct lu_env *env,
-                                      struct dt_object *dt,
-                                      __u32 attr,
-                                      struct lustre_capa *capa);
+                                     struct dt_object *dt,
+                                     __u32 attr);
 
                /**
                 * Release iterator.
@@ -2244,8 +2187,7 @@ static inline int dt_write_locked(const struct lu_env *env,
 }
 
 static inline int dt_declare_attr_get(const struct lu_env *env,
-                                     struct dt_object *dt,
-                                     struct lustre_capa *capa)
+                                     struct dt_object *dt)
 {
        LASSERT(dt);
        LASSERT(dt->do_ops);
@@ -2254,11 +2196,11 @@ static inline int dt_declare_attr_get(const struct lu_env *env,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_DECLARE_ATTR_GET))
                return cfs_fail_err;
 
-       return dt->do_ops->do_declare_attr_get(env, dt, capa);
+       return dt->do_ops->do_declare_attr_get(env, dt);
 }
 
 static inline int dt_attr_get(const struct lu_env *env, struct dt_object *dt,
-                              struct lu_attr *la, void *arg)
+                             struct lu_attr *la)
 {
         LASSERT(dt);
         LASSERT(dt->do_ops);
@@ -2267,7 +2209,7 @@ static inline int dt_attr_get(const struct lu_env *env, struct dt_object *dt,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_ATTR_GET))
                return cfs_fail_err;
 
-        return dt->do_ops->do_attr_get(env, dt, la, arg);
+       return dt->do_ops->do_attr_get(env, dt, la);
 }
 
 static inline int dt_declare_attr_set(const struct lu_env *env,
@@ -2286,8 +2228,7 @@ static inline int dt_declare_attr_set(const struct lu_env *env,
 }
 
 static inline int dt_attr_set(const struct lu_env *env, struct dt_object *dt,
-                              const struct lu_attr *la, struct thandle *th,
-                              struct lustre_capa *capa)
+                             const struct lu_attr *la, struct thandle *th)
 {
         LASSERT(dt);
         LASSERT(dt->do_ops);
@@ -2296,7 +2237,7 @@ static inline int dt_attr_set(const struct lu_env *env, struct dt_object *dt,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_ATTR_SET))
                return cfs_fail_err;
 
-        return dt->do_ops->do_attr_set(env, dt, la, th, capa);
+       return dt->do_ops->do_attr_set(env, dt, la, th);
 }
 
 static inline int dt_declare_ref_add(const struct lu_env *env,
@@ -2351,26 +2292,15 @@ static inline int dt_ref_del(const struct lu_env *env,
         return dt->do_ops->do_ref_del(env, dt, th);
 }
 
-static inline struct obd_capa *dt_capa_get(const struct lu_env *env,
-                                           struct dt_object *dt,
-                                           struct lustre_capa *old, __u64 opc)
-{
-        LASSERT(dt);
-        LASSERT(dt->do_ops);
-       LASSERT(dt->do_ops->do_capa_get);
-        return dt->do_ops->do_capa_get(env, dt, old, opc);
-}
-
 static inline int dt_bufs_get(const struct lu_env *env, struct dt_object *d,
                              struct niobuf_remote *rnb,
-                             struct niobuf_local *lnb, int rw,
-                             struct lustre_capa *capa)
+                             struct niobuf_local *lnb, int rw)
 {
        LASSERT(d);
        LASSERT(d->do_body_ops);
        LASSERT(d->do_body_ops->dbo_bufs_get);
        return d->do_body_ops->dbo_bufs_get(env, d, rnb->rnb_offset,
-                                           rnb->rnb_len, lnb, rw, capa);
+                                           rnb->rnb_len, lnb, rw);
 }
 
 static inline int dt_bufs_put(const struct lu_env *env, struct dt_object *d,
@@ -2432,13 +2362,12 @@ static inline int dt_declare_punch(const struct lu_env *env,
 }
 
 static inline int dt_punch(const struct lu_env *env, struct dt_object *dt,
-                           __u64 start, __u64 end, struct thandle *th,
-                           struct lustre_capa *capa)
+                          __u64 start, __u64 end, struct thandle *th)
 {
         LASSERT(dt);
         LASSERT(dt->do_body_ops);
         LASSERT(dt->do_body_ops->dbo_punch);
-        return dt->do_body_ops->dbo_punch(env, dt, start, end, th, capa);
+       return dt->do_body_ops->dbo_punch(env, dt, start, end, th);
 }
 
 static inline int dt_fiemap_get(const struct lu_env *env, struct dt_object *d,
@@ -2509,7 +2438,7 @@ static inline int dt_declare_insert(const struct lu_env *env,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_DECLARE_INSERT))
                return cfs_fail_err;
 
-        return dt->do_index_ops->dio_declare_insert(env, dt, rec, key, th);
+       return dt->do_index_ops->dio_declare_insert(env, dt, rec, key, th);
 }
 
 static inline int dt_insert(const struct lu_env *env,
@@ -2517,7 +2446,6 @@ static inline int dt_insert(const struct lu_env *env,
                                     const struct dt_rec *rec,
                                     const struct dt_key *key,
                                     struct thandle *th,
-                                    struct lustre_capa *capa,
                                     int noquota)
 {
         LASSERT(dt);
@@ -2527,8 +2455,7 @@ static inline int dt_insert(const struct lu_env *env,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_INSERT))
                return cfs_fail_err;
 
-        return dt->do_index_ops->dio_insert(env, dt, rec, key, th,
-                                            capa, noquota);
+       return dt->do_index_ops->dio_insert(env, dt, rec, key, th, noquota);
 }
 
 static inline int dt_declare_xattr_del(const struct lu_env *env,
@@ -2547,9 +2474,8 @@ static inline int dt_declare_xattr_del(const struct lu_env *env,
 }
 
 static inline int dt_xattr_del(const struct lu_env *env,
-                               struct dt_object *dt, const char *name,
-                               struct thandle *th,
-                               struct lustre_capa *capa)
+                              struct dt_object *dt, const char *name,
+                              struct thandle *th)
 {
         LASSERT(dt);
         LASSERT(dt->do_ops);
@@ -2558,7 +2484,7 @@ static inline int dt_xattr_del(const struct lu_env *env,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_XATTR_DEL))
                return cfs_fail_err;
 
-        return dt->do_ops->do_xattr_del(env, dt, name, th, capa);
+       return dt->do_ops->do_xattr_del(env, dt, name, th);
 }
 
 static inline int dt_declare_xattr_set(const struct lu_env *env,
@@ -2578,9 +2504,8 @@ static inline int dt_declare_xattr_set(const struct lu_env *env,
 }
 
 static inline int dt_xattr_set(const struct lu_env *env,
-                              struct dt_object *dt, const struct lu_buf *buf,
-                              const char *name, int fl, struct thandle *th,
-                              struct lustre_capa *capa)
+                              struct dt_object *dt, const struct lu_buf *buf,
+                              const char *name, int fl, struct thandle *th)
 {
         LASSERT(dt);
         LASSERT(dt->do_ops);
@@ -2589,14 +2514,13 @@ static inline int dt_xattr_set(const struct lu_env *env,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_XATTR_SET))
                return cfs_fail_err;
 
-        return dt->do_ops->do_xattr_set(env, dt, buf, name, fl, th, capa);
+       return dt->do_ops->do_xattr_set(env, dt, buf, name, fl, th);
 }
 
 static inline int dt_declare_xattr_get(const struct lu_env *env,
                                       struct dt_object *dt,
                                       struct lu_buf *buf,
-                                      const char *name,
-                                      struct lustre_capa *capa)
+                                      const char *name)
 {
        LASSERT(dt);
        LASSERT(dt->do_ops);
@@ -2605,12 +2529,12 @@ static inline int dt_declare_xattr_get(const struct lu_env *env,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_DECLARE_XATTR_GET))
                return cfs_fail_err;
 
-       return dt->do_ops->do_declare_xattr_get(env, dt, buf, name, capa);
+       return dt->do_ops->do_declare_xattr_get(env, dt, buf, name);
 }
 
 static inline int dt_xattr_get(const struct lu_env *env,
-                              struct dt_object *dt, struct lu_buf *buf,
-                              const char *name, struct lustre_capa *capa)
+                              struct dt_object *dt, struct lu_buf *buf,
+                              const char *name)
 {
         LASSERT(dt);
         LASSERT(dt->do_ops);
@@ -2619,12 +2543,11 @@ static inline int dt_xattr_get(const struct lu_env *env,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_XATTR_GET))
                return cfs_fail_err;
 
-        return dt->do_ops->do_xattr_get(env, dt, buf, name, capa);
+       return dt->do_ops->do_xattr_get(env, dt, buf, name);
 }
 
 static inline int dt_xattr_list(const struct lu_env *env, struct dt_object *dt,
-                               const struct lu_buf *buf,
-                               struct lustre_capa *capa)
+                               const struct lu_buf *buf)
 {
         LASSERT(dt);
         LASSERT(dt->do_ops);
@@ -2633,7 +2556,7 @@ static inline int dt_xattr_list(const struct lu_env *env, struct dt_object *dt,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_XATTR_LIST))
                return cfs_fail_err;
 
-        return dt->do_ops->do_xattr_list(env, dt, buf, capa);
+       return dt->do_ops->do_xattr_list(env, dt, buf);
 }
 
 static inline int dt_declare_delete(const struct lu_env *env,
@@ -2652,10 +2575,9 @@ static inline int dt_declare_delete(const struct lu_env *env,
 }
 
 static inline int dt_delete(const struct lu_env *env,
-                            struct dt_object *dt,
-                            const struct dt_key *key,
-                            struct thandle *th,
-                            struct lustre_capa *capa)
+                           struct dt_object *dt,
+                           const struct dt_key *key,
+                           struct thandle *th)
 {
         LASSERT(dt);
         LASSERT(dt->do_index_ops);
@@ -2664,7 +2586,7 @@ static inline int dt_delete(const struct lu_env *env,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_DELETE))
                return cfs_fail_err;
 
-        return dt->do_index_ops->dio_delete(env, dt, key, th, capa);
+       return dt->do_index_ops->dio_delete(env, dt, key, th);
 }
 
 static inline int dt_commit_async(const struct lu_env *env,
@@ -2676,23 +2598,10 @@ static inline int dt_commit_async(const struct lu_env *env,
         return dev->dd_ops->dt_commit_async(env, dev);
 }
 
-static inline int dt_init_capa_ctxt(const struct lu_env *env,
-                                   struct dt_device *dev,
-                                   int mode, unsigned long timeout,
-                                   __u32 alg, struct lustre_capa_key *keys)
-{
-       LASSERT(dev);
-       LASSERT(dev->dd_ops);
-       LASSERT(dev->dd_ops->dt_init_capa_ctxt);
-       return dev->dd_ops->dt_init_capa_ctxt(env, dev, mode,
-                                             timeout, alg, keys);
-}
-
 static inline int dt_lookup(const struct lu_env *env,
-                            struct dt_object *dt,
-                            struct dt_rec *rec,
-                            const struct dt_key *key,
-                            struct lustre_capa *capa)
+                           struct dt_object *dt,
+                           struct dt_rec *rec,
+                           const struct dt_key *key)
 {
         int ret;
 
@@ -2703,7 +2612,7 @@ static inline int dt_lookup(const struct lu_env *env,
        if (CFS_FAULT_CHECK(OBD_FAIL_DT_LOOKUP))
                return cfs_fail_err;
 
-        ret = dt->do_index_ops->dio_lookup(env, dt, rec, key, capa);
+       ret = dt->do_index_ops->dio_lookup(env, dt, rec, key);
         if (ret > 0)
                 ret = 0;
         else if (ret == 0)
index 829aa8f..d0580c2 100644 (file)
@@ -57,9 +57,7 @@ struct lu_target {
        struct sptlrpc_rule_set  lut_sptlrpc_rset;
        spinlock_t               lut_flags_lock;
        int                      lut_sec_level;
-       unsigned int             lut_mds_capa:1,
-                                lut_oss_capa:1,
-                                lut_syncjournal:1,
+       unsigned int             lut_syncjournal:1,
                                 lut_sync_lock_cancel:2,
                                 /* e.g. OST node */
                                 lut_no_reconstruct:1;
index b9f30ba..5a950db 100644 (file)
@@ -298,8 +298,6 @@ enum lc_auth_id {
        LC_ID_CONVERT   = 2
 };
 
-#define BYPASS_CAPA (struct lustre_capa *)ERR_PTR(-ENOENT)
-
 enum {
        LU_CAPAINFO_MAX = 5
 };
index 49ea60c..afbf660 100644 (file)
@@ -136,7 +136,6 @@ struct md_attr {
         struct lov_mds_md      *ma_lmm;
        union lmv_mds_md       *ma_lmv;
         void                   *ma_acl;
-        struct lustre_capa     *ma_capa;
         struct md_som_data     *ma_som;
         int                     ma_lmm_size;
         int                     ma_lmv_size;
@@ -220,9 +219,6 @@ struct md_object_operations {
         int (*moo_close)(const struct lu_env *env, struct md_object *obj,
                          struct md_attr *ma, int mode);
 
-        int (*moo_capa_get)(const struct lu_env *, struct md_object *,
-                            struct lustre_capa *, int renewal);
-
         int (*moo_object_sync)(const struct lu_env *, struct md_object *);
 
        int (*moo_object_lock)(const struct lu_env *env, struct md_object *obj,
@@ -290,14 +286,6 @@ struct md_device_operations {
         int (*mdo_statfs)(const struct lu_env *env, struct md_device *m,
                           struct obd_statfs *sfs);
 
-        int (*mdo_init_capa_ctxt)(const struct lu_env *env, struct md_device *m,
-                                  int mode, unsigned long timeout, __u32 alg,
-                                  struct lustre_capa_key *keys);
-
-        int (*mdo_update_capa_key)(const struct lu_env *env,
-                                   struct md_device *m,
-                                   struct lustre_capa_key *key);
-
         int (*mdo_llog_ctxt_get)(const struct lu_env *env,
                                  struct md_device *m, int idx, void **h);
 
@@ -473,15 +461,6 @@ static inline int mo_readpage(const struct lu_env *env,
         return m->mo_ops->moo_readpage(env, m, rdpg);
 }
 
-static inline int mo_capa_get(const struct lu_env *env,
-                              struct md_object *m,
-                              struct lustre_capa *c,
-                              int renewal)
-{
-        LASSERT(m->mo_ops->moo_capa_get);
-        return m->mo_ops->moo_capa_get(env, m, c, renewal);
-}
-
 static inline int mo_object_sync(const struct lu_env *env, struct md_object *m)
 {
         LASSERT(m->mo_ops->moo_object_sync);
index c22ad54..8df80a2 100644 (file)
@@ -965,8 +965,8 @@ struct obd_ops {
         int (*o_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,
-                        int *nr_pages, struct niobuf_local *local,
-                        struct obd_trans_info *oti, struct lustre_capa *capa);
+                       int *nr_pages, struct niobuf_local *local,
+                       struct obd_trans_info *oti);
         int (*o_commitrw)(const struct lu_env *env, int cmd,
                           struct obd_export *exp, struct obdo *oa,
                           int objcount, struct obd_ioobj *obj,
index 44338e0..12cdfeb 100644 (file)
@@ -1203,12 +1203,11 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
 }
 
 static inline int obd_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, int *pages,
-                             struct niobuf_local *local,
-                             struct obd_trans_info *oti,
-                             struct lustre_capa *capa)
+                            struct obd_export *exp, struct obdo *oa,
+                            int objcount, struct obd_ioobj *obj,
+                            struct niobuf_remote *remote, int *pages,
+                            struct niobuf_local *local,
+                            struct obd_trans_info *oti)
 {
         int rc;
         ENTRY;
@@ -1216,8 +1215,8 @@ static inline int obd_preprw(const struct lu_env *env, int cmd,
         EXP_CHECK_DT_OP(exp, preprw);
         EXP_COUNTER_INCREMENT(exp, preprw);
 
-        rc = OBP(exp->exp_obd, preprw)(env, cmd, exp, oa, objcount, obj, remote,
-                                       pages, local, oti, capa);
+       rc = OBP(exp->exp_obd, preprw)(env, cmd, exp, oa, objcount, obj, remote,
+                                      pages, local, oti);
         RETURN(rc);
 }
 
index 70ce24a..ed8ec98 100644 (file)
@@ -53,11 +53,6 @@ struct obd_device_target {
 struct filter_obd {
        /* NB this field MUST be first */
        struct obd_device_target         fo_obt;
-
-       /* capability related */
-       unsigned int                     fo_fl_oss_capa;
-       struct list_head                 fo_capa_keys;
-       struct hlist_head               *fo_capa_hash;
 };
 
 struct echo_obd {
index 2de9537..373bb1b 100644 (file)
@@ -110,7 +110,7 @@ static int lfsck_update_lma(const struct lu_env *env,
                RETURN(0);
 
        buf = lfsck_buf_get(env, info->lti_lma_old, LMA_OLD_SIZE);
-       rc = dt_xattr_get(env, obj, buf, XATTR_NAME_LMA, BYPASS_CAPA);
+       rc = dt_xattr_get(env, obj, buf, XATTR_NAME_LMA);
        if (rc < 0) {
                if (rc != -ENODATA)
                        RETURN(rc);
@@ -142,7 +142,7 @@ static int lfsck_update_lma(const struct lu_env *env,
        if (rc != 0)
                GOTO(stop, rc);
 
-       rc = dt_xattr_set(env, obj, buf, XATTR_NAME_LMA, fl, th, BYPASS_CAPA);
+       rc = dt_xattr_set(env, obj, buf, XATTR_NAME_LMA, fl, th);
 
        GOTO(stop, rc);
 
@@ -159,7 +159,7 @@ static int lfsck_parent_fid(const struct lu_env *env, struct dt_object *obj,
                return -ENOTDIR;
 
        return dt_lookup(env, obj, (struct dt_rec *)fid,
-                        (const struct dt_key *)"..", BYPASS_CAPA);
+                        (const struct dt_key *)"..");
 }
 
 /**
@@ -253,8 +253,7 @@ static int lfsck_needs_scan_dir(const struct lu_env *env,
                }
 
                rc = dt_xattr_get(env, obj,
-                                 lfsck_buf_get(env, NULL, 0), XATTR_NAME_LINK,
-                                 BYPASS_CAPA);
+                                 lfsck_buf_get(env, NULL, 0), XATTR_NAME_LINK);
                dt_read_unlock(env, obj);
                if (rc >= 0)
                        GOTO(out, rc = 1);
@@ -416,7 +415,7 @@ int lfsck_open_dir(const struct lu_env *env,
        }
 
        iops = &obj->do_index_ops->dio_it;
-       di = iops->init(env, obj, lfsck->li_args_dir, BYPASS_CAPA);
+       di = iops->init(env, obj, lfsck->li_args_dir);
        if (IS_ERR(di))
                GOTO(out, rc = PTR_ERR(di));
 
@@ -1060,7 +1059,7 @@ int lfsck_master_engine(void *args)
                               lfsck_lfsck2name(lfsck), rc);
        }
 
-       oit_di = oit_iops->init(env, oit_obj, lfsck->li_args_oit, BYPASS_CAPA);
+       oit_di = oit_iops->init(env, oit_obj, lfsck->li_args_oit);
        if (IS_ERR(oit_di)) {
                rc = PTR_ERR(oit_di);
                CDEBUG(D_LFSCK, "%s: master engine fail to init iteration: "
index c94cf83..bb873c8 100644 (file)
@@ -119,7 +119,7 @@ lfsck_layout_object_init(const struct lu_env *env, struct dt_object *obj,
        if (llo == NULL)
                return ERR_PTR(-ENOMEM);
 
-       rc = dt_attr_get(env, obj, &llo->llo_attr, BYPASS_CAPA);
+       rc = dt_attr_get(env, obj, &llo->llo_attr);
        if (rc != 0) {
                OBD_FREE_PTR(llo);
 
@@ -373,10 +373,9 @@ static int lfsck_layout_get_lovea(const struct lu_env *env,
        int rc;
 
 again:
-       rc = dt_xattr_get(env, obj, buf, XATTR_NAME_LOV, BYPASS_CAPA);
+       rc = dt_xattr_get(env, obj, buf, XATTR_NAME_LOV);
        if (rc == -ERANGE) {
-               rc = dt_xattr_get(env, obj, &LU_BUF_NULL, XATTR_NAME_LOV,
-                                 BYPASS_CAPA);
+               rc = dt_xattr_get(env, obj, &LU_BUF_NULL, XATTR_NAME_LOV);
                if (rc <= 0)
                        return rc;
 
@@ -1038,14 +1037,14 @@ static int fid_is_for_ostobj(const struct lu_env *env,
 
        lma = &lfsck_env_info(env)->lti_lma;
        rc = dt_xattr_get(env, obj, lfsck_buf_get(env, lma, sizeof(*lma)),
-                         XATTR_NAME_LMA, BYPASS_CAPA);
+                         XATTR_NAME_LMA);
        if (rc == sizeof(*lma)) {
                lustre_lma_swab(lma);
 
                return lma->lma_compat & LMAC_FID_ON_OST ? 1 : 0;
        }
 
-       rc = dt_xattr_get(env, obj, &LU_BUF_NULL, XATTR_NAME_FID, BYPASS_CAPA);
+       rc = dt_xattr_get(env, obj, &LU_BUF_NULL, XATTR_NAME_FID);
 
        return rc > 0;
 }
@@ -1464,7 +1463,7 @@ static int lfsck_layout_get_def_stripesize(const struct lu_env *env,
 
        /* Get the default stripe size via xattr_get on the backend root. */
        rc = dt_xattr_get(env, root, lfsck_buf_get(env, lum, sizeof(*lum)),
-                         XATTR_NAME_LOV, BYPASS_CAPA);
+                         XATTR_NAME_LOV);
        if (rc > 0) {
                /* The lum->lmm_stripe_size is LE mode. The *size also
                 * should be LE mode. So it is unnecessary to convert. */
@@ -1528,8 +1527,7 @@ static int lfsck_layout_refill_lovea(const struct lu_env *env,
        }
 
        lfsck_buf_init(&ea_buf, lmm, lov_mds_md_size(count, magic));
-       rc = dt_xattr_set(env, parent, &ea_buf, XATTR_NAME_LOV, fl, handle,
-                         BYPASS_CAPA);
+       rc = dt_xattr_set(env, parent, &ea_buf, XATTR_NAME_LOV, fl, handle);
        if (rc == 0)
                rc = 1;
 
@@ -1650,8 +1648,7 @@ static int __lfsck_layout_update_pfid(const struct lu_env *env,
        if (rc != 0)
                GOTO(stop, rc);
 
-       rc = dt_xattr_set(env, child, &buf, XATTR_NAME_FID, 0, handle,
-                         BYPASS_CAPA);
+       rc = dt_xattr_set(env, child, &buf, XATTR_NAME_FID, 0, handle);
 
        GOTO(stop, rc);
 
@@ -1830,7 +1827,7 @@ again:
                snprintf(name, NAME_MAX, DFID"%s-%s-%d", PFID(pfid), infix,
                         type, idx++);
                rc = dt_lookup(env, lfsck->li_lpf_obj, (struct dt_rec *)tfid,
-                              (const struct dt_key *)name, BYPASS_CAPA);
+                              (const struct dt_key *)name);
                if (rc != 0 && rc != -ENOENT)
                        GOTO(log, rc);
        } while (rc == 0);
@@ -1843,7 +1840,7 @@ again:
        /* Re-check whether the name conflict with othrs after taken
         * the ldlm lock. */
        rc = dt_lookup(env, lfsck->li_lpf_obj, (struct dt_rec *)tfid,
-                      (const struct dt_key *)name, BYPASS_CAPA);
+                      (const struct dt_key *)name);
        if (unlikely(rc == 0)) {
                lfsck_unlock(llh);
                goto again;
@@ -1906,12 +1903,11 @@ again:
                GOTO(stop, rc);
 
        rc = dt_insert(env, lpf, (const struct dt_rec *)dtrec,
-                      (const struct dt_key *)name, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)name, th, 1);
        if (rc != 0)
                GOTO(stop, rc);
 
-       rc = dt_xattr_set(env, pobj, &linkea_buf,
-                         XATTR_NAME_LINK, 0, th, BYPASS_CAPA);
+       rc = dt_xattr_set(env, pobj, &linkea_buf, XATTR_NAME_LINK, 0, th);
        if (rc == 0 && cobj != NULL) {
                dt_trans_stop(env, dev, th);
                th = NULL;
@@ -2031,7 +2027,7 @@ static int lfsck_layout_slave_conditional_destroy(const struct lu_env *env,
        }
 
        /* Get obj's attr without lock firstly. */
-       rc = dt_attr_get(env, obj, la, BYPASS_CAPA);
+       rc = dt_attr_get(env, obj, la);
        dt_read_unlock(env, obj);
        if (rc != 0)
                GOTO(put, rc);
@@ -2054,7 +2050,7 @@ static int lfsck_layout_slave_conditional_destroy(const struct lu_env *env,
 
        dt_write_lock(env, obj, 0);
        /* Get obj's attr within lock again. */
-       rc = dt_attr_get(env, obj, la, BYPASS_CAPA);
+       rc = dt_attr_get(env, obj, la);
        if (rc != 0)
                GOTO(unlock, rc);
 
@@ -2295,10 +2291,9 @@ again:
 
        dt_write_lock(env, parent, 0);
        locked = true;
-       rc = dt_xattr_get(env, parent, buf, XATTR_NAME_LOV, BYPASS_CAPA);
+       rc = dt_xattr_get(env, parent, buf, XATTR_NAME_LOV);
        if (rc == -ERANGE) {
-               rc = dt_xattr_get(env, parent, &LU_BUF_NULL, XATTR_NAME_LOV,
-                                 BYPASS_CAPA);
+               rc = dt_xattr_get(env, parent, &LU_BUF_NULL, XATTR_NAME_LOV);
                LASSERT(rc != 0);
                goto again;
        } else if (rc == -ENODATA || rc == 0) {
@@ -2601,7 +2596,7 @@ static int lfsck_layout_scan_orphan(const struct lu_env *env,
                GOTO(put, rc);
 
        iops = &obj->do_index_ops->dio_it;
-       di = iops->init(env, obj, 0, BYPASS_CAPA);
+       di = iops->init(env, obj, 0);
        if (IS_ERR(di))
                GOTO(put, rc = PTR_ERR(di));
 
@@ -2748,7 +2743,7 @@ static int lfsck_layout_repair_dangling(const struct lu_env *env,
                GOTO(unlock2, rc);
 
        rc = dt_xattr_set(env, child, buf, XATTR_NAME_FID, LU_XATTR_CREATE,
-                         handle, BYPASS_CAPA);
+                         handle);
 
        GOTO(unlock2, rc);
 
@@ -2832,18 +2827,17 @@ static int lfsck_layout_repair_unmatched_pair(const struct lu_env *env,
        if (unlikely(lfsck_is_dead_obj(parent)))
                GOTO(unlock2, rc = 1);
 
-       rc = dt_xattr_set(env, child, buf, XATTR_NAME_FID, 0, handle,
-                         BYPASS_CAPA);
+       rc = dt_xattr_set(env, child, buf, XATTR_NAME_FID, 0, handle);
        if (rc != 0)
                GOTO(unlock2, rc);
 
        /* Get the latest parent's owner. */
-       rc = dt_attr_get(env, parent, tla, BYPASS_CAPA);
+       rc = dt_attr_get(env, parent, tla);
        if (rc != 0)
                GOTO(unlock2, rc);
 
        tla->la_valid = LA_UID | LA_GID;
-       rc = dt_attr_set(env, child, tla, handle, BYPASS_CAPA);
+       rc = dt_attr_set(env, child, tla, handle);
 
        GOTO(unlock2, rc);
 
@@ -2986,7 +2980,7 @@ static int lfsck_layout_repair_multiple_references(const struct lu_env *env,
        if (unlikely(lfsck_is_dead_obj(parent)))
                GOTO(unlock, rc = 0);
 
-       rc = dt_xattr_get(env, parent, buf, XATTR_NAME_LOV, BYPASS_CAPA);
+       rc = dt_xattr_get(env, parent, buf, XATTR_NAME_LOV);
        if (unlikely(rc == 0 || rc == -ENODATA || rc == -ERANGE))
                GOTO(unlock, rc = 0);
 
@@ -3020,7 +3014,7 @@ static int lfsck_layout_repair_multiple_references(const struct lu_env *env,
                       lov_mds_md_size(le16_to_cpu(lmm->lmm_stripe_count),
                                       magic));
        rc = dt_xattr_set(env, parent, &ea_buf, XATTR_NAME_LOV,
-                         LU_XATTR_REPLACE, handle, BYPASS_CAPA);
+                         LU_XATTR_REPLACE, handle);
 
        GOTO(unlock, rc = (rc == 0 ? 1 : rc));
 
@@ -3083,7 +3077,7 @@ static int lfsck_layout_repair_owner(const struct lu_env *env,
                GOTO(unlock, rc = 1);
 
        /* Get the latest parent's owner. */
-       rc = dt_attr_get(env, parent, tla, BYPASS_CAPA);
+       rc = dt_attr_get(env, parent, tla);
        if (rc != 0)
                GOTO(unlock, rc);
 
@@ -3093,7 +3087,7 @@ static int lfsck_layout_repair_owner(const struct lu_env *env,
                GOTO(unlock, rc = 1);
 
        tla->la_valid = LA_UID | LA_GID;
-       rc = dt_attr_set(env, child, tla, handle, BYPASS_CAPA);
+       rc = dt_attr_set(env, child, tla, handle);
 
        GOTO(unlock, rc);
 
@@ -3247,7 +3241,7 @@ static int lfsck_layout_check_parent(const struct lu_env *env,
                         * for a non-existent xattr to check if this object
                         * has been been removed or not. */
                        rc = dt_xattr_get(env, tobj, &LU_BUF_NULL,
-                                         XATTR_NAME_DUMMY, BYPASS_CAPA);
+                                         XATTR_NAME_DUMMY);
                        if (unlikely(rc == -ENOENT || rc >= 0)) {
                                rc = LLIT_UNMATCHED_PAIR;
                        } else if (rc == -ENODATA) {
@@ -3302,11 +3296,11 @@ static int lfsck_layout_assistant_handler_p1(const struct lu_env *env,
        if (unlikely(lfsck_is_dead_obj(parent)))
                GOTO(put_parent, rc = 0);
 
-       rc = dt_attr_get(env, parent, pla, BYPASS_CAPA);
+       rc = dt_attr_get(env, parent, pla);
        if (rc != 0)
                GOTO(out, rc);
 
-       rc = dt_attr_get(env, child, cla, BYPASS_CAPA);
+       rc = dt_attr_get(env, child, cla);
        if (rc == -ENOENT) {
                if (unlikely(lfsck_is_dead_obj(parent)))
                        GOTO(put_parent, rc = 0);
@@ -3319,7 +3313,7 @@ static int lfsck_layout_assistant_handler_p1(const struct lu_env *env,
                GOTO(out, rc);
 
        lfsck_buf_init(&buf, pea, sizeof(struct filter_fid_old));
-       rc = dt_xattr_get(env, child, &buf, XATTR_NAME_FID, BYPASS_CAPA);
+       rc = dt_xattr_get(env, child, &buf, XATTR_NAME_FID);
        if (unlikely(rc >= 0 && rc != sizeof(struct filter_fid_old) &&
                     rc != sizeof(struct filter_fid))) {
                type = LLIT_UNMATCHED_PAIR;
@@ -4306,12 +4300,11 @@ static int lfsck_layout_scan_stripes(const struct lu_env *env,
                        goto next;
                }
 
-               rc = dt_declare_attr_get(env, cobj, BYPASS_CAPA);
+               rc = dt_declare_attr_get(env, cobj);
                if (rc != 0)
                        goto next;
 
-               rc = dt_declare_xattr_get(env, cobj, &buf, XATTR_NAME_FID,
-                                         BYPASS_CAPA);
+               rc = dt_declare_xattr_get(env, cobj, &buf, XATTR_NAME_FID);
                if (rc != 0)
                        goto next;
 
@@ -4478,7 +4471,7 @@ again:
        }
 
        rc = dt_xattr_set(env, obj, &ea_buf, XATTR_NAME_LOV,
-                         LU_XATTR_REPLACE, handle, BYPASS_CAPA);
+                         LU_XATTR_REPLACE, handle);
        if (rc != 0)
                GOTO(out, rc);
 
@@ -5735,8 +5728,7 @@ stop:
 static int lfsck_orphan_index_lookup(const struct lu_env *env,
                                     struct dt_object *dt,
                                     struct dt_rec *rec,
-                                    const struct dt_key *key,
-                                    struct lustre_capa *capa)
+                                    const struct dt_key *key)
 {
        return -EOPNOTSUPP;
 }
@@ -5755,7 +5747,6 @@ static int lfsck_orphan_index_insert(const struct lu_env *env,
                                     const struct dt_rec *rec,
                                     const struct dt_key *key,
                                     struct thandle *handle,
-                                    struct lustre_capa *capa,
                                     int ignore_quota)
 {
        return -EOPNOTSUPP;
@@ -5772,16 +5763,14 @@ static int lfsck_orphan_index_declare_delete(const struct lu_env *env,
 static int lfsck_orphan_index_delete(const struct lu_env *env,
                                     struct dt_object *dt,
                                     const struct dt_key *key,
-                                    struct thandle *handle,
-                                    struct lustre_capa *capa)
+                                    struct thandle *handle)
 {
        return -EOPNOTSUPP;
 }
 
 static struct dt_it *lfsck_orphan_it_init(const struct lu_env *env,
                                          struct dt_object *dt,
-                                         __u32 attr,
-                                         struct lustre_capa *capa)
+                                         __u32 attr)
 {
        struct dt_device                *dev    = lu2dt_dev(dt->do_lu.lo_dev);
        struct lfsck_instance           *lfsck;
@@ -6018,12 +6007,12 @@ again1:
                goto again1;
        }
 
-       rc = dt_attr_get(env, obj, la, BYPASS_CAPA);
+       rc = dt_attr_get(env, obj, la);
        if (rc != 0)
                GOTO(out, rc);
 
        rc = dt_xattr_get(env, obj, lfsck_buf_get(env, pfid, sizeof(*pfid)),
-                         XATTR_NAME_FID, BYPASS_CAPA);
+                         XATTR_NAME_FID);
        if (rc == -ENODATA) {
                /* For the pre-created OST-object, update the bitmap to avoid
                 * others LFSCK (second phase) iteration to touch it again. */
index 4951396..679a4f7 100644 (file)
@@ -598,8 +598,7 @@ static int lfsck_lpf_remove_name_entry(const struct lu_env *env,
        if (rc != 0)
                GOTO(stop, rc);
 
-       rc = dt_delete(env, parent, (const struct dt_key *)name, th,
-                      BYPASS_CAPA);
+       rc = dt_delete(env, parent, (const struct dt_key *)name, th);
        if (rc != 0)
                GOTO(stop, rc);
 
@@ -710,14 +709,14 @@ static int lfsck_create_lpf_local(const struct lu_env *env,
        /* 1b.2. insert dot into child dir */
        rec->rec_fid = cfid;
        rc = dt_insert(env, child, (const struct dt_rec *)rec,
-                      (const struct dt_key *)dot, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)dot, th, 1);
        if (rc != 0)
                GOTO(unlock, rc);
 
        /* 1b.3. insert dotdot into child dir */
        rec->rec_fid = &LU_LPF_FID;
        rc = dt_insert(env, child, (const struct dt_rec *)rec,
-                      (const struct dt_key *)dotdot, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)dotdot, th, 1);
        if (rc != 0)
                GOTO(unlock, rc);
 
@@ -728,7 +727,7 @@ static int lfsck_create_lpf_local(const struct lu_env *env,
 
        /* 3b. insert linkEA for child. */
        rc = dt_xattr_set(env, child, &linkea_buf,
-                         XATTR_NAME_LINK, 0, th, BYPASS_CAPA);
+                         XATTR_NAME_LINK, 0, th);
        dt_write_unlock(env, child);
        if (rc != 0)
                GOTO(stop, rc);
@@ -736,7 +735,7 @@ static int lfsck_create_lpf_local(const struct lu_env *env,
        /* 4b. insert name into parent dir */
        rec->rec_fid = cfid;
        rc = dt_insert(env, parent, (const struct dt_rec *)rec,
-                      (const struct dt_key *)name, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)name, th, 1);
        if (rc != 0)
                GOTO(stop, rc);
 
@@ -865,14 +864,14 @@ static int lfsck_create_lpf_remote(const struct lu_env *env,
        rec->rec_type = S_IFDIR;
        rec->rec_fid = cfid;
        rc = dt_insert(env, child, (const struct dt_rec *)rec,
-                      (const struct dt_key *)dot, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)dot, th, 1);
        if (rc != 0)
                GOTO(unlock, rc);
 
        /* 1b.3. insert dotdot into child dir */
        rec->rec_fid = &LU_LPF_FID;
        rc = dt_insert(env, child, (const struct dt_rec *)rec,
-                      (const struct dt_key *)dotdot, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)dotdot, th, 1);
        if (rc != 0)
                GOTO(unlock, rc);
 
@@ -883,7 +882,7 @@ static int lfsck_create_lpf_remote(const struct lu_env *env,
 
        /* 3b. insert linkEA for child */
        rc = dt_xattr_set(env, child, &linkea_buf,
-                         XATTR_NAME_LINK, 0, th, BYPASS_CAPA);
+                         XATTR_NAME_LINK, 0, th);
        if (rc != 0)
                GOTO(unlock, rc);
 
@@ -925,7 +924,7 @@ static int lfsck_create_lpf_remote(const struct lu_env *env,
 
        /* 5b. insert name into parent dir */
        rc = dt_insert(env, parent, (const struct dt_rec *)rec,
-                      (const struct dt_key *)name, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)name, th, 1);
        if (rc != 0)
                GOTO(stop, rc);
 
@@ -997,7 +996,7 @@ static int lfsck_create_lpf(const struct lu_env *env,
                 * the lfsck_bookmark::lb_lpf_fid successfully. So need lookup
                 * it from MDT0 firstly. */
                rc = dt_lookup(env, parent, (struct dt_rec *)cfid,
-                              (const struct dt_key *)name, BYPASS_CAPA);
+                              (const struct dt_key *)name);
                if (rc != 0 && rc != -ENOENT)
                        GOTO(unlock, rc);
 
@@ -1075,7 +1074,7 @@ static int lfsck_scan_lpf_bad_entries(const struct lu_env *env,
        int                      rc;
        ENTRY;
 
-       it = iops->init(env, parent, LUDA_64BITHASH, BYPASS_CAPA);
+       it = iops->init(env, parent, LUDA_64BITHASH);
        if (IS_ERR(it))
                RETURN(PTR_ERR(it));
 
@@ -1206,7 +1205,7 @@ static int lfsck_verify_lpf_pairs(const struct lu_env *env,
 
        fid_zero(fid);
        rc = dt_lookup(env, child, (struct dt_rec *)fid,
-                      (const struct dt_key *)dotdot, BYPASS_CAPA);
+                      (const struct dt_key *)dotdot);
        if (rc != 0)
                GOTO(linkea, rc);
 
@@ -1292,7 +1291,7 @@ linkea:
        }
 
        rc = dt_lookup(env, parent2, (struct dt_rec *)fid,
-                      (const struct dt_key *)name2, BYPASS_CAPA);
+                      (const struct dt_key *)name2);
        dt_read_unlock(env, child);
        lfsck_ibits_unlock(&lh, LCK_PR);
        if (rc != 0 && rc != -ENOENT)
@@ -1453,7 +1452,7 @@ int lfsck_verify_lpf(const struct lu_env *env, struct lfsck_instance *lfsck)
 find_child2:
        snprintf(name, 8, "MDT%04x", node);
        rc = dt_lookup(env, parent, (struct dt_rec *)cfid,
-                      (const struct dt_key *)name, BYPASS_CAPA);
+                      (const struct dt_key *)name);
        if (rc == -ENOENT) {
                if (!fid_is_zero(&bk->lb_lpf_fid))
                        goto check_child1;
@@ -3255,7 +3254,7 @@ int lfsck_register(const struct lu_env *env, struct dt_device *key,
 
                        rc = dt_lookup(env, root,
                                (struct dt_rec *)(&lfsck->li_global_root_fid),
-                               (const struct dt_key *)"ROOT", BYPASS_CAPA);
+                               (const struct dt_key *)"ROOT");
                        if (rc != 0)
                                GOTO(out, rc);
 
@@ -3267,7 +3266,7 @@ int lfsck_register(const struct lu_env *env, struct dt_device *key,
                                GOTO(out, rc = -ENOTDIR);
 
                        rc = dt_lookup(env, obj, (struct dt_rec *)fid,
-                               (const struct dt_key *)dotlustre, BYPASS_CAPA);
+                               (const struct dt_key *)dotlustre);
                        if (rc != 0)
                                GOTO(out, rc);
 
@@ -3288,8 +3287,7 @@ int lfsck_register(const struct lu_env *env, struct dt_device *key,
 
                        *pfid = *fid;
                        rc = dt_lookup(env, obj, (struct dt_rec *)fid,
-                                      (const struct dt_key *)lostfound,
-                                      BYPASS_CAPA);
+                                      (const struct dt_key *)lostfound);
                        if (rc != 0)
                                GOTO(out, rc);
 
index 987ce57..70e36a1 100644 (file)
@@ -311,7 +311,7 @@ static int lfsck_namespace_load_bitmap(const struct lu_env *env,
        size = (ns->ln_bitmap_size + 7) >> 3;
        rc = dt_xattr_get(env, obj,
                          lfsck_buf_get(env, bitmap->data, size),
-                         XATTR_NAME_LFSCK_BITMAP, BYPASS_CAPA);
+                         XATTR_NAME_LFSCK_BITMAP);
        if (rc != size)
                RETURN(rc >= 0 ? -EINVAL : rc);
 
@@ -346,7 +346,7 @@ static int lfsck_namespace_load(const struct lu_env *env,
 
        rc = dt_xattr_get(env, com->lc_obj,
                          lfsck_buf_get(env, com->lc_file_disk, len),
-                         XATTR_NAME_LFSCK_NAMESPACE, BYPASS_CAPA);
+                         XATTR_NAME_LFSCK_NAMESPACE);
        if (rc == len) {
                struct lfsck_namespace *ns = com->lc_file_ram;
 
@@ -371,7 +371,7 @@ static int lfsck_namespace_load(const struct lu_env *env,
                 * If yes, it should be reset via returning -ESTALE. */
                rc = dt_xattr_get(env, com->lc_obj,
                                  lfsck_buf_get(env, com->lc_file_disk, len),
-                                 XATTR_NAME_LFSCK_NAMESPACE_OLD, BYPASS_CAPA);
+                                 XATTR_NAME_LFSCK_NAMESPACE_OLD);
                if (rc >= 0)
                        rc = -ESTALE;
        }
@@ -446,18 +446,17 @@ static int lfsck_namespace_store(const struct lu_env *env,
 
        rc = dt_xattr_set(env, obj,
                          lfsck_buf_get(env, com->lc_file_disk, len),
-                         XATTR_NAME_LFSCK_NAMESPACE, 0, handle, BYPASS_CAPA);
+                         XATTR_NAME_LFSCK_NAMESPACE, 0, handle);
        if (rc == 0 && bitmap != NULL)
                rc = dt_xattr_set(env, obj,
                                  lfsck_buf_get(env, bitmap->data, nbits >> 3),
-                                 XATTR_NAME_LFSCK_BITMAP, 0, handle,
-                                 BYPASS_CAPA);
+                                 XATTR_NAME_LFSCK_BITMAP, 0, handle);
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 8, 53, 0)
        if (rc == 0 && init)
                rc = dt_xattr_set(env, obj, &tbuf,
                                  XATTR_NAME_LFSCK_NAMESPACE_OLD,
-                                 LU_XATTR_CREATE, handle, BYPASS_CAPA);
+                                 LU_XATTR_CREATE, handle);
 #endif
 
        GOTO(out, rc);
@@ -587,7 +586,7 @@ int lfsck_namespace_trace_update(const struct lu_env *env,
        mutex_lock(&com->lc_sub_trace_objs[idx].lsto_mutex);
        fid_cpu_to_be(key, fid);
        rc = dt_lookup(env, obj, (struct dt_rec *)&old,
-                      (const struct dt_key *)key, BYPASS_CAPA);
+                      (const struct dt_key *)key);
        if (rc == -ENOENT) {
                if (!add)
                        GOTO(unlock, rc = 0);
@@ -634,15 +633,14 @@ int lfsck_namespace_trace_update(const struct lu_env *env,
                GOTO(log, rc);
 
        if (old != 0) {
-               rc = dt_delete(env, obj, (const struct dt_key *)key,
-                              th, BYPASS_CAPA);
+               rc = dt_delete(env, obj, (const struct dt_key *)key, th);
                if (rc != 0)
                        GOTO(log, rc);
        }
 
        if (new != 0) {
                rc = dt_insert(env, obj, (const struct dt_rec *)&new,
-                              (const struct dt_key *)key, th, BYPASS_CAPA, 1);
+                              (const struct dt_key *)key, th, 1);
                if (rc != 0)
                        GOTO(log, rc);
        }
@@ -676,7 +674,7 @@ int lfsck_namespace_check_exist(const struct lu_env *env,
                RETURN(LFSCK_NAMEENTRY_DEAD);
 
        rc = dt_lookup(env, dir, (struct dt_rec *)fid,
-                      (const struct dt_key *)name, BYPASS_CAPA);
+                      (const struct dt_key *)name);
        if (rc == -ENOENT)
                RETURN(LFSCK_NAMEENTRY_REMOVED);
 
@@ -718,11 +716,10 @@ int __lfsck_links_read(const struct lu_env *env, struct dt_object *obj,
        if (!dt_object_exists(obj))
                return -ENOENT;
 
-       rc = dt_xattr_get(env, obj, ldata->ld_buf, XATTR_NAME_LINK, BYPASS_CAPA);
+       rc = dt_xattr_get(env, obj, ldata->ld_buf, XATTR_NAME_LINK);
        if (rc == -ERANGE) {
                /* Buf was too small, figure out what we need. */
-               rc = dt_xattr_get(env, obj, &LU_BUF_NULL, XATTR_NAME_LINK,
-                                 BYPASS_CAPA);
+               rc = dt_xattr_get(env, obj, &LU_BUF_NULL, XATTR_NAME_LINK);
                if (rc <= 0)
                        return rc;
 
@@ -730,8 +727,7 @@ int __lfsck_links_read(const struct lu_env *env, struct dt_object *obj,
                if (ldata->ld_buf->lb_buf == NULL)
                        return -ENOMEM;
 
-               rc = dt_xattr_get(env, obj, ldata->ld_buf, XATTR_NAME_LINK,
-                                 BYPASS_CAPA);
+               rc = dt_xattr_get(env, obj, ldata->ld_buf, XATTR_NAME_LINK);
        }
 
        if (rc > 0)
@@ -783,7 +779,7 @@ static int lfsck_namespace_links_remove(const struct lu_env *env,
        if (lfsck->li_bookmark_ram.lb_param & LPF_DRYRUN)
                GOTO(unlock, rc = 0);
 
-       rc = dt_xattr_del(env, obj, XATTR_NAME_LINK, th, BYPASS_CAPA);
+       rc = dt_xattr_del(env, obj, XATTR_NAME_LINK, th);
 
        GOTO(unlock, rc);
 
@@ -814,8 +810,7 @@ static int lfsck_links_write(const struct lu_env *env, struct dt_object *obj,
                                                       ldata->ld_buf->lb_buf,
                                                       ldata->ld_leh->leh_len);
 
-       return dt_xattr_set(env, obj, buf, XATTR_NAME_LINK, 0, handle,
-                           BYPASS_CAPA);
+       return dt_xattr_set(env, obj, buf, XATTR_NAME_LINK, 0, handle);
 }
 
 static void lfsck_namespace_unpack_linkea_entry(struct linkea_data *ldata,
@@ -939,8 +934,7 @@ again:
                namelen = snprintf(info->lti_key, NAME_MAX, DFID"%s-%s-%d",
                                   PFID(cfid), infix, type, idx++);
                rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
-                              (const struct dt_key *)info->lti_key,
-                              BYPASS_CAPA);
+                              (const struct dt_key *)info->lti_key);
                if (rc != 0 && rc != -ENOENT)
                        GOTO(log, rc);
 
@@ -956,7 +950,7 @@ again:
        /* Re-check whether the name conflict with othrs after taken
         * the ldlm lock. */
        rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
-                      (const struct dt_key *)info->lti_key, BYPASS_CAPA);
+                      (const struct dt_key *)info->lti_key);
        if (rc == 0) {
                if (!lu_fid_eq(cfid, &tfid)) {
                        exist = false;
@@ -1048,22 +1042,20 @@ again:
 
                if (S_ISDIR(lfsck_object_type(orphan))) {
                        rc = dt_delete(env, orphan,
-                                      (const struct dt_key *)dotdot, th,
-                                      BYPASS_CAPA);
+                                      (const struct dt_key *)dotdot, th);
                        if (rc != 0)
                                GOTO(unlock, rc);
 
                        rec->rec_type = S_IFDIR;
                        rec->rec_fid = pfid;
                        rc = dt_insert(env, orphan, (const struct dt_rec *)rec,
-                                      (const struct dt_key *)dotdot, th,
-                                      BYPASS_CAPA, 1);
+                                      (const struct dt_key *)dotdot, th, 1);
                        if (rc != 0)
                                GOTO(unlock, rc);
                }
 
                rc = dt_xattr_set(env, orphan, &linkea_buf, XATTR_NAME_LINK, 0,
-                                 th, BYPASS_CAPA);
+                                 th);
        } else {
                if (rc == 0 && count != NULL)
                        *count = ldata.ld_leh->leh_reccount;
@@ -1076,8 +1068,7 @@ again:
                rec->rec_type = lfsck_object_type(orphan) & S_IFMT;
                rec->rec_fid = cfid;
                rc = dt_insert(env, parent, (const struct dt_rec *)rec,
-                              (const struct dt_key *)cname->ln_name,
-                              th, BYPASS_CAPA, 1);
+                              (const struct dt_key *)cname->ln_name, th, 1);
                if (rc == 0 && S_ISDIR(rec->rec_type)) {
                        dt_write_lock(env, parent, 0);
                        rc = dt_ref_add(env, parent, th);
@@ -1086,7 +1077,7 @@ again:
        }
 
        if (rc == 0)
-               rc = dt_attr_set(env, orphan, la, th, BYPASS_CAPA);
+               rc = dt_attr_set(env, orphan, la, th);
 
        GOTO(stop, rc = (rc == 0 ? 1 : rc));
 
@@ -1209,7 +1200,7 @@ static int lfsck_namespace_insert_normal(const struct lu_env *env,
                GOTO(stop, rc);
 
        rc = dt_insert(env, pobj, (const struct dt_rec *)rec,
-                      (const struct dt_key *)name, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)name, th, 1);
        if (rc != 0)
                GOTO(stop, rc);
 
@@ -1222,11 +1213,11 @@ static int lfsck_namespace_insert_normal(const struct lu_env *env,
        }
 
        la->la_ctime = cfs_time_current_sec();
-       rc = dt_attr_set(env, pobj, la, th, BYPASS_CAPA);
+       rc = dt_attr_set(env, pobj, la, th);
        if (rc != 0)
                GOTO(stop, rc);
 
-       rc = dt_attr_set(env, cobj, la, th, BYPASS_CAPA);
+       rc = dt_attr_set(env, cobj, la, th);
 
        GOTO(stop, rc = (rc == 0 ? 1 : rc));
 
@@ -1315,7 +1306,7 @@ static int lfsck_namespace_create_orphan_dir(const struct lu_env *env,
                snprintf(name, 8, "MDT%04x", idx);
                rc = dt_lookup(env, lfsck->li_lpf_root_obj,
                               (struct dt_rec *)&tfid,
-                              (const struct dt_key *)name, BYPASS_CAPA);
+                              (const struct dt_key *)name);
                if (rc != 0)
                        GOTO(log, rc = (rc == -ENOENT ? -ENXIO : rc));
 
@@ -1343,7 +1334,7 @@ again:
                namelen = snprintf(name, 31, DFID"-P-%d",
                                   PFID(cfid), idx++);
                rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
-                              (const struct dt_key *)name, BYPASS_CAPA);
+                              (const struct dt_key *)name);
                if (rc != 0 && rc != -ENOENT)
                        GOTO(log, rc);
        } while (rc == 0);
@@ -1356,7 +1347,7 @@ again:
        /* Re-check whether the name conflict with othrs after taken
         * the ldlm lock. */
        rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
-                      (const struct dt_key *)name, BYPASS_CAPA);
+                      (const struct dt_key *)name);
        if (unlikely(rc == 0)) {
                lfsck_unlock(llh);
                goto again;
@@ -1461,14 +1452,13 @@ again:
 
        rec->rec_fid = cfid;
        rc = dt_insert(env, orphan, (const struct dt_rec *)rec,
-                      (const struct dt_key *)dot, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)dot, th, 1);
        if (rc != 0)
                GOTO(unlock2, rc);
 
        rec->rec_fid = lfsck_dto2fid(parent);
        rc = dt_insert(env, orphan, (const struct dt_rec *)rec,
-                      (const struct dt_key *)dotdot, th,
-                      BYPASS_CAPA, 1);
+                      (const struct dt_key *)dotdot, th, 1);
        if (rc != 0)
                GOTO(unlock2, rc);
 
@@ -1477,21 +1467,20 @@ again:
                GOTO(unlock2, rc);
 
        if (lmv != NULL) {
-               rc = dt_xattr_set(env, orphan, &lmv_buf, XATTR_NAME_LMV, 0,
-                                 th, BYPASS_CAPA);
+               rc = dt_xattr_set(env, orphan, &lmv_buf, XATTR_NAME_LMV, 0, th);
                if (rc != 0)
                        GOTO(unlock2, rc);
        }
 
        rc = dt_xattr_set(env, orphan, &linkea_buf,
-                         XATTR_NAME_LINK, 0, th, BYPASS_CAPA);
+                         XATTR_NAME_LINK, 0, th);
        dt_write_unlock(env, orphan);
        if (rc != 0)
                GOTO(stop, rc);
 
        rec->rec_fid = cfid;
        rc = dt_insert(env, parent, (const struct dt_rec *)rec,
-                      (const struct dt_key *)name, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)name, th, 1);
        if (rc == 0) {
                dt_write_lock(env, parent, 0);
                rc = dt_ref_add(env, parent, th);
@@ -1622,8 +1611,7 @@ again:
 
        lfsck_buf_init(&linkea_buf, ldata_new.ld_buf->lb_buf,
                       ldata_new.ld_leh->leh_len);
-       rc = dt_xattr_set(env, obj, &linkea_buf,
-                         XATTR_NAME_LINK, 0, th, BYPASS_CAPA);
+       rc = dt_xattr_set(env, obj, &linkea_buf, XATTR_NAME_LINK, 0, th);
 
        GOTO(unlock2, rc = (rc == 0 ? 1 : rc));
 
@@ -1701,8 +1689,7 @@ static int lfsck_namespace_shrink_linkea_cond(const struct lu_env *env,
        }
 
        rc = dt_lookup(env, parent, (struct dt_rec *)cfid,
-                      (const struct dt_key *)cname->ln_name,
-                      BYPASS_CAPA);
+                      (const struct dt_key *)cname->ln_name);
        dt_read_unlock(env, parent);
 
        /* It is safe to release the ldlm lock, because when the logic come
@@ -1821,7 +1808,7 @@ static int lfsck_namespace_replace_cond(const struct lu_env *env,
        }
 
        rc = dt_lookup(env, pobj, (struct dt_rec *)&tfid,
-                      (const struct dt_key *)name, BYPASS_CAPA);
+                      (const struct dt_key *)name);
        if (rc == -ENOENT) {
                exist = false;
                goto replace;
@@ -1847,7 +1834,7 @@ static int lfsck_namespace_replace_cond(const struct lu_env *env,
                goto replace;
        }
 
-       rc = dt_attr_get(env, cobj, la, BYPASS_CAPA);
+       rc = dt_attr_get(env, cobj, la);
        if (rc != 0)
                GOTO(log, rc);
 
@@ -1857,8 +1844,7 @@ static int lfsck_namespace_replace_cond(const struct lu_env *env,
                GOTO(log, rc);
 
        if (S_ISREG(la->la_mode)) {
-               rc = dt_xattr_get(env, cobj, &LU_BUF_NULL, XATTR_NAME_LOV,
-                                 BYPASS_CAPA);
+               rc = dt_xattr_get(env, cobj, &LU_BUF_NULL, XATTR_NAME_LOV);
                /* If someone has created related OST-object(s),
                 * then keep it. */
                if ((rc > 0) || (rc < 0 && rc != -ENODATA))
@@ -1917,12 +1903,12 @@ replace:
        }
 
        /* The old name entry maybe not exist. */
-       rc = dt_delete(env, pobj, (const struct dt_key *)name, th, BYPASS_CAPA);
+       rc = dt_delete(env, pobj, (const struct dt_key *)name, th);
        if (rc != 0 && rc != -ENOENT)
                GOTO(stop, rc);
 
        rc = dt_insert(env, pobj, (const struct dt_rec *)rec,
-                      (const struct dt_key *)name, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)name, th, 1);
 
        GOTO(stop, rc = (rc == 0 ? 1 : rc));
 
@@ -1995,7 +1981,7 @@ int lfsck_namespace_rebuild_linkea(const struct lu_env *env,
                GOTO(unlock, rc = 1);
 
        rc = dt_xattr_set(env, obj, &linkea_buf,
-                         XATTR_NAME_LINK, 0, th, BYPASS_CAPA);
+                         XATTR_NAME_LINK, 0, th);
 
        GOTO(unlock, rc = (rc == 0 ? 1 : rc));
 
@@ -2101,7 +2087,7 @@ int lfsck_namespace_repair_dirent(const struct lu_env *env,
 
        dt_write_lock(env, parent, 0);
        rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
-                      (const struct dt_key *)name, BYPASS_CAPA);
+                      (const struct dt_key *)name);
        /* Someone has removed the bad name entry by race. */
        if (rc == -ENOENT)
                GOTO(unlock2, rc = 0);
@@ -2117,16 +2103,14 @@ int lfsck_namespace_repair_dirent(const struct lu_env *env,
        if (lfsck->li_bookmark_ram.lb_param & LPF_DRYRUN)
                GOTO(unlock2, rc = 1);
 
-       rc = dt_delete(env, parent, (const struct dt_key *)name, th,
-                      BYPASS_CAPA);
+       rc = dt_delete(env, parent, (const struct dt_key *)name, th);
        if (rc != 0)
                GOTO(unlock2, rc);
 
        if (update) {
                rc = dt_insert(env, parent,
                               (const struct dt_rec *)rec,
-                              (const struct dt_key *)name2, th,
-                              BYPASS_CAPA, 1);
+                              (const struct dt_key *)name2, th, 1);
                if (rc != 0)
                        GOTO(unlock2, rc);
        }
@@ -2255,16 +2239,15 @@ static int lfsck_namespace_repair_unmatched_pairs(const struct lu_env *env,
                GOTO(unlock, rc = 1);
 
        /* The old ".." name entry maybe not exist. */
-       dt_delete(env, obj, (const struct dt_key *)dotdot, th,
-                 BYPASS_CAPA);
+       dt_delete(env, obj, (const struct dt_key *)dotdot, th);
 
        rc = dt_insert(env, obj, (const struct dt_rec *)rec,
-                      (const struct dt_key *)dotdot, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)dotdot, th, 1);
        if (rc != 0)
                GOTO(unlock, rc);
 
        rc = dt_xattr_set(env, obj, &linkea_buf,
-                         XATTR_NAME_LINK, 0, th, BYPASS_CAPA);
+                         XATTR_NAME_LINK, 0, th);
 
        GOTO(unlock, rc = (rc == 0 ? 1 : rc));
 
@@ -2505,7 +2488,7 @@ lost_parent:
        }
 
        rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
-                      (const struct dt_key *)cname->ln_name, BYPASS_CAPA);
+                      (const struct dt_key *)cname->ln_name);
        if (rc == -ENOENT) {
                /* If the LFSCK is marked as LF_INCOMPLETE, then means some MDT
                 * has ever tried to verify some remote MDT-object that resides
@@ -2735,8 +2718,7 @@ again:
                }
 
                rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
-                              (const struct dt_key *)cname->ln_name,
-                              BYPASS_CAPA);
+                              (const struct dt_key *)cname->ln_name);
                *pfid2 = *lfsck_dto2fid(parent);
                if (rc == -ENOENT) {
                        lfsck_object_put(env, parent);
@@ -2956,15 +2938,14 @@ static int lfsck_namespace_repair_nlink(const struct lu_env *env,
        fid_cpu_to_be(tfid, cfid);
        idx = lfsck_sub_trace_file_fid2idx(cfid);
        rc = dt_lookup(env, com->lc_sub_trace_objs[idx].lsto_obj,
-                      (struct dt_rec *)&flags, (const struct dt_key *)tfid,
-                      BYPASS_CAPA);
+                      (struct dt_rec *)&flags, (const struct dt_key *)tfid);
        if (rc != 0)
                GOTO(unlock, rc);
 
        if (flags & LNTF_SKIP_NLINK)
                GOTO(unlock, rc = 0);
 
-       rc = dt_attr_get(env, obj, la, BYPASS_CAPA);
+       rc = dt_attr_get(env, obj, la);
        if (rc != 0)
                GOTO(unlock, rc = (rc == -ENOENT ? 0 : rc));
 
@@ -2980,7 +2961,7 @@ static int lfsck_namespace_repair_nlink(const struct lu_env *env,
        if (lfsck->li_bookmark_ram.lb_param & LPF_DRYRUN)
                GOTO(unlock, rc = 1);
 
-       rc = dt_attr_set(env, obj, la, th, BYPASS_CAPA);
+       rc = dt_attr_set(env, obj, la, th);
 
        GOTO(unlock, rc = (rc == 0 ? 1 : rc));
 
@@ -3110,7 +3091,7 @@ lock:
        }
 
        rc = dt_lookup(env, child, (struct dt_rec *)pfid,
-                      (const struct dt_key *)dotdot, BYPASS_CAPA);
+                      (const struct dt_key *)dotdot);
        if (rc != 0) {
                if (rc != -ENOENT && rc != -ENODATA && rc != -EINVAL) {
                        dt_read_unlock(env, child);
@@ -3427,8 +3408,7 @@ lost_parent:
                }
 
                rc = dt_lookup(env, parent, (struct dt_rec *)cfid,
-                              (const struct dt_key *)cname->ln_name,
-                              BYPASS_CAPA);
+                              (const struct dt_key *)cname->ln_name);
                if (rc != 0 && rc != -ENOENT) {
                        lfsck_object_put(env, parent);
 
@@ -3471,7 +3451,7 @@ lost_parent:
                        continue;
                }
 
-               rc = dt_attr_get(env, child, la, BYPASS_CAPA);
+               rc = dt_attr_get(env, child, la);
                if (rc != 0)
                        GOTO(out, rc);
 
@@ -3594,7 +3574,7 @@ out:
                        }
                }
        } else {
-               rc = dt_attr_get(env, child, la, BYPASS_CAPA);
+               rc = dt_attr_get(env, child, la);
                if (rc != 0)
                        return rc;
 
@@ -3727,7 +3707,7 @@ static int lfsck_namespace_check_for_double_scan(const struct lu_env *env,
        struct lu_attr *la = &lfsck_env_info(env)->lti_la;
        int             rc;
 
-       rc = dt_attr_get(env, obj, la, BYPASS_CAPA);
+       rc = dt_attr_get(env, obj, la);
        if (rc != 0)
                return rc;
 
@@ -4587,7 +4567,7 @@ static int lfsck_namespace_in_notify(const struct lu_env *env,
                fid_cpu_to_be(key, &lr->lr_fid);
                mutex_lock(&com->lc_sub_trace_objs[idx].lsto_mutex);
                rc = dt_lookup(env, obj, (struct dt_rec *)&flags,
-                              (const struct dt_key *)key, BYPASS_CAPA);
+                              (const struct dt_key *)key);
                if (rc == 0) {
                        if (flags & LNTF_SKIP_NLINK) {
                                mutex_unlock(
@@ -4604,13 +4584,13 @@ static int lfsck_namespace_in_notify(const struct lu_env *env,
                flags |= LNTF_SKIP_NLINK;
                if (exist) {
                        rc = dt_delete(env, obj, (const struct dt_key *)key,
-                                      th, BYPASS_CAPA);
+                                      th);
                        if (rc != 0)
                                GOTO(log, rc);
                }
 
                rc = dt_insert(env, obj, (const struct dt_rec *)&flags,
-                              (const struct dt_key *)key, th, BYPASS_CAPA, 1);
+                              (const struct dt_key *)key, th, 1);
 
                GOTO(log, rc);
 
@@ -4947,15 +4927,14 @@ int lfsck_namespace_repair_dangling(const struct lu_env *env,
                rec->rec_type = S_IFDIR;
                rec->rec_fid = lfsck_dto2fid(cobj);
                rc = dt_insert(env, cobj, (const struct dt_rec *)rec,
-                              (const struct dt_key *)dot, th, BYPASS_CAPA, 1);
+                              (const struct dt_key *)dot, th, 1);
                if (rc != 0)
                        GOTO(unlock, rc);
 
                /* 3b. insert dotdot into child dir */
                rec->rec_fid = lfsck_dto2fid(pobj);
                rc = dt_insert(env, cobj, (const struct dt_rec *)rec,
-                              (const struct dt_key *)dotdot, th,
-                              BYPASS_CAPA, 1);
+                              (const struct dt_key *)dotdot, th, 1);
                if (rc != 0)
                        GOTO(unlock, rc);
 
@@ -4967,7 +4946,7 @@ int lfsck_namespace_repair_dangling(const struct lu_env *env,
                /* 5b. generate slave LMV EA. */
                if (lnr->lnr_lmv != NULL && lnr->lnr_lmv->ll_lmv_master) {
                        rc = dt_xattr_set(env, cobj, &lmv_buf, XATTR_NAME_LMV,
-                                         0, th, BYPASS_CAPA);
+                                         0, th);
                        if (rc != 0)
                                GOTO(unlock, rc);
                }
@@ -4975,7 +4954,7 @@ int lfsck_namespace_repair_dangling(const struct lu_env *env,
 
        /* 6b. insert linkEA for child. */
        rc = dt_xattr_set(env, cobj, &linkea_buf,
-                         XATTR_NAME_LINK, 0, th, BYPASS_CAPA);
+                         XATTR_NAME_LINK, 0, th);
 
        GOTO(unlock, rc);
 
@@ -5288,8 +5267,7 @@ nodata:
                if (remove) {
                        LASSERT(newdata);
 
-                       rc = dt_xattr_del(env, obj, XATTR_NAME_LINK, handle,
-                                         BYPASS_CAPA);
+                       rc = dt_xattr_del(env, obj, XATTR_NAME_LINK, handle);
                        if (rc != 0)
                                GOTO(stop, rc);
                }
@@ -5397,7 +5375,7 @@ out:
                }
 
                if (count == 1 && S_ISREG(lfsck_object_type(obj)))
-                       dt_attr_get(env, obj, la, BYPASS_CAPA);
+                       dt_attr_get(env, obj, la);
        }
 
        down_write(&com->lc_sem);
@@ -5538,7 +5516,7 @@ static int lfsck_namespace_scan_local_lpf_one(const struct lu_env *env,
        obj = com->lc_sub_trace_objs[idx].lsto_obj;
        fid_cpu_to_be(key, &ent->lde_fid);
        rc = dt_lookup(env, obj, (struct dt_rec *)&flags,
-                      (const struct dt_key *)key, BYPASS_CAPA);
+                      (const struct dt_key *)key);
        if (rc == 0) {
                exist = true;
                flags |= LNTF_CHECK_ORPHAN;
@@ -5592,8 +5570,7 @@ static int lfsck_namespace_scan_local_lpf_one(const struct lu_env *env,
                GOTO(stop, rc);
 
        /* b1. remove name entry from backend /lost+found */
-       rc = dt_delete(env, parent, (const struct dt_key *)ent->lde_name, th,
-                      BYPASS_CAPA);
+       rc = dt_delete(env, parent, (const struct dt_key *)ent->lde_name, th);
        if (rc != 0)
                GOTO(stop, rc);
 
@@ -5608,20 +5585,19 @@ static int lfsck_namespace_scan_local_lpf_one(const struct lu_env *env,
 
        if (exist) {
                /* a3. remove child's FID from the LFSCK trace file. */
-               rc = dt_delete(env, obj, (const struct dt_key *)key, th,
-                              BYPASS_CAPA);
+               rc = dt_delete(env, obj, (const struct dt_key *)key, th);
                if (rc != 0)
                        GOTO(stop, rc);
        } else {
                /* b4. set child's ctime as 1 */
-               rc = dt_attr_set(env, child, la, th, BYPASS_CAPA);
+               rc = dt_attr_set(env, child, la, th);
                if (rc != 0)
                        GOTO(stop, rc);
        }
 
        /* b5. insert child's FID into the LFSCK trace file. */
        rc = dt_insert(env, obj, (const struct dt_rec *)&flags,
-                      (const struct dt_key *)key, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)key, th, 1);
 
        GOTO(stop, rc = (rc == 0 ? 1 : rc));
 
@@ -5690,7 +5666,7 @@ static void lfsck_namespace_scan_local_lpf(const struct lu_env *env,
 
        com->lc_new_scanned = 0;
        iops = &parent->do_index_ops->dio_it;
-       di = iops->init(env, parent, LUDA_64BITHASH | LUDA_TYPE, BYPASS_CAPA);
+       di = iops->init(env, parent, LUDA_64BITHASH | LUDA_TYPE);
        if (IS_ERR(di))
                GOTO(out, rc = PTR_ERR(di));
 
@@ -5927,7 +5903,7 @@ lfsck_namespace_double_scan_one_trace_file(const struct lu_env *env,
        __u8                     flags  = 0;
        ENTRY;
 
-       di = iops->init(env, obj, 0, BYPASS_CAPA);
+       di = iops->init(env, obj, 0);
        if (IS_ERR(di))
                RETURN(PTR_ERR(di));
 
@@ -6314,7 +6290,7 @@ int lfsck_verify_linkea(const struct lu_env *env, struct dt_object *obj,
 
        dt_write_lock(env, obj, 0);
        rc = dt_xattr_set(env, obj, &linkea_buf,
-                         XATTR_NAME_LINK, fl, th, BYPASS_CAPA);
+                         XATTR_NAME_LINK, fl, th);
        dt_write_unlock(env, obj);
 
        GOTO(stop, rc);
@@ -6416,8 +6392,7 @@ int lfsck_update_name_entry(const struct lu_env *env,
        if (rc != 0)
                GOTO(stop, rc);
 
-       rc = dt_delete(env, dir, (const struct dt_key *)name, th,
-                      BYPASS_CAPA);
+       rc = dt_delete(env, dir, (const struct dt_key *)name, th);
        if (rc == -ENOENT) {
                exists = false;
                rc = 0;
@@ -6427,7 +6402,7 @@ int lfsck_update_name_entry(const struct lu_env *env,
                GOTO(stop, rc);
 
        rc = dt_insert(env, dir, (const struct dt_rec *)rec,
-                      (const struct dt_key *)name, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)name, th, 1);
        if (rc == 0 && S_ISDIR(type) && !exists) {
                dt_write_lock(env, dir, 0);
                rc = dt_ref_add(env, dir, th);
index 3509629..ba31128 100644 (file)
@@ -238,16 +238,16 @@ static int lfsck_disable_master_lmv(const struct lu_env *env,
                GOTO(unlock, rc = 0);
 
        if (del_lmv) {
-               rc = dt_xattr_del(env, obj, XATTR_NAME_LMV, th, BYPASS_CAPA);
+               rc = dt_xattr_del(env, obj, XATTR_NAME_LMV, th);
                if (rc != 0)
                        GOTO(unlock, rc);
        }
 
-       rc = dt_attr_get(env, obj, la, BYPASS_CAPA);
+       rc = dt_attr_get(env, obj, la);
        if (rc == 0 && !(la->la_flags & LUSTRE_IMMUTABLE_FL)) {
                la->la_valid = LA_FLAGS;
                la->la_flags |= LUSTRE_IMMUTABLE_FL;
-               rc = dt_attr_set(env, obj, la, th, BYPASS_CAPA);
+               rc = dt_attr_set(env, obj, la, th);
        }
 
        GOTO(unlock, rc);
@@ -845,7 +845,7 @@ int lfsck_read_stripe_lmv(const struct lu_env *env, struct dt_object *obj,
 
        dt_read_lock(env, obj, 0);
        rc = dt_xattr_get(env, obj, lfsck_buf_get(env, lmv, sizeof(*lmv)),
-                         XATTR_NAME_LMV, BYPASS_CAPA);
+                         XATTR_NAME_LMV);
        dt_read_unlock(env, obj);
        if (rc != sizeof(*lmv))
                return rc > 0 ? -EINVAL : rc;
@@ -1043,7 +1043,7 @@ int lfsck_namespace_update_lmv(const struct lu_env *env,
        if (lfsck->li_bookmark_ram.lb_param & LPF_DRYRUN)
                GOTO(unlock, rc = 0);
 
-       rc = dt_xattr_set(env, obj, buf, XATTR_NAME_LMV, 0, th, BYPASS_CAPA);
+       rc = dt_xattr_set(env, obj, buf, XATTR_NAME_LMV, 0, th);
 
        GOTO(unlock, rc);
 
@@ -1112,7 +1112,7 @@ static int lfsck_allow_regenerate_master_lmv(const struct lu_env *env,
        snprintf(info->lti_tmpbuf, sizeof(info->lti_tmpbuf), DFID":%u",
                 PFID(cfid), cidx);
        rc = dt_lookup(env, obj, (struct dt_rec *)tfid,
-                      (const struct dt_key *)info->lti_tmpbuf, BYPASS_CAPA);
+                      (const struct dt_key *)info->lti_tmpbuf);
        if (rc != 0)
                RETURN(rc);
 
@@ -1121,7 +1121,7 @@ static int lfsck_allow_regenerate_master_lmv(const struct lu_env *env,
 
        args = lfsck->li_args_dir & ~(LUDA_VERIFY | LUDA_VERIFY_DRYRUN);
        iops = &obj->do_index_ops->dio_it;
-       di = iops->init(env, obj, args, BYPASS_CAPA);
+       di = iops->init(env, obj, args);
        if (IS_ERR(di))
                RETURN(PTR_ERR(di));
 
@@ -1485,7 +1485,7 @@ int lfsck_namespace_repair_bad_name_hash(const struct lu_env *env,
        ENTRY;
 
        rc = dt_lookup(env, shard, (struct dt_rec *)pfid,
-                      (const struct dt_key *)dotdot, BYPASS_CAPA);
+                      (const struct dt_key *)dotdot);
        if (rc != 0 || !fid_is_sane(pfid))
                GOTO(log, rc);
 
@@ -1578,7 +1578,7 @@ int lfsck_namespace_scan_shard(const struct lu_env *env,
 
        args = lfsck->li_args_dir & ~(LUDA_VERIFY | LUDA_VERIFY_DRYRUN);
        iops = &child->do_index_ops->dio_it;
-       di = iops->init(env, child, args, BYPASS_CAPA);
+       di = iops->init(env, child, args);
        if (IS_ERR(di))
                GOTO(out, rc = PTR_ERR(di));
 
@@ -1688,7 +1688,7 @@ int lfsck_namespace_verify_stripe_slave(const struct lu_env *env,
        }
 
        rc = dt_lookup(env, obj, (struct dt_rec *)pfid,
-                      (const struct dt_key *)dotdot, BYPASS_CAPA);
+                      (const struct dt_key *)dotdot);
        if (rc != 0 || !fid_is_sane(pfid)) {
                rc = lfsck_namespace_trace_update(env, com, cfid,
                                        LNTF_UNCERTAIN_LMV, true);
@@ -1764,7 +1764,7 @@ int lfsck_namespace_verify_stripe_slave(const struct lu_env *env,
        }
 
        rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
-                      (const struct dt_key *)name2, BYPASS_CAPA);
+                      (const struct dt_key *)name2);
        if (rc != 0 || !lu_fid_eq(cfid, &tfid))
                rc = lfsck_namespace_trace_update(env, com, cfid,
                                                  LNTF_UNCERTAIN_LMV, true);
index e9cf6ce..14e76df 100644 (file)
@@ -683,17 +683,6 @@ static int lod_commit_async(const struct lu_env *env, struct dt_device *dev)
        return dt_commit_async(env, dt2lod_dev(dev)->lod_child);
 }
 
-/**
- * Not used
- */
-static int lod_init_capa_ctxt(const struct lu_env *env, struct dt_device *dev,
-                             int mode, unsigned long timeout,
-                             __u32 alg, struct lustre_capa_key *keys)
-{
-       struct dt_device *next = dt2lod_dev(dev)->lod_child;
-       return dt_init_capa_ctxt(env, next, mode, timeout, alg, keys);
-}
-
 static const struct dt_device_operations lod_dt_ops = {
        .dt_root_get         = lod_root_get,
        .dt_statfs           = lod_statfs,
@@ -704,7 +693,6 @@ static const struct dt_device_operations lod_dt_ops = {
        .dt_sync             = lod_sync,
        .dt_ro               = lod_ro,
        .dt_commit_async     = lod_commit_async,
-       .dt_init_capa_ctxt   = lod_init_capa_ctxt,
 };
 
 /**
index c1fcdb8..f9bc8ae 100644 (file)
@@ -253,7 +253,6 @@ int lod_add_device(const struct lu_env *env, struct lod_device *lod,
                                           OBD_CONNECT_LRU_RESIZE |
 #endif
                                           OBD_CONNECT_MDS |
-                                          OBD_CONNECT_OSS_CAPA |
                                           OBD_CONNECT_REQPORTAL |
                                           OBD_CONNECT_SKIP_ORPHAN |
                                           OBD_CONNECT_FID |
@@ -270,8 +269,6 @@ int lod_add_device(const struct lu_env *env, struct lod_device *lod,
                for_ost = false;
                data->ocd_ibits_known = MDS_INODELOCK_UPDATE;
                data->ocd_connect_flags |= OBD_CONNECT_ACL |
-                                          OBD_CONNECT_MDS_CAPA |
-                                          OBD_CONNECT_OSS_CAPA |
                                           OBD_CONNECT_IBITS |
                                           OBD_CONNECT_MDS_MDS |
                                           OBD_CONNECT_FID |
@@ -671,7 +668,7 @@ int lod_generate_and_set_lovea(const struct lu_env *env,
        info->lti_buf.lb_buf = lmm;
        info->lti_buf.lb_len = lmm_size;
        rc = dt_xattr_set(env, next, &info->lti_buf, XATTR_NAME_LOV, 0,
-                         th, BYPASS_CAPA);
+                         th);
        if (rc < 0)
                lod_object_free_striping(env, lo);
 
@@ -709,7 +706,7 @@ int lod_get_ea(const struct lu_env *env, struct lod_object *lo,
 repeat:
                info->lti_buf.lb_buf = info->lti_ea_store;
                info->lti_buf.lb_len = info->lti_ea_store_size;
-               rc = dt_xattr_get(env, next, &info->lti_buf, name, BYPASS_CAPA);
+               rc = dt_xattr_get(env, next, &info->lti_buf, name);
        }
 
        /* if object is not striped or inaccessible */
@@ -718,8 +715,7 @@ repeat:
 
        if (rc == -ERANGE) {
                /* EA doesn't fit, reallocate new buffer */
-               rc = dt_xattr_get(env, next, &LU_BUF_NULL, name,
-                                 BYPASS_CAPA);
+               rc = dt_xattr_get(env, next, &LU_BUF_NULL, name);
                if (rc == -ENODATA || rc == -ENOENT)
                        RETURN(0);
                else if (rc < 0)
index 791466c..acec6fb 100644 (file)
@@ -68,11 +68,10 @@ static const struct dt_body_operations lod_body_lnk_ops;
  * \see dt_index_operations::dio_lookup() in the API description for details.
  */
 static int lod_index_lookup(const struct lu_env *env, struct dt_object *dt,
-                           struct dt_rec *rec, const struct dt_key *key,
-                           struct lustre_capa *capa)
+                           struct dt_rec *rec, const struct dt_key *key)
 {
        struct dt_object *next = dt_object_child(dt);
-       return next->do_index_ops->dio_lookup(env, next, rec, key, capa);
+       return next->do_index_ops->dio_lookup(env, next, rec, key);
 }
 
 /**
@@ -104,10 +103,9 @@ static int lod_index_insert(const struct lu_env *env,
                            const struct dt_rec *rec,
                            const struct dt_key *key,
                            struct thandle *th,
-                           struct lustre_capa *capa,
                            int ign)
 {
-       return dt_insert(env, dt_object_child(dt), rec, key, th, capa, ign);
+       return dt_insert(env, dt_object_child(dt), rec, key, th, ign);
 }
 
 /**
@@ -136,10 +134,9 @@ static int lod_declare_index_delete(const struct lu_env *env,
 static int lod_index_delete(const struct lu_env *env,
                            struct dt_object *dt,
                            const struct dt_key *key,
-                           struct thandle *th,
-                           struct lustre_capa *capa)
+                           struct thandle *th)
 {
-       return dt_delete(env, dt_object_child(dt), key, th, capa);
+       return dt_delete(env, dt_object_child(dt), key, th);
 }
 
 /**
@@ -150,15 +147,14 @@ static int lod_index_delete(const struct lu_env *env,
  * \see dt_it_ops::init() in the API description for details.
  */
 static struct dt_it *lod_it_init(const struct lu_env *env,
-                                struct dt_object *dt, __u32 attr,
-                                struct lustre_capa *capa)
+                                struct dt_object *dt, __u32 attr)
 {
        struct dt_object        *next = dt_object_child(dt);
        struct lod_it           *it = &lod_env_info(env)->lti_it;
        struct dt_it            *it_next;
 
 
-       it_next = next->do_index_ops->dio_it.init(env, next, attr, capa);
+       it_next = next->do_index_ops->dio_it.init(env, next, attr);
        if (IS_ERR(it_next))
                return it_next;
 
@@ -389,8 +385,7 @@ static struct dt_index_operations lod_index_ops = {
  * \see dt_it_ops::init() in the API description for details.
  */
 static struct dt_it *lod_striped_it_init(const struct lu_env *env,
-                                        struct dt_object *dt, __u32 attr,
-                                        struct lustre_capa *capa)
+                                        struct dt_object *dt, __u32 attr)
 {
        struct lod_object       *lo = lod_dt_obj(dt);
        struct dt_object        *next;
@@ -403,7 +398,7 @@ static struct dt_it *lod_striped_it_init(const struct lu_env *env,
        LASSERT(next != NULL);
        LASSERT(next->do_index_ops != NULL);
 
-       it_next = next->do_index_ops->dio_it.init(env, next, attr, capa);
+       it_next = next->do_index_ops->dio_it.init(env, next, attr);
        if (IS_ERR(it_next))
                return it_next;
 
@@ -574,8 +569,7 @@ again:
        LASSERT(next != NULL);
        LASSERT(next->do_index_ops != NULL);
 
-       it_next = next->do_index_ops->dio_it.init(env, next, it->lit_attr,
-                                                 BYPASS_CAPA);
+       it_next = next->do_index_ops->dio_it.init(env, next, it->lit_attr);
        if (!IS_ERR(it_next)) {
                it->lit_it = it_next;
                goto again;
@@ -825,7 +819,7 @@ int lod_load_lmv_shards(const struct lu_env *env, struct lod_object *lo,
 
        memset(&lmv1->lmv_stripe_fids[0], 0, stripes * sizeof(struct lu_fid));
        iops = &obj->do_index_ops->dio_it;
-       it = iops->init(env, obj, LUDA_64BITHASH, BYPASS_CAPA);
+       it = iops->init(env, obj, LUDA_64BITHASH);
        if (IS_ERR(it))
                RETURN(PTR_ERR(it));
 
@@ -1052,14 +1046,13 @@ static int lod_object_write_locked(const struct lu_env *env,
  */
 static int lod_attr_get(const struct lu_env *env,
                        struct dt_object *dt,
-                       struct lu_attr *attr,
-                       struct lustre_capa *capa)
+                       struct lu_attr *attr)
 {
        /* Note: for striped directory, client will merge attributes
         * from all of the sub-stripes see lmv_merge_attr(), and there
         * no MDD logic depend on directory nlink/size/time, so we can
         * always use master inode nlink and size for now. */
-       return dt_attr_get(env, dt_object_child(dt), attr, capa);
+       return dt_attr_get(env, dt_object_child(dt), attr);
 }
 
 /**
@@ -1124,7 +1117,7 @@ static int lod_mark_dead_object(const struct lu_env *env,
                } else {
                        rc = dt_xattr_set(env, lo->ldo_stripe[i], &buf,
                                          XATTR_NAME_LMV, LU_XATTR_REPLACE,
-                                         handle, BYPASS_CAPA);
+                                         handle);
                }
                if (rc != 0)
                        break;
@@ -1241,8 +1234,7 @@ static int lod_declare_attr_set(const struct lu_env *env,
 static int lod_attr_set(const struct lu_env *env,
                        struct dt_object *dt,
                        const struct lu_attr *attr,
-                       struct thandle *handle,
-                       struct lustre_capa *capa)
+                       struct thandle *handle)
 {
        struct dt_object        *next = dt_object_child(dt);
        struct lod_object       *lo = lod_dt_obj(dt);
@@ -1259,7 +1251,7 @@ static int lod_attr_set(const struct lu_env *env,
        /*
         * apply changes to the local object
         */
-       rc = dt_attr_set(env, next, attr, handle, capa);
+       rc = dt_attr_set(env, next, attr, handle);
        if (rc)
                RETURN(rc);
 
@@ -1289,7 +1281,7 @@ static int lod_attr_set(const struct lu_env *env,
                    (dt_object_exists(lo->ldo_stripe[i]) == 0))
                        continue;
 
-               rc = dt_attr_set(env, lo->ldo_stripe[i], attr, handle, capa);
+               rc = dt_attr_set(env, lo->ldo_stripe[i], attr, handle);
                if (rc != 0) {
                        CERROR("failed declaration: %d\n", rc);
                        break;
@@ -1299,7 +1291,7 @@ static int lod_attr_set(const struct lu_env *env,
        if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_STRIPE) &&
            dt_object_exists(next) != 0 &&
            dt_object_remote(next) == 0)
-               dt_xattr_del(env, next, XATTR_NAME_LOV, handle, BYPASS_CAPA);
+               dt_xattr_del(env, next, XATTR_NAME_LOV, handle);
 
        if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_CHANGE_STRIPE) &&
            dt_object_exists(next) &&
@@ -1331,7 +1323,7 @@ static int lod_attr_set(const struct lu_env *env,
                fid_to_ostid(fid, oi);
                ostid_cpu_to_le(oi, &objs->l_ost_oi);
                dt_xattr_set(env, next, buf, XATTR_NAME_LOV,
-                            LU_XATTR_REPLACE, handle, BYPASS_CAPA);
+                            LU_XATTR_REPLACE, handle);
        }
 
        RETURN(rc);
@@ -1346,15 +1338,14 @@ static int lod_attr_set(const struct lu_env *env,
  * \see dt_object_operations::do_xattr_get() in the API description for details.
  */
 static int lod_xattr_get(const struct lu_env *env, struct dt_object *dt,
-                        struct lu_buf *buf, const char *name,
-                        struct lustre_capa *capa)
+                        struct lu_buf *buf, const char *name)
 {
        struct lod_thread_info  *info = lod_env_info(env);
        struct lod_device       *dev = lu2lod_dev(dt->do_lu.lo_dev);
        int                      rc, is_root;
        ENTRY;
 
-       rc = dt_xattr_get(env, dt_object_child(dt), buf, name, capa);
+       rc = dt_xattr_get(env, dt_object_child(dt), buf, name);
        if (strcmp(name, XATTR_NAME_LMV) == 0) {
                struct lmv_mds_md_v1    *lmv1;
                int                      rc1 = 0;
@@ -1371,7 +1362,7 @@ static int lod_xattr_get(const struct lu_env *env, struct dt_object *dt,
                        info->lti_buf.lb_buf = info->lti_key;
                        info->lti_buf.lb_len = sizeof(*lmv1);
                        rc = dt_xattr_get(env, dt_object_child(dt),
-                                         &info->lti_buf, name, capa);
+                                         &info->lti_buf, name);
                        if (unlikely(rc != sizeof(*lmv1)))
                                RETURN(rc = rc > 0 ? -EINVAL : rc);
 
@@ -2099,7 +2090,7 @@ static int lod_declare_xattr_set(const struct lu_env *env,
                 * this is a request to manipulate object's striping
                 */
                if (dt_object_exists(dt)) {
-                       rc = dt_attr_get(env, next, attr, BYPASS_CAPA);
+                       rc = dt_attr_get(env, next, attr);
                        if (rc)
                                RETURN(rc);
                } else {
@@ -2144,7 +2135,6 @@ static void lod_lov_stripe_cache_clear(struct lod_object *lo)
  * \param[in] name     name of xattr
  * \param[in] fl       flags
  * \param[in] th       transaction handle
- * \param[in] capa     not used currently
  *
  * \retval             0 on success
  * \retval             negative if failed
@@ -2152,8 +2142,7 @@ static void lod_lov_stripe_cache_clear(struct lod_object *lo)
 static int lod_xattr_set_internal(const struct lu_env *env,
                                  struct dt_object *dt,
                                  const struct lu_buf *buf,
-                                 const char *name, int fl, struct thandle *th,
-                                 struct lustre_capa *capa)
+                                 const char *name, int fl, struct thandle *th)
 {
        struct dt_object        *next = dt_object_child(dt);
        struct lod_object       *lo = lod_dt_obj(dt);
@@ -2161,7 +2150,7 @@ static int lod_xattr_set_internal(const struct lu_env *env,
        int                     i;
        ENTRY;
 
-       rc = dt_xattr_set(env, next, buf, name, fl, th, capa);
+       rc = dt_xattr_set(env, next, buf, name, fl, th);
        if (rc != 0 || !S_ISDIR(dt->do_lu.lo_header->loh_attr))
                RETURN(rc);
 
@@ -2174,8 +2163,7 @@ static int lod_xattr_set_internal(const struct lu_env *env,
 
        for (i = 0; i < lo->ldo_stripenr; i++) {
                LASSERT(lo->ldo_stripe[i]);
-               rc = dt_xattr_set(env, lo->ldo_stripe[i], buf, name, fl, th,
-                                 capa);
+               rc = dt_xattr_set(env, lo->ldo_stripe[i], buf, name, fl, th);
                if (rc != 0)
                        break;
        }
@@ -2192,15 +2180,13 @@ static int lod_xattr_set_internal(const struct lu_env *env,
  * \param[in] dt       object
  * \param[in] name     name of xattr
  * \param[in] th       transaction handle
- * \param[in] capa     not used currently
  *
  * \retval             0 on success
  * \retval             negative if failed
  */
 static int lod_xattr_del_internal(const struct lu_env *env,
                                  struct dt_object *dt,
-                                 const char *name, struct thandle *th,
-                                 struct lustre_capa *capa)
+                                 const char *name, struct thandle *th)
 {
        struct dt_object        *next = dt_object_child(dt);
        struct lod_object       *lo = lod_dt_obj(dt);
@@ -2208,7 +2194,7 @@ static int lod_xattr_del_internal(const struct lu_env *env,
        int                     i;
        ENTRY;
 
-       rc = dt_xattr_del(env, next, name, th, capa);
+       rc = dt_xattr_del(env, next, name, th);
        if (rc != 0 || !S_ISDIR(dt->do_lu.lo_header->loh_attr))
                RETURN(rc);
 
@@ -2217,8 +2203,7 @@ static int lod_xattr_del_internal(const struct lu_env *env,
 
        for (i = 0; i < lo->ldo_stripenr; i++) {
                LASSERT(lo->ldo_stripe[i]);
-               rc = dt_xattr_del(env, lo->ldo_stripe[i], name, th,
-                                 capa);
+               rc = dt_xattr_del(env, lo->ldo_stripe[i], name, th);
                if (rc != 0)
                        break;
        }
@@ -2240,7 +2225,6 @@ static int lod_xattr_del_internal(const struct lu_env *env,
  * \param[in] name     name of EA
  * \param[in] fl       xattr flag (see OSD API description)
  * \param[in] th       transaction handle
- * \param[in] capa     not used
  *
  * \retval             0 on success
  * \retval             negative if failed
@@ -2249,8 +2233,7 @@ static int lod_xattr_set_lov_on_dir(const struct lu_env *env,
                                    struct dt_object *dt,
                                    const struct lu_buf *buf,
                                    const char *name, int fl,
-                                   struct thandle *th,
-                                   struct lustre_capa *capa)
+                                   struct thandle *th)
 {
        struct lod_device       *d = lu2lod_dev(dt->do_lu.lo_dev);
        struct lod_object       *l = lod_dt_obj(dt);
@@ -2290,11 +2273,11 @@ static int lod_xattr_set_lov_on_dir(const struct lu_env *env,
 
        if (LOVEA_DELETE_VALUES(lum->lmm_stripe_size, lum->lmm_stripe_count,
                                lum->lmm_stripe_offset, pool_name)) {
-               rc = lod_xattr_del_internal(env, dt, name, th, capa);
+               rc = lod_xattr_del_internal(env, dt, name, th);
                if (rc == -ENODATA)
                        rc = 0;
        } else {
-               rc = lod_xattr_set_internal(env, dt, buf, name, fl, th, capa);
+               rc = lod_xattr_set_internal(env, dt, buf, name, fl, th);
        }
 
        RETURN(rc);
@@ -2314,7 +2297,6 @@ static int lod_xattr_set_lov_on_dir(const struct lu_env *env,
  * \param[in] name     name of EA
  * \param[in] fl       xattr flag (see OSD API description)
  * \param[in] th       transaction handle
- * \param[in] capa     not used
  *
  * \retval             0 on success
  * \retval             negative if failed
@@ -2323,8 +2305,7 @@ static int lod_xattr_set_default_lmv_on_dir(const struct lu_env *env,
                                            struct dt_object *dt,
                                            const struct lu_buf *buf,
                                            const char *name, int fl,
-                                           struct thandle *th,
-                                           struct lustre_capa *capa)
+                                           struct thandle *th)
 {
        struct lod_object       *l = lod_dt_obj(dt);
        struct lmv_user_md_v1   *lum;
@@ -2341,11 +2322,11 @@ static int lod_xattr_set_default_lmv_on_dir(const struct lu_env *env,
        if (LMVEA_DELETE_VALUES((le32_to_cpu(lum->lum_stripe_count)),
                                 le32_to_cpu(lum->lum_stripe_offset)) &&
                                le32_to_cpu(lum->lum_magic) == LMV_USER_MAGIC) {
-               rc = lod_xattr_del_internal(env, dt, name, th, capa);
+               rc = lod_xattr_del_internal(env, dt, name, th);
                if (rc == -ENODATA)
                        rc = 0;
        } else {
-               rc = lod_xattr_set_internal(env, dt, buf, name, fl, th, capa);
+               rc = lod_xattr_set_internal(env, dt, buf, name, fl, th);
                if (rc != 0)
                        RETURN(rc);
        }
@@ -2376,15 +2357,13 @@ static int lod_xattr_set_default_lmv_on_dir(const struct lu_env *env,
  * \param[in] name     not used currently
  * \param[in] fl       xattr flag (see OSD API description)
  * \param[in] th       transaction handle
- * \param[in] capa     not used
  *
  * \retval             0 on success
  * \retval             negative if failed
  */
 static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt,
                             const struct lu_buf *buf, const char *name,
-                            int fl, struct thandle *th,
-                            struct lustre_capa *capa)
+                            int fl, struct thandle *th)
 {
        struct lod_object       *lo = lod_dt_obj(dt);
        struct lod_thread_info  *info = lod_env_info(env);
@@ -2407,7 +2386,7 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt,
        if (lo->ldo_stripenr == 0)
                RETURN(0);
 
-       rc = dt_attr_get(env, dt_object_child(dt), attr, BYPASS_CAPA);
+       rc = dt_attr_get(env, dt_object_child(dt), attr);
        if (rc != 0)
                RETURN(rc);
 
@@ -2451,13 +2430,13 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt,
 
                rec->rec_fid = lu_object_fid(&dto->do_lu);
                rc = dt_insert(env, dto, (const struct dt_rec *)rec,
-                              (const struct dt_key *)dot, th, capa, 0);
+                              (const struct dt_key *)dot, th, 0);
                if (rc != 0)
                        RETURN(rc);
 
                rec->rec_fid = lu_object_fid(&dt->do_lu);
                rc = dt_insert(env, dto, (struct dt_rec *)rec,
-                              (const struct dt_key *)dotdot, th, capa, 0);
+                              (const struct dt_key *)dotdot, th, 0);
                if (rc != 0)
                        RETURN(rc);
 
@@ -2490,7 +2469,7 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt,
                        info->lti_buf.lb_buf = v3;
                        info->lti_buf.lb_len = sizeof(*v3);
                        rc = dt_xattr_set(env, dto, &info->lti_buf,
-                                         XATTR_NAME_LOV, 0, th, capa);
+                                         XATTR_NAME_LOV, 0, th);
                        OBD_FREE_PTR(v3);
                        if (rc != 0)
                                GOTO(out, rc);
@@ -2506,7 +2485,7 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt,
                                slave_lmm->lmv_master_mdt_index =
                                                        cpu_to_le32(i);
                        rc = dt_xattr_set(env, dto, &slave_lmv_buf,
-                                         XATTR_NAME_LMV, fl, th, capa);
+                                         XATTR_NAME_LMV, fl, th);
                        if (rc != 0)
                                GOTO(out, rc);
                }
@@ -2531,14 +2510,14 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt,
                linkea_buf.lb_buf = ldata.ld_buf->lb_buf;
                linkea_buf.lb_len = ldata.ld_leh->leh_len;
                rc = dt_xattr_set(env, dto, &linkea_buf, XATTR_NAME_LINK,
-                                 0, th, BYPASS_CAPA);
+                                 0, th);
                if (rc != 0)
                        GOTO(out, rc);
 
                rec->rec_fid = lu_object_fid(&dto->do_lu);
                rc = dt_insert(env, dt_object_child(dt),
                               (const struct dt_rec *)rec,
-                              (const struct dt_key *)stripe_name, th, capa, 0);
+                              (const struct dt_key *)stripe_name, th, 0);
                if (rc != 0)
                        GOTO(out, rc);
 
@@ -2549,7 +2528,7 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt,
 
        if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MASTER_LMV))
                rc = dt_xattr_set(env, dt_object_child(dt), &lmv_buf,
-                                 XATTR_NAME_LMV, fl, th, capa);
+                                 XATTR_NAME_LMV, fl, th);
 
 out:
        if (slave_lmm != NULL)
@@ -2618,8 +2597,7 @@ static int lod_dir_striping_create_internal(const struct lu_env *env,
                                                       &info->lti_buf, dof, th);
                else
                        rc = lod_xattr_set_lmv(env, dt, &info->lti_buf,
-                                              XATTR_NAME_LMV, 0, th,
-                                              BYPASS_CAPA);
+                                              XATTR_NAME_LMV, 0, th);
                if (rc != 0)
                        RETURN(rc);
        }
@@ -2656,7 +2634,7 @@ static int lod_dir_striping_create_internal(const struct lu_env *env,
                        rc = lod_xattr_set_default_lmv_on_dir(env, dt,
                                                  &info->lti_buf,
                                                  XATTR_NAME_DEFAULT_LMV, 0,
-                                                 th, BYPASS_CAPA);
+                                                 th);
                if (rc != 0)
                        RETURN(rc);
        }
@@ -2693,8 +2671,7 @@ static int lod_dir_striping_create_internal(const struct lu_env *env,
                                                       XATTR_NAME_LOV, 0, th);
                else
                        rc = lod_xattr_set_lov_on_dir(env, dt, &info->lti_buf,
-                                                     XATTR_NAME_LOV, 0, th,
-                                                     BYPASS_CAPA);
+                                                     XATTR_NAME_LOV, 0, th);
                if (rc != 0)
                        RETURN(rc);
        }
@@ -2747,8 +2724,7 @@ static int lod_dir_striping_create(const struct lu_env *env,
  */
 static int lod_xattr_set(const struct lu_env *env,
                         struct dt_object *dt, const struct lu_buf *buf,
-                        const char *name, int fl, struct thandle *th,
-                        struct lustre_capa *capa)
+                        const char *name, int fl, struct thandle *th)
 {
        struct dt_object        *next = dt_object_child(dt);
        int                      rc;
@@ -2760,7 +2736,7 @@ static int lod_xattr_set(const struct lu_env *env,
 
                if (lmm != NULL && le32_to_cpu(lmm->lmv_hash_type) &
                                                LMV_HASH_FLAG_MIGRATION)
-                       rc = dt_xattr_set(env, next, buf, name, fl, th, capa);
+                       rc = dt_xattr_set(env, next, buf, name, fl, th);
                else
                        rc = lod_dir_striping_create(env, dt, NULL, NULL, th);
 
@@ -2770,13 +2746,13 @@ static int lod_xattr_set(const struct lu_env *env,
        if (S_ISDIR(dt->do_lu.lo_header->loh_attr) &&
            strcmp(name, XATTR_NAME_LOV) == 0) {
                /* default LOVEA */
-               rc = lod_xattr_set_lov_on_dir(env, dt, buf, name, fl, th, capa);
+               rc = lod_xattr_set_lov_on_dir(env, dt, buf, name, fl, th);
                RETURN(rc);
        } else if (S_ISDIR(dt->do_lu.lo_header->loh_attr) &&
                   strcmp(name, XATTR_NAME_DEFAULT_LMV) == 0) {
                /* default LMVEA */
                rc = lod_xattr_set_default_lmv_on_dir(env, dt, buf, name, fl,
-                                                     th, capa);
+                                                     th);
                RETURN(rc);
        } else if (S_ISREG(dt->do_lu.lo_header->loh_attr) &&
                   !strcmp(name, XATTR_NAME_LOV)) {
@@ -2788,7 +2764,7 @@ static int lod_xattr_set(const struct lu_env *env,
                if (fl & LU_XATTR_REPLACE) {
                        /* free stripes, then update disk */
                        lod_object_free_striping(env, lod_dt_obj(dt));
-                       rc = dt_xattr_set(env, next, buf, name, fl, th, capa);
+                       rc = dt_xattr_set(env, next, buf, name, fl, th);
                } else {
                        rc = lod_striping_create(env, dt, NULL, NULL, th);
                }
@@ -2796,7 +2772,7 @@ static int lod_xattr_set(const struct lu_env *env,
        }
 
        /* then all other xattr */
-       rc = lod_xattr_set_internal(env, dt, buf, name, fl, th, capa);
+       rc = lod_xattr_set_internal(env, dt, buf, name, fl, th);
 
        RETURN(rc);
 }
@@ -2850,8 +2826,7 @@ static int lod_declare_xattr_del(const struct lu_env *env,
  * \see dt_object_operations::do_xattr_del() in the API description for details.
  */
 static int lod_xattr_del(const struct lu_env *env, struct dt_object *dt,
-                        const char *name, struct thandle *th,
-                        struct lustre_capa *capa)
+                        const char *name, struct thandle *th)
 {
        struct dt_object        *next = dt_object_child(dt);
        struct lod_object       *lo = lod_dt_obj(dt);
@@ -2862,7 +2837,7 @@ static int lod_xattr_del(const struct lu_env *env, struct dt_object *dt,
        if (!strcmp(name, XATTR_NAME_LOV))
                lod_object_free_striping(env, lod_dt_obj(dt));
 
-       rc = dt_xattr_del(env, next, name, th, capa);
+       rc = dt_xattr_del(env, next, name, th);
        if (rc != 0 || !S_ISDIR(dt->do_lu.lo_header->loh_attr))
                RETURN(rc);
 
@@ -2871,7 +2846,7 @@ static int lod_xattr_del(const struct lu_env *env, struct dt_object *dt,
 
        for (i = 0; i < lo->ldo_stripenr; i++) {
                LASSERT(lo->ldo_stripe[i]);
-               rc = dt_xattr_del(env, lo->ldo_stripe[i], name, th, capa);
+               rc = dt_xattr_del(env, lo->ldo_stripe[i], name, th);
                if (rc != 0)
                        break;
        }
@@ -2886,10 +2861,9 @@ static int lod_xattr_del(const struct lu_env *env, struct dt_object *dt,
  * for details.
  */
 static int lod_xattr_list(const struct lu_env *env,
-                         struct dt_object *dt, const struct lu_buf *buf,
-                         struct lustre_capa *capa)
+                         struct dt_object *dt, const struct lu_buf *buf)
 {
-       return dt_xattr_list(env, dt_object_child(dt), buf, capa);
+       return dt_xattr_list(env, dt_object_child(dt), buf);
 }
 
 /**
@@ -3325,7 +3299,7 @@ static int lod_declare_init_size(const struct lu_env *env,
        LASSERT(lo->ldo_stripe || lo->ldo_stripenr == 0);
        LASSERT(lo->ldo_stripe_size > 0);
 
-       rc = dt_attr_get(env, next, attr, BYPASS_CAPA);
+       rc = dt_attr_get(env, next, attr);
        LASSERT(attr->la_valid & LA_SIZE);
        if (rc)
                RETURN(rc);
@@ -3706,8 +3680,7 @@ static int lod_object_destroy(const struct lu_env *env,
                               PFID(lu_object_fid(&lo->ldo_stripe[i]->do_lu)));
 
                        rc = dt_delete(env, next,
-                                      (const struct dt_key *)stripe_name,
-                                      th, BYPASS_CAPA);
+                                      (const struct dt_key *)stripe_name, th);
                        if (rc != 0)
                                RETURN(rc);
                }
@@ -3789,18 +3762,6 @@ static int lod_ref_del(const struct lu_env *env,
 }
 
 /**
- * Implementation of dt_object_operations::do_capa_get.
- *
- * \see dt_object_operations::do_capa_get() in the API description for details.
- */
-static struct obd_capa *lod_capa_get(const struct lu_env *env,
-                                    struct dt_object *dt,
-                                    struct lustre_capa *old, __u64 opc)
-{
-       return dt_capa_get(env, dt_object_child(dt), old, opc);
-}
-
-/**
  * Implementation of dt_object_operations::do_object_sync.
  *
  * \see dt_object_operations::do_object_sync() in the API description
@@ -4007,7 +3968,6 @@ struct dt_object_operations lod_obj_ops = {
        .do_ref_add             = lod_ref_add,
        .do_declare_ref_del     = lod_declare_ref_del,
        .do_ref_del             = lod_ref_del,
-       .do_capa_get            = lod_capa_get,
        .do_object_sync         = lod_object_sync,
        .do_object_lock         = lod_object_lock,
        .do_object_unlock       = lod_object_unlock,
@@ -4019,11 +3979,10 @@ struct dt_object_operations lod_obj_ops = {
  * \see dt_body_operations::dbo_read() in the API description for details.
  */
 static ssize_t lod_read(const struct lu_env *env, struct dt_object *dt,
-                       struct lu_buf *buf, loff_t *pos,
-                       struct lustre_capa *capa)
+                       struct lu_buf *buf, loff_t *pos)
 {
        struct dt_object *next = dt_object_child(dt);
-        return next->do_body_ops->dbo_read(env, next, buf, pos, capa);
+       return next->do_body_ops->dbo_read(env, next, buf, pos);
 }
 
 /**
@@ -4048,11 +4007,11 @@ static ssize_t lod_declare_write(const struct lu_env *env,
  */
 static ssize_t lod_write(const struct lu_env *env, struct dt_object *dt,
                         const struct lu_buf *buf, loff_t *pos,
-                        struct thandle *th, struct lustre_capa *capa, int iq)
+                        struct thandle *th, int iq)
 {
        struct dt_object *next = dt_object_child(dt);
        LASSERT(next);
-       return next->do_body_ops->dbo_write(env, next, buf, pos, th, capa, iq);
+       return next->do_body_ops->dbo_write(env, next, buf, pos, th, iq);
 }
 
 static const struct dt_body_operations lod_body_lnk_ops = {
index 1051f0e..5a19c3c 100644 (file)
@@ -80,12 +80,12 @@ static int mdd_convert_remove_dots(const struct lu_env *env,
                GOTO(out, rc);
        /* ignore non-existing "."/".." - we stored them on disk for
         * pre-production systems, but this is not how regular ZFS works */
-       rc = dt_delete(env, mdd_object_child(o), dot, th, BYPASS_CAPA);
+       rc = dt_delete(env, mdd_object_child(o), dot, th);
        if (rc == -ENOENT)
                rc = 0;
        if (rc)
                GOTO(out, rc);
-       rc = dt_delete(env, mdd_object_child(o), dotdot, th, BYPASS_CAPA);
+       rc = dt_delete(env, mdd_object_child(o), dotdot, th);
        if (rc == -ENOENT)
                rc = 0;
        if (rc)
@@ -147,7 +147,7 @@ static int mdd_convert_object(const struct lu_env *env,
                RETURN(PTR_ERR(o));
        }
 
-       rc = mdo_attr_get(env, o, la, BYPASS_CAPA);
+       rc = mdo_attr_get(env, o, la);
        if (rc)
                GOTO(out, rc);
 
@@ -196,7 +196,7 @@ static int mdd_convert_lma(const struct lu_env *env, struct mdd_device *mdd,
        rc = dt_trans_start_local(env, mdd->mdd_child, th);
        if (rc)
                GOTO(out, rc);
-       rc = mdo_xattr_set(env, o, &buf, XATTR_NAME_LMA, 0, th, BYPASS_CAPA);
+       rc = mdo_xattr_set(env, o, &buf, XATTR_NAME_LMA, 0, th);
 out:
        dt_trans_stop(env, mdd->mdd_child, th);
        RETURN(rc);
@@ -218,7 +218,7 @@ static int mdd_fix_children(const struct lu_env *env,
        ent = (struct lu_dirent *)&info->mti_xattr_buf;
        iops = &o->do_index_ops->dio_it;
 
-       it = iops->init(env, o, LUDA_64BITHASH, BYPASS_CAPA);
+       it = iops->init(env, o, LUDA_64BITHASH);
        if (IS_ERR(it)) {
                rc = PTR_ERR(it);
                CERROR("%s: can't initialize the iterator: rc = %d\n",
@@ -341,7 +341,7 @@ int mdd_compat_fixes(const struct lu_env *env, struct mdd_device *mdd)
        CLASSERT(sizeof(info->mti_xattr_buf) >= LMA_OLD_SIZE);
        buf.lb_len = LMA_OLD_SIZE;
        buf.lb_buf = lma;
-       rc = mdo_xattr_get(env, root, &buf, XATTR_NAME_LMA, BYPASS_CAPA);
+       rc = mdo_xattr_get(env, root, &buf, XATTR_NAME_LMA);
        if (rc < 0 && rc != -ENODATA) {
                CERROR("%s: can't fetch LMA: rc = %d\n",
                       mdd2obd_dev(mdd)->obd_name, rc);
index 71e5d13..c5ac7e9 100644 (file)
@@ -1109,24 +1109,6 @@ static int mdd_statfs(const struct lu_env *env, struct md_device *m,
        RETURN(rc);
 }
 
-/*
- * No permission check is needed.
- */
-static int mdd_init_capa_ctxt(const struct lu_env *env, struct md_device *m,
-                              int mode, unsigned long timeout, __u32 alg,
-                              struct lustre_capa_key *keys)
-{
-        struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev);
-        int rc;
-        ENTRY;
-
-        /* need barrier for mds_capa_keys access. */
-
-        rc = mdd_child_ops(mdd)->dt_init_capa_ctxt(env, mdd->mdd_child, mode,
-                                                   timeout, alg, keys);
-        RETURN(rc);
-}
-
 static int mdd_maxeasize_get(const struct lu_env *env, struct md_device *m,
                                int *easize)
 {
@@ -1138,14 +1120,6 @@ static int mdd_maxeasize_get(const struct lu_env *env, struct md_device *m,
        RETURN(0);
 }
 
-static int mdd_update_capa_key(const struct lu_env *env,
-                               struct md_device *m,
-                               struct lustre_capa_key *key)
-{
-       /* we do not support capabilities ... */
-       return -EINVAL;
-}
-
 static int mdd_llog_ctxt_get(const struct lu_env *env, struct md_device *m,
                              int idx, void **h)
 {
@@ -1522,8 +1496,6 @@ LU_TYPE_INIT_FINI(mdd, &mdd_thread_key);
 static const struct md_device_operations mdd_ops = {
        .mdo_statfs         = mdd_statfs,
        .mdo_root_get       = mdd_root_get,
-       .mdo_init_capa_ctxt = mdd_init_capa_ctxt,
-       .mdo_update_capa_key= mdd_update_capa_key,
        .mdo_llog_ctxt_get  = mdd_llog_ctxt_get,
        .mdo_iocontrol      = mdd_iocontrol,
        .mdo_maxeasize_get  = mdd_maxeasize_get,
index 4532bcd..d581740 100644 (file)
@@ -99,8 +99,7 @@ __mdd_lookup(const struct lu_env *env, struct md_object *pobj,
 
        if (likely(S_ISDIR(mdd_object_type(mdd_obj)) &&
                   dt_try_as_dir(env, dir)))
-               rc = dt_lookup(env, dir, (struct dt_rec *)fid, key,
-                              mdd_object_capa(env, mdd_obj));
+               rc = dt_lookup(env, dir, (struct dt_rec *)fid, key);
        else
                rc = -ENOTDIR;
 
@@ -115,7 +114,7 @@ int mdd_lookup(const struct lu_env *env,
         int rc;
         ENTRY;
 
-       rc = mdd_la_get(env, md2mdd_obj(pobj), pattr, BYPASS_CAPA);
+       rc = mdd_la_get(env, md2mdd_obj(pobj), pattr);
        if (rc != 0)
                RETURN(rc);
 
@@ -171,8 +170,7 @@ static int mdd_is_parent(const struct lu_env *env,
                 RETURN(0);
 
         for(;;) {
-               /* this is done recursively, bypass capa for each obj */
-               mdd_set_capainfo(env, 4, p1, BYPASS_CAPA);
+               /* this is done recursively */
                rc = mdd_parent_fid(env, p1, attr, pfid);
                if (rc)
                        GOTO(out, rc);
@@ -225,7 +223,7 @@ int mdd_is_subdir(const struct lu_env *env, struct md_object *mo,
        if (!S_ISDIR(mdd_object_type(md2mdd_obj(mo))))
                RETURN(0);
 
-       rc = mdd_la_get(env, md2mdd_obj(mo), attr, BYPASS_CAPA);
+       rc = mdd_la_get(env, md2mdd_obj(mo), attr);
        if (rc != 0)
                RETURN(rc);
 
@@ -266,7 +264,7 @@ static int mdd_dir_is_empty(const struct lu_env *env,
                RETURN(-ENOTDIR);
 
        iops = &obj->do_index_ops->dio_it;
-       it = iops->init(env, obj, LUDA_64BITHASH, BYPASS_CAPA);
+       it = iops->init(env, obj, LUDA_64BITHASH);
        if (!IS_ERR(it)) {
                result = iops->get(env, it, (const struct dt_key *)"");
                if (result > 0) {
@@ -351,8 +349,7 @@ int mdd_may_create(const struct lu_env *env, struct mdd_object *pobj,
 
        /* If the parent is a sub-stripe, check whether it is dead */
        xbuf = mdd_buf_get(env, info->mti_key, sizeof(info->mti_key));
-       rc = mdo_xattr_get(env, pobj, xbuf, XATTR_NAME_LMV,
-                          mdd_object_capa(env, pobj));
+       rc = mdo_xattr_get(env, pobj, xbuf, XATTR_NAME_LMV);
        if (unlikely(rc > 0)) {
                struct lmv_mds_md_v1  *lmv1 = xbuf->lb_buf;
 
@@ -559,15 +556,14 @@ static int mdd_link_sanity_check(const struct lu_env *env,
 }
 
 static int __mdd_index_delete_only(const struct lu_env *env, struct mdd_object *pobj,
-                                  const char *name, struct thandle *handle,
-                                  struct lustre_capa *capa)
+                                  const char *name, struct thandle *handle)
 {
        struct dt_object *next = mdd_object_child(pobj);
        int rc;
        ENTRY;
 
        if (dt_try_as_dir(env, next))
-               rc = dt_delete(env, next, (struct dt_key *)name, handle, capa);
+               rc = dt_delete(env, next, (struct dt_key *)name, handle);
        else
                rc = -ENOTDIR;
 
@@ -578,8 +574,7 @@ static int __mdd_index_insert_only(const struct lu_env *env,
                                   struct mdd_object *pobj,
                                   const struct lu_fid *lf, __u32 type,
                                   const char *name,
-                                  struct thandle *handle,
-                                  struct lustre_capa *capa)
+                                  struct thandle *handle)
 {
        struct dt_object *next = mdd_object_child(pobj);
        int               rc;
@@ -594,7 +589,7 @@ static int __mdd_index_insert_only(const struct lu_env *env,
                rec->rec_type = type;
                ignore_quota = uc ? uc->uc_cap & CFS_CAP_SYS_RESOURCE_MASK : 1;
                rc = dt_insert(env, next, (const struct dt_rec *)rec,
-                              (const struct dt_key *)name, handle, capa,
+                              (const struct dt_key *)name, handle,
                               ignore_quota);
        } else {
                rc = -ENOTDIR;
@@ -605,13 +600,12 @@ static int __mdd_index_insert_only(const struct lu_env *env,
 /* insert named index, add reference if isdir */
 static int __mdd_index_insert(const struct lu_env *env, struct mdd_object *pobj,
                              const struct lu_fid *lf, __u32 type,
-                             const char *name, struct thandle *handle,
-                             struct lustre_capa *capa)
+                             const char *name, struct thandle *handle)
 {
        int rc;
        ENTRY;
 
-       rc = __mdd_index_insert_only(env, pobj, lf, type, name, handle, capa);
+       rc = __mdd_index_insert_only(env, pobj, lf, type, name, handle);
        if (rc == 0 && S_ISDIR(type)) {
                mdd_write_lock(env, pobj, MOR_TGT_PARENT);
                mdo_ref_add(env, pobj, handle);
@@ -623,13 +617,13 @@ static int __mdd_index_insert(const struct lu_env *env, struct mdd_object *pobj,
 
 /* delete named index, drop reference if isdir */
 static int __mdd_index_delete(const struct lu_env *env, struct mdd_object *pobj,
-                              const char *name, int is_dir, struct thandle *handle,
-                              struct lustre_capa *capa)
+                             const char *name, int is_dir,
+                             struct thandle *handle)
 {
         int               rc;
         ENTRY;
 
-        rc = __mdd_index_delete_only(env, pobj, name, handle, capa);
+       rc = __mdd_index_delete_only(env, pobj, name, handle);
         if (rc == 0 && is_dir) {
                 mdd_write_lock(env, pobj, MOR_TGT_PARENT);
                 mdo_ref_del(env, pobj, handle);
@@ -1065,20 +1059,19 @@ int mdd_links_read(const struct lu_env *env, struct mdd_object *mdd_obj,
        if (ldata->ld_buf->lb_buf == NULL)
                return -ENOMEM;
 
-       rc = mdo_xattr_get(env, mdd_obj, ldata->ld_buf, XATTR_NAME_LINK,
-                         BYPASS_CAPA);
+       rc = mdo_xattr_get(env, mdd_obj, ldata->ld_buf, XATTR_NAME_LINK);
        if (rc == -ERANGE) {
                /* Buf was too small, figure out what we need. */
                lu_buf_free(ldata->ld_buf);
                rc = mdo_xattr_get(env, mdd_obj, ldata->ld_buf,
-                                  XATTR_NAME_LINK, BYPASS_CAPA);
+                                  XATTR_NAME_LINK);
                if (rc < 0)
                        return rc;
                ldata->ld_buf = lu_buf_check_and_alloc(ldata->ld_buf, rc);
                if (ldata->ld_buf->lb_buf == NULL)
                        return -ENOMEM;
                rc = mdo_xattr_get(env, mdd_obj, ldata->ld_buf,
-                                 XATTR_NAME_LINK, BYPASS_CAPA);
+                                 XATTR_NAME_LINK);
        }
        if (rc < 0) {
                lu_buf_free(ldata->ld_buf);
@@ -1114,8 +1107,7 @@ int mdd_links_write(const struct lu_env *env, struct mdd_object *mdd_obj,
        if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_NO_LINKEA))
                return 0;
 
-       rc = mdo_xattr_set(env, mdd_obj, buf, XATTR_NAME_LINK, 0, handle,
-                          mdd_object_capa(env, mdd_obj));
+       rc = mdo_xattr_set(env, mdd_obj, buf, XATTR_NAME_LINK, 0, handle);
        if (unlikely(rc == -ENOSPC) && S_ISREG(mdd_object_type(mdd_obj)) &&
            mdd_object_remote(mdd_obj) == 0) {
                struct lfsck_request *lr = &mdd_env_info(env)->mti_lr;
@@ -1253,11 +1245,11 @@ static int mdd_link(const struct lu_env *env, struct md_object *tgt_obj,
        int rc;
        ENTRY;
 
-       rc = mdd_la_get(env, mdd_sobj, cattr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_sobj, cattr);
        if (rc != 0)
                RETURN(rc);
 
-       rc = mdd_la_get(env, mdd_tobj, tattr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_tobj, tattr);
        if (rc != 0)
                RETURN(rc);
 
@@ -1303,13 +1295,11 @@ static int mdd_link(const struct lu_env *env, struct md_object *tgt_obj,
                tfid.f_oid++;
                rc = __mdd_index_insert_only(env, mdd_tobj, &tfid,
                                             mdd_object_type(mdd_sobj),
-                                            name, handle,
-                                            mdd_object_capa(env, mdd_tobj));
+                                            name, handle);
        } else {
                rc = __mdd_index_insert_only(env, mdd_tobj, mdo2fid(mdd_sobj),
                                             mdd_object_type(mdd_sobj),
-                                            name, handle,
-                                            mdd_object_capa(env, mdd_tobj));
+                                            name, handle);
        }
 
        if (rc != 0) {
@@ -1371,8 +1361,7 @@ static int mdd_mark_dead_object(const struct lu_env *env,
        if (declare)
                rc = mdo_declare_attr_set(env, obj, attr, handle);
        else
-               rc = mdo_attr_set(env, obj, attr, handle,
-                                 mdd_object_capa(env, obj));
+               rc = mdo_attr_set(env, obj, attr, handle);
 
        return rc;
 }
@@ -1533,8 +1522,7 @@ static bool mdd_hsm_archive_exists(const struct lu_env *env,
 
                hsm_buf = mdd_buf_get(env, NULL, 0);
                lu_buf_alloc(hsm_buf, buflen);
-               rc = mdo_xattr_get(env, obj, hsm_buf, XATTR_NAME_HSM,
-                                  mdd_object_capa(env, obj));
+               rc = mdo_xattr_get(env, obj, hsm_buf, XATTR_NAME_HSM);
                rc = lustre_buf2hsm(hsm_buf->lb_buf, rc, &ma->ma_hsm);
                lu_buf_free(hsm_buf);
                if (rc < 0)
@@ -1578,13 +1566,13 @@ static int mdd_unlink(const struct lu_env *env, struct md_object *pobj,
                        RETURN(-ENOENT);
        }
 
-       rc = mdd_la_get(env, mdd_pobj, pattr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_pobj, pattr);
        if (rc)
                RETURN(rc);
 
        if (likely(mdd_cobj != NULL)) {
                /* fetch cattr */
-               rc = mdd_la_get(env, mdd_cobj, cattr, BYPASS_CAPA);
+               rc = mdd_la_get(env, mdd_cobj, cattr);
                if (rc)
                        RETURN(rc);
 
@@ -1612,8 +1600,7 @@ static int mdd_unlink(const struct lu_env *env, struct md_object *pobj,
                mdd_write_lock(env, mdd_cobj, MOR_TGT_CHILD);
 
        if (likely(no_name == 0) && !OBD_FAIL_CHECK(OBD_FAIL_LFSCK_DANGLING2)) {
-               rc = __mdd_index_delete(env, mdd_pobj, name, is_dir, handle,
-                                       mdd_object_capa(env, mdd_pobj));
+               rc = __mdd_index_delete(env, mdd_pobj, name, is_dir, handle);
                if (rc)
                        GOTO(cleanup, rc);
        }
@@ -1628,8 +1615,7 @@ static int mdd_unlink(const struct lu_env *env, struct md_object *pobj,
                        __mdd_index_insert_only(env, mdd_pobj,
                                                mdo2fid(mdd_cobj),
                                                mdd_object_type(mdd_cobj),
-                                               name, handle,
-                                               mdd_object_capa(env, mdd_pobj));
+                                               name, handle);
                        GOTO(cleanup, rc);
                }
 
@@ -1638,7 +1624,7 @@ static int mdd_unlink(const struct lu_env *env, struct md_object *pobj,
                        mdo_ref_del(env, mdd_cobj, handle);
 
                /* fetch updated nlink */
-               rc = mdd_la_get(env, mdd_cobj, cattr, BYPASS_CAPA);
+               rc = mdd_la_get(env, mdd_cobj, cattr);
                if (rc)
                        GOTO(cleanup, rc);
        }
@@ -1671,7 +1657,7 @@ static int mdd_unlink(const struct lu_env *env, struct md_object *pobj,
 
        /* fetch updated nlink */
        if (rc == 0)
-               rc = mdd_la_get(env, mdd_cobj, cattr, BYPASS_CAPA);
+               rc = mdd_la_get(env, mdd_cobj, cattr);
 
        /* if object is removed then we can't get its attrs, use last get */
        if (cattr->la_nlink == 0) {
@@ -1747,7 +1733,7 @@ static int mdd_create_data(const struct lu_env *env, struct md_object *pobj,
         *    striping can be specified or not
         * 2) CMD?
         */
-       rc = mdd_la_get(env, son, attr, BYPASS_CAPA);
+       rc = mdd_la_get(env, son, attr);
        if (rc)
                RETURN(rc);
 
@@ -1787,7 +1773,7 @@ static int mdd_create_data(const struct lu_env *env, struct md_object *pobj,
                GOTO(stop, rc);
 
        rc = dt_xattr_set(env, mdd_object_child(son), buf, XATTR_NAME_LOV,
-                         0, handle, mdd_object_capa(env, son));
+                         0, handle);
 
        if (rc)
                GOTO(stop, rc);
@@ -1850,11 +1836,10 @@ static int mdd_object_initialize(const struct lu_env *env,
                 /* Add "." and ".." for newly created dir */
                 mdo_ref_add(env, child, handle);
                 rc = __mdd_index_insert_only(env, child, mdo2fid(child),
-                                            S_IFDIR, dot, handle, BYPASS_CAPA);
+                                            S_IFDIR, dot, handle);
                if (rc == 0)
                        rc = __mdd_index_insert_only(env, child, pfid, S_IFDIR,
-                                                    dotdot, handle,
-                                                    BYPASS_CAPA);
+                                                    dotdot, handle);
                if (rc != 0)
                        mdo_ref_del(env, child, handle);
        }
@@ -2105,7 +2090,7 @@ static int mdd_acl_init(const struct lu_env *env, struct mdd_object *pobj,
 
        mdd_read_lock(env, pobj, MOR_TGT_PARENT);
        rc = mdo_xattr_get(env, pobj, def_acl_buf,
-                          XATTR_NAME_ACL_DEFAULT, BYPASS_CAPA);
+                          XATTR_NAME_ACL_DEFAULT);
        mdd_read_unlock(env, pobj);
        if (rc > 0) {
                /* If there are default ACL, fix mode/ACL by default ACL */
@@ -2184,7 +2169,7 @@ static int mdd_object_create(const struct lu_env *env, struct mdd_object *pobj,
                rc = mdo_xattr_set(env, son, buf,
                                   S_ISDIR(attr->la_mode) ? XATTR_NAME_LMV :
                                                            XATTR_NAME_LOV, 0,
-                                  handle, BYPASS_CAPA);
+                                  handle);
                if (rc != 0)
                        GOTO(err_destroy, rc);
        }
@@ -2195,7 +2180,7 @@ static int mdd_object_create(const struct lu_env *env, struct mdd_object *pobj,
                /* set default acl */
                rc = mdo_xattr_set(env, son, def_acl_buf,
                                   XATTR_NAME_ACL_DEFAULT, 0,
-                                  handle, BYPASS_CAPA);
+                                  handle);
                if (rc)
                        GOTO(err_destroy, rc);
        }
@@ -2203,7 +2188,7 @@ static int mdd_object_create(const struct lu_env *env, struct mdd_object *pobj,
        if (acl_buf != NULL && acl_buf->lb_len > 0) {
                rc = mdo_xattr_set(env, son, acl_buf,
                                   XATTR_NAME_ACL_ACCESS,
-                                  0, handle, BYPASS_CAPA);
+                                  0, handle);
                if (rc)
                        GOTO(err_destroy, rc);
        }
@@ -2219,7 +2204,6 @@ static int mdd_object_create(const struct lu_env *env, struct mdd_object *pobj,
 
                buf = mdd_buf_get_const(env, target_name, sym_len);
                rc = dt->do_body_ops->dbo_write(env, dt, buf, &pos, handle,
-                                               mdd_object_capa(env, son),
                                                uc->uc_cap &
                                                CFS_CAP_SYS_RESOURCE_MASK);
 
@@ -2310,7 +2294,7 @@ static int mdd_create(const struct lu_env *env, struct md_object *pobj,
          *     2. insert            (__mdd_index_insert(), lookup again)
          */
 
-       rc = mdd_la_get(env, mdd_pobj, pattr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_pobj, pattr);
        if (rc != 0)
                RETURN(rc);
 
@@ -2370,8 +2354,7 @@ static int mdd_create(const struct lu_env *env, struct md_object *pobj,
                GOTO(out_volatile, rc);
        } else {
                rc = __mdd_index_insert(env, mdd_pobj, mdo2fid(son),
-                                       attr->la_mode, name, handle,
-                                       mdd_object_capa(env, mdd_pobj));
+                                       attr->la_mode, name, handle);
                if (rc != 0)
                        GOTO(err_created, rc);
 
@@ -2396,7 +2379,7 @@ err_insert:
                else
                        rc2 = __mdd_index_delete(env, mdd_pobj, name,
                                                 S_ISDIR(attr->la_mode),
-                                                handle, BYPASS_CAPA);
+                                                handle);
                if (rc2 != 0)
                        goto out_stop;
 
@@ -2694,21 +2677,21 @@ static int mdd_rename(const struct lu_env *env,
 
        mdd_sobj = mdd_object_find(env, mdd, lf);
 
-       rc = mdd_la_get(env, mdd_sobj, cattr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_sobj, cattr);
        if (rc)
                GOTO(out_pending, rc);
 
-       rc = mdd_la_get(env, mdd_spobj, pattr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_spobj, pattr);
        if (rc)
                GOTO(out_pending, rc);
 
        if (mdd_tobj) {
-               rc = mdd_la_get(env, mdd_tobj, tattr, BYPASS_CAPA);
+               rc = mdd_la_get(env, mdd_tobj, tattr);
                if (rc)
                        GOTO(out_pending, rc);
        }
 
-       rc = mdd_la_get(env, mdd_tpobj, tpattr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_tpobj, tpattr);
        if (rc)
                GOTO(out_pending, rc);
 
@@ -2745,21 +2728,18 @@ static int mdd_rename(const struct lu_env *env,
        is_dir = S_ISDIR(cattr->la_mode);
 
         /* Remove source name from source directory */
-        rc = __mdd_index_delete(env, mdd_spobj, sname, is_dir, handle,
-                                mdd_object_capa(env, mdd_spobj));
+       rc = __mdd_index_delete(env, mdd_spobj, sname, is_dir, handle);
         if (rc)
                 GOTO(cleanup, rc);
 
         /* "mv dir1 dir2" needs "dir1/.." link update */
         if (is_dir && mdd_sobj && !lu_fid_eq(spobj_fid, tpobj_fid)) {
-                rc = __mdd_index_delete_only(env, mdd_sobj, dotdot, handle,
-                                        mdd_object_capa(env, mdd_sobj));
+               rc = __mdd_index_delete_only(env, mdd_sobj, dotdot, handle);
                if (rc != 0)
                        GOTO(fixup_spobj2, rc);
 
                rc = __mdd_index_insert_only(env, mdd_sobj, tpobj_fid, S_IFDIR,
-                                            dotdot, handle,
-                                            mdd_object_capa(env, mdd_sobj));
+                                            dotdot, handle);
                if (rc != 0)
                         GOTO(fixup_spobj, rc);
         }
@@ -2768,8 +2748,7 @@ static int mdd_rename(const struct lu_env *env,
          * Here tobj can be remote one, so we do index_delete unconditionally
          * and -ENOENT is allowed.
          */
-        rc = __mdd_index_delete(env, mdd_tpobj, tname, is_dir, handle,
-                                mdd_object_capa(env, mdd_tpobj));
+       rc = __mdd_index_delete(env, mdd_tpobj, tname, is_dir, handle);
         if (rc != 0) {
                 if (mdd_tobj) {
                         /* tname might been renamed to something else */
@@ -2781,7 +2760,7 @@ static int mdd_rename(const struct lu_env *env,
 
         /* Insert new fid with target name into target dir */
        rc = __mdd_index_insert(env, mdd_tpobj, lf, cattr->la_mode,
-                               tname, handle, mdd_object_capa(env, mdd_tpobj));
+                               tname, handle);
        if (rc != 0)
                 GOTO(fixup_tpobj, rc);
 
@@ -2818,7 +2797,7 @@ static int mdd_rename(const struct lu_env *env,
                tobj_ref = 1;
 
                /* fetch updated nlink */
-               rc = mdd_la_get(env, mdd_tobj, tattr, BYPASS_CAPA);
+               rc = mdd_la_get(env, mdd_tobj, tattr);
                if (rc != 0) {
                        CERROR("%s: Failed to get nlink for tobj "
                                DFID": rc = %d\n",
@@ -2851,7 +2830,7 @@ static int mdd_rename(const struct lu_env *env,
                }
 
                /* fetch updated nlink */
-               rc = mdd_la_get(env, mdd_tobj, tattr, BYPASS_CAPA);
+               rc = mdd_la_get(env, mdd_tobj, tattr);
                if (rc != 0) {
                        CERROR("%s: Failed to get nlink for tobj "
                                DFID": rc = %d\n",
@@ -2899,8 +2878,7 @@ static int mdd_rename(const struct lu_env *env,
 
 fixup_tpobj:
         if (rc) {
-                rc2 = __mdd_index_delete(env, mdd_tpobj, tname, is_dir, handle,
-                                         BYPASS_CAPA);
+               rc2 = __mdd_index_delete(env, mdd_tpobj, tname, is_dir, handle);
                 if (rc2)
                         CWARN("tp obj fix error %d\n",rc2);
 
@@ -2915,7 +2893,7 @@ fixup_tpobj:
                        rc2 = __mdd_index_insert(env, mdd_tpobj,
                                                  mdo2fid(mdd_tobj),
                                                  mdd_object_type(mdd_tobj),
-                                                 tname, handle, BYPASS_CAPA);
+                                                 tname, handle);
                        if (rc2 != 0)
                                CWARN("tp obj fix error: rc = %d\n", rc2);
                }
@@ -2923,16 +2901,14 @@ fixup_tpobj:
 
 fixup_spobj:
        if (rc && is_dir && mdd_sobj && mdd_spobj != mdd_tpobj) {
-               rc2 = __mdd_index_delete_only(env, mdd_sobj, dotdot, handle,
-                                             BYPASS_CAPA);
-
+               rc2 = __mdd_index_delete_only(env, mdd_sobj, dotdot, handle);
                if (rc2)
                        CWARN("%s: sp obj dotdot delete error: rc = %d\n",
                               mdd2obd_dev(mdd)->obd_name, rc2);
 
 
                rc2 = __mdd_index_insert_only(env, mdd_sobj, spobj_fid, S_IFDIR,
-                                             dotdot, handle, BYPASS_CAPA);
+                                             dotdot, handle);
                if (rc2 != 0)
                        CWARN("%s: sp obj dotdot insert error: rc = %d\n",
                              mdd2obd_dev(mdd)->obd_name, rc2);
@@ -2942,7 +2918,7 @@ fixup_spobj2:
        if (rc != 0) {
                rc2 = __mdd_index_insert(env, mdd_spobj, lf,
                                         mdd_object_type(mdd_sobj), sname,
-                                        handle, BYPASS_CAPA);
+                                        handle);
                if (rc2 != 0)
                        CWARN("sp obj fix error: rc = %d\n", rc2);
        }
@@ -3138,16 +3114,14 @@ static int mdd_update_linkea_internal(const struct lu_env *env,
                                GOTO(next_put, rc);
                } else {
                        rc = __mdd_index_delete(env, pobj, lname.ln_name,
-                                               0, handle,
-                                               mdd_object_capa(env, pobj));
+                                               0, handle);
                        if (rc)
                                GOTO(next_put, rc);
 
                        rc = __mdd_index_insert(env, pobj,
                                        mdd_object_fid(mdd_tobj),
                                        mdd_object_type(mdd_tobj),
-                                       lname.ln_name, handle,
-                                       mdd_object_capa(env, pobj));
+                                       lname.ln_name, handle);
                        if (rc != 0)
                                GOTO(next_put, rc);
 
@@ -3187,8 +3161,7 @@ static int mdd_migrate_xattrs(const struct lu_env *env,
        int                     rc;
 
        /* retrieve xattr list from the old object */
-       list_xsize = mdo_xattr_list(env, mdd_sobj, &LU_BUF_NULL,
-                                   mdd_object_capa(env, mdd_sobj));
+       list_xsize = mdo_xattr_list(env, mdd_sobj, &LU_BUF_NULL);
        if (list_xsize == -ENODATA)
                return 0;
 
@@ -3201,8 +3174,7 @@ static int mdd_migrate_xattrs(const struct lu_env *env,
 
        list_xbuf.lb_buf = info->mti_big_buf.lb_buf;
        list_xbuf.lb_len = list_xsize;
-       rc = mdo_xattr_list(env, mdd_sobj, &list_xbuf,
-                           mdd_object_capa(env, mdd_sobj));
+       rc = mdo_xattr_list(env, mdd_sobj, &list_xbuf);
        if (rc < 0)
                return rc;
        rc = 0;
@@ -3220,9 +3192,7 @@ static int mdd_migrate_xattrs(const struct lu_env *env,
                    !S_ISDIR(lu_object_attr(&mdd_sobj->mod_obj.mo_lu)))
                        goto next;
 
-               xsize = mdo_xattr_get(env, mdd_sobj, &LU_BUF_NULL,
-                                     xname,
-                                     mdd_object_capa(env, mdd_sobj));
+               xsize = mdo_xattr_get(env, mdd_sobj, &LU_BUF_NULL, xname);
                if (xsize == -ENODATA)
                        goto next;
                if (xsize < 0)
@@ -3234,8 +3204,7 @@ static int mdd_migrate_xattrs(const struct lu_env *env,
 
                xbuf.lb_len = xsize;
                xbuf.lb_buf = info->mti_link_buf.lb_buf;
-               rc = mdo_xattr_get(env, mdd_sobj, &xbuf, xname,
-                                  mdd_object_capa(env, mdd_sobj));
+               rc = mdo_xattr_get(env, mdd_sobj, &xbuf, xname);
                if (rc == -ENODATA)
                        goto next;
                if (rc < 0)
@@ -3257,8 +3226,7 @@ static int mdd_migrate_xattrs(const struct lu_env *env,
                if (rc != 0)
                        GOTO(stop_trans, rc);
 
-               rc = mdo_xattr_set(env, mdd_tobj, &xbuf, xname, 0, handle,
-                                  mdd_object_capa(env, mdd_sobj));
+               rc = mdo_xattr_set(env, mdd_tobj, &xbuf, xname, 0, handle);
                if (rc == -EEXIST)
                        GOTO(stop_trans, rc = 0);
 
@@ -3446,8 +3414,7 @@ static int mdd_migrate_create(const struct lu_env *env,
         * target object which is already being created. */
        mgr_easize = lmv_mds_md_size(2, LMV_MAGIC_V1);
        buf = mdd_buf_get_const(env, mgr_ea, mgr_easize);
-       rc = mdo_xattr_set(env, mdd_sobj, buf, XATTR_NAME_LMV, 0,
-                          handle, mdd_object_capa(env, mdd_sobj));
+       rc = mdo_xattr_set(env, mdd_sobj, buf, XATTR_NAME_LMV, 0, handle);
        if (rc != 0)
                GOTO(stop_trans, rc);
 
@@ -3458,8 +3425,7 @@ static int mdd_migrate_create(const struct lu_env *env,
         * flag and approve the migration */
        la_flag->la_valid = LA_FLAGS;
        la_flag->la_flags = la->la_flags | LUSTRE_IMMUTABLE_FL;
-       rc = mdo_attr_set(env, mdd_sobj, la_flag, handle,
-                         mdd_object_capa(env, mdd_sobj));
+       rc = mdo_attr_set(env, mdd_sobj, la_flag, handle);
 stop_trans:
        if (handle != NULL)
                mdd_trans_stop(env, mdd, rc, handle);
@@ -3494,8 +3460,7 @@ static int mdd_migrate_entries(const struct lu_env *env,
         * iterate directories
         */
        iops = &next->do_index_ops->dio_it;
-       it = iops->init(env, next, LUDA_FID | LUDA_TYPE,
-                       mdd_object_capa(env, mdd_sobj));
+       it = iops->init(env, next, LUDA_FID | LUDA_TYPE);
        if (IS_ERR(it))
                GOTO(out_ent, rc = PTR_ERR(it));
 
@@ -3554,8 +3519,7 @@ static int mdd_migrate_entries(const struct lu_env *env,
                        struct lu_fid *fid = &mdd_env_info(env)->mti_fid2;
 
                        rc = dt_lookup(env, dt_tobj, (struct dt_rec *)fid,
-                                      (struct dt_key *)name,
-                                      mdd_object_capa(env, mdd_tobj));
+                                      (struct dt_key *)name);
                        if (unlikely(rc == 0))
                                target_exist = true;
                }
@@ -3622,8 +3586,7 @@ static int mdd_migrate_entries(const struct lu_env *env,
                if (likely(!target_exist)) {
                        rc = __mdd_index_insert(env, mdd_tobj, &ent->lde_fid,
                                                mdd_object_type(child),
-                                               name, handle,
-                                               mdd_object_capa(env, mdd_tobj));
+                                               name, handle);
                        if (rc != 0)
                                GOTO(out_put, rc);
 
@@ -3635,21 +3598,19 @@ static int mdd_migrate_entries(const struct lu_env *env,
                        }
                }
 
-               rc = __mdd_index_delete(env, mdd_sobj, name, is_dir, handle,
-                                       mdd_object_capa(env, mdd_sobj));
+               rc = __mdd_index_delete(env, mdd_sobj, name, is_dir, handle);
                if (rc != 0)
                        GOTO(out_put, rc);
 
                if (is_dir) {
-                       rc = __mdd_index_delete_only(env, child, dotdot, handle,
-                                                  mdd_object_capa(env, child));
+                       rc = __mdd_index_delete_only(env, child, dotdot,
+                                                    handle);
                        if (rc != 0)
                                GOTO(out_put, rc);
 
                        rc = __mdd_index_insert_only(env, child,
                                         mdd_object_fid(mdd_tobj), S_IFDIR,
-                                        dotdot, handle,
-                                        mdd_object_capa(env, child));
+                                        dotdot, handle);
                        if (rc != 0)
                                GOTO(out_put, rc);
                }
@@ -3802,7 +3763,7 @@ static int mdd_migrate_update_name(const struct lu_env *env,
        p_la->la_ctime = p_la->la_mtime = ma->ma_attr.la_ctime;
        p_la->la_valid = LA_CTIME;
 
-       rc = mdd_la_get(env, mdd_sobj, so_attr, mdd_object_capa(env, mdd_sobj));
+       rc = mdd_la_get(env, mdd_sobj, so_attr);
        if (rc != 0)
                RETURN(rc);
 
@@ -3833,14 +3794,12 @@ static int mdd_migrate_update_name(const struct lu_env *env,
        /* Revert IMMUTABLE flag */
        la_flag->la_valid = LA_FLAGS;
        la_flag->la_flags = so_attr->la_flags & ~LUSTRE_IMMUTABLE_FL;
-       rc = mdo_attr_set(env, mdd_sobj, la_flag, handle,
-                         mdd_object_capa(env, mdd_pobj));
+       rc = mdo_attr_set(env, mdd_sobj, la_flag, handle);
        if (rc != 0)
                GOTO(stop_trans, rc);
 
        /* Remove source name from source directory */
-       rc = __mdd_index_delete(env, mdd_pobj, name, is_dir, handle,
-                               mdd_object_capa(env, mdd_pobj));
+       rc = __mdd_index_delete(env, mdd_pobj, name, is_dir, handle);
        if (rc != 0)
                GOTO(stop_trans, rc);
 
@@ -3852,8 +3811,7 @@ static int mdd_migrate_update_name(const struct lu_env *env,
        if (S_ISREG(so_attr->la_mode)) {
                if (so_attr->la_nlink == 1) {
                        rc = mdo_xattr_del(env, mdd_sobj, XATTR_NAME_LOV,
-                                          handle,
-                                          mdd_object_capa(env, mdd_sobj));
+                                          handle);
                        if (rc != 0 && rc != -ENODATA)
                                GOTO(stop_trans, rc);
                }
@@ -3861,8 +3819,7 @@ static int mdd_migrate_update_name(const struct lu_env *env,
 
        /* Insert new fid with target name into target dir */
        rc = __mdd_index_insert(env, mdd_pobj, mdd_object_fid(mdd_tobj),
-                               mdd_object_type(mdd_tobj), name,
-                               handle, mdd_object_capa(env, mdd_pobj));
+                               mdd_object_type(mdd_tobj), name, handle);
        if (rc != 0)
                GOTO(stop_trans, rc);
 
@@ -3877,8 +3834,7 @@ static int mdd_migrate_update_name(const struct lu_env *env,
                mdo_ref_del(env, mdd_sobj, handle);
 
        /* Get the attr again after ref_del */
-       rc = mdd_la_get(env, mdd_sobj, so_attr,
-                       mdd_object_capa(env, mdd_sobj));
+       rc = mdd_la_get(env, mdd_sobj, so_attr);
        if (rc != 0)
                GOTO(out_unlock, rc);
 
@@ -3929,8 +3885,7 @@ static int mdd_migrate_sanity_check(const struct lu_env *env,
        if (mgr_buf->lb_buf == NULL)
                RETURN(-ENOMEM);
 
-       rc = mdo_xattr_get(env, sobj, mgr_buf, XATTR_NAME_LMV,
-                          mdd_object_capa(env, sobj));
+       rc = mdo_xattr_get(env, sobj, mgr_buf, XATTR_NAME_LMV);
        if (rc > 0) {
                union lmv_mds_md *lmm = mgr_buf->lb_buf;
 
@@ -4037,11 +3992,11 @@ static int mdd_migrate(const struct lu_env *env, struct md_object *pobj,
        }
        mdd_read_unlock(env, mdd_sobj);
 
-       rc = mdd_la_get(env, mdd_sobj, so_attr, mdd_object_capa(env, mdd_sobj));
+       rc = mdd_la_get(env, mdd_sobj, so_attr);
        if (rc != 0)
                GOTO(put, rc);
 
-       rc = mdd_la_get(env, mdd_pobj, pattr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_pobj, pattr);
        if (rc != 0)
                GOTO(put, rc);
 
index 8c228c3..aaebfdc 100644 (file)
@@ -47,7 +47,6 @@
 #include <dt_object.h>
 #include <lustre_lfsck.h>
 #include <lustre_fid.h>
-#include <lustre_capa.h>
 #include <lprocfs_status.h>
 #include <lustre_log.h>
 #include <lustre_linkea.h>
@@ -170,7 +169,7 @@ enum mdd_links_add_overflow {
 extern const char orph_index_name[];
 
 int mdd_la_get(const struct lu_env *env, struct mdd_object *obj,
-               struct lu_attr *la, struct lustre_capa *capa);
+              struct lu_attr *la);
 int mdd_attr_get(const struct lu_env *env, struct md_object *obj,
                 struct md_attr *ma);
 int mdd_attr_set(const struct lu_env *env, struct md_object *obj,
@@ -355,8 +354,6 @@ int __mdd_permission_internal(const struct lu_env *env, struct mdd_object *obj,
 int mdd_permission(const struct lu_env *env,
                    struct md_object *pobj, struct md_object *cobj,
                    struct md_attr *ma, int mask);
-int mdd_capa_get(const struct lu_env *env, struct md_object *obj,
-                 struct lustre_capa *capa, int renewal);
 int mdd_generic_thread_start(struct mdd_generic_thread *thread,
                             int (*func)(void *), void *data, char *name);
 void mdd_generic_thread_stop(struct mdd_generic_thread *thread);
@@ -459,39 +456,6 @@ static inline struct seq_server_site *mdd_seq_site(struct mdd_device *mdd)
        return mdd2lu_dev(mdd)->ld_site->ld_seq_site;
 }
 
-static inline struct lustre_capa *mdd_object_capa(const struct lu_env *env,
-                                                 const struct mdd_object *obj)
-{
-       struct lu_capainfo *lci = lu_capainfo_get(env);
-       const struct lu_fid *fid = mdo2fid(obj);
-       int i;
-
-       /* NB: in mdt_init0 */
-       if (lci == NULL)
-               return BYPASS_CAPA;
-
-       for (i = 0; i < LU_CAPAINFO_MAX; i++)
-               if (lu_fid_eq(&lci->lci_fid[i], fid))
-                       return lci->lci_capa[i];
-       return NULL;
-}
-
-static inline void mdd_set_capainfo(const struct lu_env *env, int offset,
-                                   const struct mdd_object *obj,
-                                   struct lustre_capa *capa)
-{
-       struct lu_capainfo *lci = lu_capainfo_get(env);
-       const struct lu_fid *fid = mdo2fid(obj);
-
-       LASSERT(offset >= 0 && offset < LU_CAPAINFO_MAX);
-       /* NB: in mdt_init0 */
-       if (lci == NULL)
-               return;
-
-       lci->lci_fid[offset]  = *fid;
-       lci->lci_capa[offset] = capa;
-}
-
 static inline const char *mdd_obj_dev_name(const struct mdd_object *obj)
 {
         return lu_dev_name(obj->mod_obj.mo_lu.lo_dev);
@@ -517,10 +481,10 @@ static inline int mdd_permission_internal_locked(const struct lu_env *env,
 
 /* mdd inline func for calling osd_dt_object ops */
 static inline int mdo_attr_get(const struct lu_env *env, struct mdd_object *obj,
-                              struct lu_attr *la, struct lustre_capa *capa)
+                              struct lu_attr *la)
 {
        struct dt_object *next = mdd_object_child(obj);
-       return dt_attr_get(env, next, la, capa);
+       return dt_attr_get(env, next, la);
 }
 
 static inline int mdo_declare_attr_set(const struct lu_env *env,
@@ -535,23 +499,21 @@ static inline int mdo_declare_attr_set(const struct lu_env *env,
 static inline int mdo_attr_set(const struct lu_env *env,
                               struct mdd_object *obj,
                               const struct lu_attr *la,
-                              struct thandle *handle,
-                              struct lustre_capa *capa)
+                              struct thandle *handle)
 {
        struct dt_object *next = mdd_object_child(obj);
 
        if (!mdd_object_exists(obj))
                return -ENOENT;
 
-       return dt_attr_set(env, next, la, handle, capa);
+       return dt_attr_set(env, next, la, handle);
 }
 
 static inline int mdo_xattr_get(const struct lu_env *env,struct mdd_object *obj,
-                               struct lu_buf *buf, const char *name,
-                               struct lustre_capa *capa)
+                               struct lu_buf *buf, const char *name)
 {
        struct dt_object *next = mdd_object_child(obj);
-       return dt_xattr_get(env, next, buf, name, capa);
+       return dt_xattr_get(env, next, buf, name);
 }
 
 static inline int mdo_declare_xattr_set(const struct lu_env *env,
@@ -566,15 +528,14 @@ static inline int mdo_declare_xattr_set(const struct lu_env *env,
 
 static inline int mdo_xattr_set(const struct lu_env *env,struct mdd_object *obj,
                                const struct lu_buf *buf, const char *name,
-                               int fl, struct thandle *handle,
-                               struct lustre_capa *capa)
+                               int fl, struct thandle *handle)
 {
        struct dt_object *next = mdd_object_child(obj);
 
        if (!mdd_object_exists(obj))
                return -ENOENT;
 
-       return dt_xattr_set(env, next, buf, name, fl, handle, capa);
+       return dt_xattr_set(env, next, buf, name, fl, handle);
 }
 
 static inline int mdo_declare_xattr_del(const struct lu_env *env,
@@ -587,27 +548,26 @@ static inline int mdo_declare_xattr_del(const struct lu_env *env,
 }
 
 static inline int mdo_xattr_del(const struct lu_env *env,struct mdd_object *obj,
-                               const char *name, struct thandle *handle,
-                               struct lustre_capa *capa)
+                               const char *name, struct thandle *handle)
 {
        struct dt_object *next = mdd_object_child(obj);
 
        if (!mdd_object_exists(obj))
                return -ENOENT;
 
-       return dt_xattr_del(env, next, name, handle, capa);
+       return dt_xattr_del(env, next, name, handle);
 }
 
 static inline int
 mdo_xattr_list(const struct lu_env *env, struct mdd_object *obj,
-              struct lu_buf *buf, struct lustre_capa *capa)
+              struct lu_buf *buf)
 {
        struct dt_object *next = mdd_object_child(obj);
 
        if (!mdd_object_exists(obj))
                return -ENOENT;
 
-       return dt_xattr_list(env, next, buf, capa);
+       return dt_xattr_list(env, next, buf);
 }
 
 static inline
@@ -736,16 +696,4 @@ int mdo_destroy(const struct lu_env *env, struct mdd_object *o,
         return dt_destroy(env, next, handle);
 }
 
-static inline struct obd_capa *
-mdo_capa_get(const struct lu_env *env, struct mdd_object *obj,
-            struct lustre_capa *old, __u64 opc)
-{
-       struct dt_object *next = mdd_object_child(obj);
-
-       if (!mdd_object_exists(obj))
-               return ERR_PTR(-ENOENT);
-
-       return dt_capa_get(env, next, old, opc);
-}
-
 #endif
index 30b8dd2..88d2e67 100644 (file)
@@ -63,7 +63,7 @@ static int mdd_xattr_get(const struct lu_env *env,
                          const char *name);
 
 int mdd_la_get(const struct lu_env *env, struct mdd_object *obj,
-               struct lu_attr *la, struct lustre_capa *capa)
+              struct lu_attr *la)
 {
         if (mdd_object_exists(obj) == 0) {
                 CERROR("%s: object "DFID" not found: rc = -2\n",
@@ -71,7 +71,7 @@ int mdd_la_get(const struct lu_env *env, struct mdd_object *obj,
                 return -ENOENT;
         }
 
-        return mdo_attr_get(env, obj, la, capa);
+       return mdo_attr_get(env, obj, la);
 }
 
 struct mdd_thread_info *mdd_env_info(const struct lu_env *env)
@@ -155,7 +155,7 @@ static int mdd_object_start(const struct lu_env *env, struct lu_object *o)
                struct mdd_object *mdd_obj = lu2mdd_obj(o);
                struct lu_attr *attr = MDD_ENV_VAR(env, la_for_start);
 
-               rc = mdd_la_get(env, mdd_obj, attr, BYPASS_CAPA);
+               rc = mdd_la_get(env, mdd_obj, attr);
        }
 
        return rc;
@@ -204,8 +204,7 @@ int mdd_attr_get(const struct lu_env *env, struct md_object *obj,
 
        ENTRY;
 
-       rc = mdd_la_get(env, mdd_obj, &ma->ma_attr,
-                       mdd_object_capa(env, md2mdd_obj(obj)));
+       rc = mdd_la_get(env, mdd_obj, &ma->ma_attr);
        if ((ma->ma_need & MA_INODE) != 0 && mdd_is_dead_obj(mdd_obj))
                ma->ma_attr.la_nlink = 0;
 
@@ -237,8 +236,7 @@ static int mdd_xattr_get(const struct lu_env *env,
                RETURN(-ENOENT);
 
         mdd_read_lock(env, mdd_obj, MOR_TGT_CHILD);
-        rc = mdo_xattr_get(env, mdd_obj, buf, name,
-                           mdd_object_capa(env, mdd_obj));
+       rc = mdo_xattr_get(env, mdd_obj, buf, name);
         mdd_read_unlock(env, mdd_obj);
 
         RETURN(rc);
@@ -268,8 +266,7 @@ int mdd_readlink(const struct lu_env *env, struct md_object *obj,
        LASSERT(next->do_body_ops != NULL);
        LASSERT(next->do_body_ops->dbo_read != NULL);
        mdd_read_lock(env, mdd_obj, MOR_TGT_CHILD);
-        rc = next->do_body_ops->dbo_read(env, next, buf, &pos,
-                                         mdd_object_capa(env, mdd_obj));
+       rc = dt_read(env, next, buf, &pos);
         mdd_read_unlock(env, mdd_obj);
         RETURN(rc);
 }
@@ -286,7 +283,7 @@ static int mdd_xattr_list(const struct lu_env *env, struct md_object *obj,
         ENTRY;
 
         mdd_read_lock(env, mdd_obj, MOR_TGT_CHILD);
-        rc = mdo_xattr_list(env, mdd_obj, buf, mdd_object_capa(env, mdd_obj));
+       rc = mdo_xattr_list(env, mdd_obj, buf);
         mdd_read_unlock(env, mdd_obj);
 
        if (rc < 0)
@@ -381,7 +378,7 @@ int mdd_attr_set_internal(const struct lu_env *env, struct mdd_object *obj,
         int rc;
         ENTRY;
 
-        rc = mdo_attr_set(env, obj, attr, handle, mdd_object_capa(env, obj));
+       rc = mdo_attr_set(env, obj, attr, handle);
 #ifdef CONFIG_FS_POSIX_ACL
         if (!rc && (attr->la_valid & LA_MODE) && needacl)
                 rc = mdd_acl_chmod(env, obj, attr->la_mode, handle);
@@ -783,7 +780,7 @@ static int mdd_declare_attr_set(const struct lu_env *env,
        if (attr->la_valid & LA_MODE) {
                 mdd_read_lock(env, obj, MOR_TGT_CHILD);
                rc = mdo_xattr_get(env, obj, &LU_BUF_NULL,
-                                  XATTR_NAME_ACL_ACCESS, BYPASS_CAPA);
+                                  XATTR_NAME_ACL_ACCESS);
                 mdd_read_unlock(env, obj);
                 if (rc == -EOPNOTSUPP || rc == -ENODATA)
                         rc = 0;
@@ -854,7 +851,7 @@ int mdd_attr_set(const struct lu_env *env, struct md_object *obj,
        LASSERT((ma->ma_valid & MA_HSM) == 0);
        LASSERT((ma->ma_valid & MA_SOM) == 0);
 
-       rc = mdd_la_get(env, mdd_obj, attr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_obj, attr);
        if (rc)
                RETURN(rc);
 
@@ -983,8 +980,7 @@ static int mdd_hsm_update_locked(const struct lu_env *env,
        CLASSERT(sizeof(struct hsm_attrs) <= sizeof(info->mti_xattr_buf));
        current_buf = mdd_buf_get(env, info->mti_xattr_buf,
                                  sizeof(info->mti_xattr_buf));
-       rc = mdo_xattr_get(env, mdd_obj, current_buf, XATTR_NAME_HSM,
-                          mdd_object_capa(env, mdd_obj));
+       rc = mdo_xattr_get(env, mdd_obj, current_buf, XATTR_NAME_HSM);
        rc = lustre_buf2hsm(current_buf->lb_buf, rc, current_mh);
        if (rc < 0 && rc != -ENODATA)
                GOTO(free, rc);
@@ -1033,7 +1029,7 @@ static int mdd_xattr_set(const struct lu_env *env, struct md_object *obj,
        int                      rc;
        ENTRY;
 
-       rc = mdd_la_get(env, mdd_obj, attr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_obj, attr);
        if (rc)
                RETURN(rc);
 
@@ -1083,8 +1079,7 @@ static int mdd_xattr_set(const struct lu_env *env, struct md_object *obj,
                }
        }
 
-       rc = mdo_xattr_set(env, mdd_obj, buf, name, fl, handle,
-                          mdd_object_capa(env, mdd_obj));
+       rc = mdo_xattr_set(env, mdd_obj, buf, name, fl, handle);
        mdd_write_unlock(env, mdd_obj);
        if (rc)
                GOTO(stop, rc);
@@ -1141,7 +1136,7 @@ static int mdd_xattr_del(const struct lu_env *env, struct md_object *obj,
        int  rc;
        ENTRY;
 
-       rc = mdd_la_get(env, mdd_obj, attr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_obj, attr);
        if (rc)
                RETURN(rc);
 
@@ -1162,8 +1157,7 @@ static int mdd_xattr_del(const struct lu_env *env, struct md_object *obj,
                 GOTO(stop, rc);
 
         mdd_write_lock(env, mdd_obj, MOR_TGT_CHILD);
-        rc = mdo_xattr_del(env, mdd_obj, name, handle,
-                           mdd_object_capa(env, mdd_obj));
+       rc = mdo_xattr_del(env, mdd_obj, name, handle);
         mdd_write_unlock(env, mdd_obj);
        if (rc)
                GOTO(stop, rc);
@@ -1196,8 +1190,7 @@ int mdd_get_lov_ea(const struct lu_env *env, struct mdd_object *obj,
        ENTRY;
 
 repeat:
-       rc = mdo_xattr_get(env, obj, buf, XATTR_NAME_LOV,
-                          mdd_object_capa(env, obj));
+       rc = mdo_xattr_get(env, obj, buf, XATTR_NAME_LOV);
 
        if (rc == -ERANGE) {
                /* mti_big_buf is allocated but is too small
@@ -1251,7 +1244,7 @@ static int mdd_xattr_hsm_replace(const struct lu_env *env,
        ENTRY;
 
        rc = mdo_xattr_set(env, o, buf, XATTR_NAME_HSM, LU_XATTR_REPLACE,
-                          handle, mdd_object_capa(env, o));
+                          handle);
        if (rc != 0)
                RETURN(rc);
 
@@ -1346,11 +1339,11 @@ static int mdd_swap_layouts(const struct lu_env *env, struct md_object *obj1,
        if (rc < 0)
                swap(fst_o, snd_o);
 
-       rc = mdd_la_get(env, fst_o, fst_la, BYPASS_CAPA);
+       rc = mdd_la_get(env, fst_o, fst_la);
        if (rc != 0)
                RETURN(rc);
 
-       rc = mdd_la_get(env, snd_o, snd_la, BYPASS_CAPA);
+       rc = mdd_la_get(env, snd_o, snd_la);
        if (rc != 0)
                RETURN(rc);
 
@@ -1432,13 +1425,11 @@ static int mdd_swap_layouts(const struct lu_env *env, struct md_object *obj1,
                        GOTO(stop, rc = -ENOMEM);
 
                /* Read HSM attribute */
-               rc = mdo_xattr_get(env, fst_o, fst_hsm_buf, XATTR_NAME_HSM,
-                                  BYPASS_CAPA);
+               rc = mdo_xattr_get(env, fst_o, fst_hsm_buf, XATTR_NAME_HSM);
                if (rc < 0)
                        GOTO(stop, rc);
 
-               rc = mdo_xattr_get(env, snd_o, snd_hsm_buf, XATTR_NAME_HSM,
-                                  BYPASS_CAPA);
+               rc = mdo_xattr_get(env, snd_o, snd_hsm_buf, XATTR_NAME_HSM);
                if (rc < 0)
                        GOTO(stop, rc);
 
@@ -1492,8 +1483,7 @@ static int mdd_swap_layouts(const struct lu_env *env, struct md_object *obj1,
                }
        }
 
-       rc = mdo_xattr_set(env, fst_o, snd_buf, XATTR_NAME_LOV, fst_fl, handle,
-                          mdd_object_capa(env, fst_o));
+       rc = mdo_xattr_set(env, fst_o, snd_buf, XATTR_NAME_LOV, fst_fl, handle);
        if (rc != 0)
                GOTO(stop, rc);
 
@@ -1502,11 +1492,9 @@ static int mdd_swap_layouts(const struct lu_env *env, struct md_object *obj1,
        } else {
                if (fst_buf->lb_buf != NULL)
                        rc = mdo_xattr_set(env, snd_o, fst_buf, XATTR_NAME_LOV,
-                                          LU_XATTR_REPLACE, handle,
-                                          mdd_object_capa(env, snd_o));
+                                          LU_XATTR_REPLACE, handle);
                else
-                       rc = mdo_xattr_del(env, snd_o, XATTR_NAME_LOV, handle,
-                                          mdd_object_capa(env, snd_o));
+                       rc = mdo_xattr_del(env, snd_o, XATTR_NAME_LOV, handle);
        }
 
        if (rc != 0) {
@@ -1518,11 +1506,9 @@ static int mdd_swap_layouts(const struct lu_env *env, struct md_object *obj1,
                        fst_lmm->lmm_oi = *saved_oi;
                        fst_lmm->lmm_layout_gen = cpu_to_le16(fst_gen - 1);
                        rc2 = mdo_xattr_set(env, fst_o, fst_buf, XATTR_NAME_LOV,
-                                           LU_XATTR_REPLACE, handle,
-                                           mdd_object_capa(env, fst_o));
+                                           LU_XATTR_REPLACE, handle);
                } else {
-                       rc2 = mdo_xattr_del(env, fst_o, XATTR_NAME_LOV, handle,
-                                           mdd_object_capa(env, fst_o));
+                       rc2 = mdo_xattr_del(env, fst_o, XATTR_NAME_LOV, handle);
                }
                if (rc2 < 0)
                        goto do_lbug;
@@ -1693,7 +1679,7 @@ static int mdd_open(const struct lu_env *env, struct md_object *obj,
 
        mdd_write_lock(env, mdd_obj, MOR_TGT_CHILD);
 
-       rc = mdd_la_get(env, mdd_obj, attr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_obj, attr);
        if (rc != 0)
                GOTO(out, rc);
 
@@ -1771,8 +1757,7 @@ again:
         }
 
         mdd_write_lock(env, mdd_obj, MOR_TGT_CHILD);
-       rc = mdd_la_get(env, mdd_obj, &ma->ma_attr,
-                       mdd_object_capa(env, mdd_obj));
+       rc = mdd_la_get(env, mdd_obj, &ma->ma_attr);
        if (rc != 0) {
                CERROR("Failed to get lu_attr of "DFID": %d\n",
                       PFID(mdd_object_fid(mdd_obj)), rc);
@@ -2080,7 +2065,6 @@ const struct md_object_operations mdd_obj_ops = {
        .moo_readpage           = mdd_readpage,
        .moo_readlink           = mdd_readlink,
        .moo_changelog          = mdd_changelog,
-       .moo_capa_get           = mdd_capa_get,
        .moo_object_sync        = mdd_object_sync,
        .moo_object_lock        = mdd_object_lock,
        .moo_object_unlock      = mdd_object_unlock,
index c179f8d..e7ce0fd 100644 (file)
@@ -119,8 +119,7 @@ static inline int mdd_orphan_insert_obj(const struct lu_env *env,
        rec->rec_fid = lf;
        rec->rec_type = mdd_object_type(obj);
 
-       return dt_insert(env, dor, (const struct dt_rec *)rec, key, th,
-                        BYPASS_CAPA, 1);
+       return dt_insert(env, dor, (const struct dt_rec *)rec, key, th, 1);
 }
 
 static inline int mdd_orphan_delete_obj(const struct lu_env *env,
@@ -130,7 +129,7 @@ static inline int mdd_orphan_delete_obj(const struct lu_env *env,
 {
        struct dt_object *dor = mdd->mdd_orphans;
 
-       return dt_delete(env, dor, key, th, BYPASS_CAPA);
+       return dt_delete(env, dor, key, th);
 }
 
 static inline int mdd_orphan_ref_add(const struct lu_env *env,
@@ -227,12 +226,12 @@ static int orph_index_insert(const struct lu_env *env,
         if (!dt_try_as_dir(env, next))
                GOTO(out, rc = 0);
 
-       dt_delete(env, next, (const struct dt_key *)dotdot, th, BYPASS_CAPA);
+       dt_delete(env, next, (const struct dt_key *)dotdot, th);
 
        rec->rec_fid = lf_dor;
        rec->rec_type = S_IFDIR;
        dt_insert(env, next, (const struct dt_rec *)rec,
-                 (const struct dt_key *)dotdot, th, BYPASS_CAPA, 1);
+                 (const struct dt_key *)dotdot, th, 1);
 
 out:
         if (rc == 0)
@@ -440,7 +439,7 @@ static int orph_index_iterate(const struct lu_env *env,
         ENTRY;
 
         iops = &dor->do_index_ops->dio_it;
-        it = iops->init(env, dor, LUDA_64BITHASH, BYPASS_CAPA);
+       it = iops->init(env, dor, LUDA_64BITHASH);
         if (IS_ERR(it)) {
                 rc = PTR_ERR(it);
                 CERROR("%s: cannot clean PENDING: rc = %d\n",
index b21e9cb..750df8d 100644 (file)
@@ -69,7 +69,7 @@ int mdd_acl_chmod(const struct lu_env *env, struct mdd_object *o, __u32 mode,
        buf = mdd_buf_get(env, mdd_env_info(env)->mti_xattr_buf,
                          sizeof(mdd_env_info(env)->mti_xattr_buf));
 
-       rc = mdo_xattr_get(env, o, buf, XATTR_NAME_ACL_ACCESS, BYPASS_CAPA);
+       rc = mdo_xattr_get(env, o, buf, XATTR_NAME_ACL_ACCESS);
        if ((rc == -EOPNOTSUPP) || (rc == -ENODATA))
                RETURN(0);
        else if (rc <= 0)
@@ -88,7 +88,7 @@ int mdd_acl_chmod(const struct lu_env *env, struct mdd_object *o, __u32 mode,
                RETURN(rc);
 
        rc = mdo_xattr_set(env, o, buf, XATTR_NAME_ACL_ACCESS,
-                          0, handle, BYPASS_CAPA);
+                          0, handle);
        RETURN(rc);
 }
 
@@ -148,16 +148,14 @@ int mdd_acl_set(const struct lu_env *env, struct mdd_object *obj,
        /* whether ACL can be represented by i_mode only */
        if (not_equiv)
                rc = mdo_xattr_set(env, obj, buf, XATTR_NAME_ACL_ACCESS, fl,
-                               handle, mdd_object_capa(env, obj));
+                                  handle);
        else
-               rc = mdo_xattr_del(env, obj, XATTR_NAME_ACL_ACCESS, handle,
-                               mdd_object_capa(env, obj));
+               rc = mdo_xattr_del(env, obj, XATTR_NAME_ACL_ACCESS, handle);
        if (rc)
                GOTO(unlock, rc);
 
        if (mode_change)
-               rc = mdo_attr_set(env, obj, la, handle,
-                               mdd_object_capa(env, obj));
+               rc = mdo_attr_set(env, obj, la, handle);
 
        /* security-replated changes may require sync */
        if (S_ISDIR(mdd_object_type(obj)))
@@ -217,8 +215,7 @@ static int mdd_check_acl(const struct lu_env *env, struct mdd_object *obj,
 
        buf = mdd_buf_get(env, mdd_env_info(env)->mti_xattr_buf,
                          sizeof(mdd_env_info(env)->mti_xattr_buf));
-       rc = mdo_xattr_get(env, obj, buf, XATTR_NAME_ACL_ACCESS,
-                          mdd_object_capa(env, obj));
+       rc = mdo_xattr_get(env, obj, buf, XATTR_NAME_ACL_ACCESS);
        if (rc <= 0)
                RETURN(rc ? : -EACCES);
 
@@ -326,13 +323,13 @@ int mdd_permission(const struct lu_env *env,
        if (pobj != NULL) {
                mdd_pobj = md2mdd_obj(pobj);
                pattr = MDD_ENV_VAR(env, pattr);
-               rc = mdd_la_get(env, mdd_pobj, pattr, BYPASS_CAPA);
+               rc = mdd_la_get(env, mdd_pobj, pattr);
                if (rc)
                        RETURN(rc);
        }
 
        mdd_cobj = md2mdd_obj(cobj);
-       rc = mdd_la_get(env, mdd_cobj, cattr, BYPASS_CAPA);
+       rc = mdd_la_get(env, mdd_cobj, cattr);
        if (rc)
                RETURN(rc);
 
@@ -396,23 +393,3 @@ int mdd_permission(const struct lu_env *env,
 
         RETURN(rc);
 }
-
-int mdd_capa_get(const struct lu_env *env, struct md_object *obj,
-                 struct lustre_capa *capa, int renewal)
-{
-        struct mdd_object *mdd_obj = md2mdd_obj(obj);
-        struct obd_capa *oc;
-        int rc = 0;
-        ENTRY;
-
-        oc = mdo_capa_get(env, mdd_obj, renewal ? capa : NULL,
-                          capa->lc_opc);
-        if (IS_ERR(oc)) {
-                rc = PTR_ERR(oc);
-        } else if (likely(oc != NULL)) {
-                capa_cpy(capa, oc);
-                capa_put(oc);
-        }
-
-        RETURN(rc);
-}
index 2b23a67..0b0e6a4 100644 (file)
@@ -1,6 +1,6 @@
 MODULES := mdt
 mdt-objs := mdt_handler.o mdt_lib.o mdt_reint.o mdt_xattr.o mdt_recovery.o
-mdt-objs += mdt_open.o mdt_idmap.o mdt_identity.o mdt_capa.o mdt_lproc.o mdt_fs.o
+mdt-objs += mdt_open.o mdt_idmap.o mdt_identity.o mdt_lproc.o mdt_fs.o
 mdt-objs += mdt_lvb.o mdt_hsm.o mdt_mds.o
 mdt-objs += mdt_hsm_cdt_actions.o
 mdt-objs += mdt_hsm_cdt_requests.o
diff --git a/lustre/mdt/mdt_capa.c b/lustre/mdt/mdt_capa.c
deleted file mode 100644 (file)
index 0df5450..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, 2014, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/mdt/mdt_capa.c
- *
- * Lustre Metadata Target (mdt) capability key read/write/update.
- *
- * Author: Lai Siyao <lsy@clusterfs.com>
- */
-
-#define DEBUG_SUBSYSTEM S_MDS
-
-#include "mdt_internal.h"
-
-static inline void set_capa_key_expiry(struct mdt_device *mdt)
-{
-       mdt->mdt_ck_expiry = jiffies + msecs_to_jiffies(mdt->mdt_ck_timeout *
-                                                       MSEC_PER_SEC);
-}
-
-static void make_capa_key(struct lustre_capa_key *key, u32 mdsnum, int keyid)
-{
-        key->lk_seq = mdsnum;
-        key->lk_keyid = keyid + 1;
-        cfs_get_random_bytes(key->lk_key, sizeof(key->lk_key));
-}
-
-static inline void lck_cpu_to_le(struct lustre_capa_key *tgt,
-                                 struct lustre_capa_key *src)
-{
-        tgt->lk_seq   = cpu_to_le64(src->lk_seq);
-        tgt->lk_keyid   = cpu_to_le32(src->lk_keyid);
-        tgt->lk_padding = cpu_to_le32(src->lk_padding);
-        memcpy(tgt->lk_key, src->lk_key, sizeof(src->lk_key));
-}
-
-static inline void lck_le_to_cpu(struct lustre_capa_key *tgt,
-                                 struct lustre_capa_key *src)
-{
-        tgt->lk_seq   = le64_to_cpu(src->lk_seq);
-        tgt->lk_keyid   = le32_to_cpu(src->lk_keyid);
-        tgt->lk_padding = le32_to_cpu(src->lk_padding);
-        memcpy(tgt->lk_key, src->lk_key, sizeof(src->lk_key));
-}
-
-static int write_capa_keys(const struct lu_env *env,
-                           struct mdt_device *mdt,
-                           struct lustre_capa_key *keys)
-{
-        struct mdt_thread_info *mti;
-        struct lustre_capa_key *tmp;
-        struct thandle *th;
-        loff_t off = 0;
-        int i, rc;
-
-        mti = lu_context_key_get(&env->le_ctx, &mdt_thread_key);
-       th = dt_trans_create(env, mdt->mdt_bottom);
-       if (IS_ERR(th))
-               RETURN(PTR_ERR(th));
-
-       rc = dt_declare_record_write(env, mdt->mdt_ck_obj,
-                                    mdt_buf_const(env, NULL,
-                                    sizeof(*tmp) * 3), 0, th);
-       if (rc)
-               goto stop;
-
-       rc = dt_trans_start_local(env, mdt->mdt_bottom, th);
-        if (rc)
-                goto stop;
-
-        tmp = &mti->mti_capa_key;
-
-        for (i = 0; i < 2; i++) {
-                lck_cpu_to_le(tmp, &keys[i]);
-
-                rc = dt_record_write(env, mdt->mdt_ck_obj,
-                                     mdt_buf_const(env, tmp, sizeof(*tmp)),
-                                     &off, th);
-                if (rc)
-                        break;
-        }
-
-stop:
-       dt_trans_stop(env, mdt->mdt_bottom, th);
-
-        CDEBUG(D_INFO, "write capability keys rc = %d:\n", rc);
-        return rc;
-}
-
-static int read_capa_keys(const struct lu_env *env,
-                          struct mdt_device *mdt,
-                          struct lustre_capa_key *keys)
-{
-        struct mdt_thread_info *mti;
-        struct lustre_capa_key *tmp;
-        loff_t off = 0;
-        int i, rc;
-
-        mti = lu_context_key_get(&env->le_ctx, &mdt_thread_key);
-        tmp = &mti->mti_capa_key;
-
-        for (i = 0; i < 2; i++) {
-                rc = dt_record_read(env, mdt->mdt_ck_obj,
-                                    mdt_buf(env, tmp, sizeof(*tmp)), &off);
-                if (rc)
-                        return rc;
-
-                lck_le_to_cpu(&keys[i], tmp);
-                DEBUG_CAPA_KEY(D_SEC, &keys[i], "read");
-        }
-
-        return 0;
-}
-
-int mdt_capa_keys_init(const struct lu_env *env, struct mdt_device *mdt)
-{
-        struct lustre_capa_key  *keys = mdt->mdt_capa_keys;
-        struct mdt_thread_info  *mti;
-        struct dt_object        *obj;
-        struct lu_attr          *la;
-       u32                      mdsnum;
-        unsigned long            size;
-        int                      rc;
-        ENTRY;
-
-       mdsnum = mdt_seq_site(mdt)->ss_node_id;
-
-        mti = lu_context_key_get(&env->le_ctx, &mdt_thread_key);
-        LASSERT(mti != NULL);
-        la = &mti->mti_attr.ma_attr;
-
-        obj = mdt->mdt_ck_obj;
-        rc = obj->do_ops->do_attr_get(env, mdt->mdt_ck_obj, la, BYPASS_CAPA);
-        if (rc)
-                RETURN(rc);
-
-        size = (unsigned long)la->la_size;
-        if (size == 0) {
-                int i;
-
-                for (i = 0; i < 2; i++) {
-                        make_capa_key(&keys[i], mdsnum, i);
-                        DEBUG_CAPA_KEY(D_SEC, &keys[i], "initializing");
-                }
-
-                rc = write_capa_keys(env, mdt, keys);
-                if (rc) {
-                        CERROR("error writing MDS %s: rc %d\n", CAPA_KEYS, rc);
-                        RETURN(rc);
-                }
-        } else {
-                rc = read_capa_keys(env, mdt, keys);
-                if (rc) {
-                        CERROR("error reading MDS %s: rc %d\n", CAPA_KEYS, rc);
-                        RETURN(rc);
-                }
-        }
-        set_capa_key_expiry(mdt);
-        cfs_timer_arm(&mdt->mdt_ck_timer, mdt->mdt_ck_expiry);
-        CDEBUG(D_SEC, "mds_ck_timer %lu\n", mdt->mdt_ck_expiry);
-        RETURN(0);
-}
-
-void mdt_ck_timer_callback(unsigned long castmeharder)
-{
-       struct mdt_device *mdt = (struct mdt_device *)castmeharder;
-       struct ptlrpc_thread *thread = &mdt->mdt_ck_thread;
-
-       ENTRY;
-       thread_add_flags(thread, SVC_EVENT);
-       wake_up(&thread->t_ctl_waitq);
-       EXIT;
-}
-
-static int mdt_ck_thread_main(void *args)
-{
-       struct mdt_device      *mdt = args;
-       struct ptlrpc_thread   *thread = &mdt->mdt_ck_thread;
-       struct lustre_capa_key *bkey = &mdt->mdt_capa_keys[0],
-                              *rkey = &mdt->mdt_capa_keys[1];
-       struct lustre_capa_key *tmp;
-       struct lu_env           env;
-       struct mdt_thread_info *info;
-       struct md_device       *next;
-       struct l_wait_info      lwi = { 0 };
-       u32                     mdsnum;
-       int                     rc;
-       ENTRY;
-
-       unshare_fs_struct();
-       cfs_block_allsigs();
-
-       thread_set_flags(thread, SVC_RUNNING);
-       wake_up(&thread->t_ctl_waitq);
-
-       rc = lu_env_init(&env, LCT_MD_THREAD|LCT_REMEMBER|LCT_NOREF);
-       if (rc)
-               RETURN(rc);
-
-       thread->t_env = &env;
-       env.le_ctx.lc_thread = thread;
-       env.le_ctx.lc_cookie = 0x1;
-
-       info = lu_context_key_get(&env.le_ctx, &mdt_thread_key);
-       LASSERT(info != NULL);
-
-       tmp = &info->mti_capa_key;
-       mdsnum = mdt_seq_site(mdt)->ss_node_id;
-       while (1) {
-               l_wait_event(thread->t_ctl_waitq,
-                            thread_is_stopping(thread) ||
-                            thread_is_event(thread),
-                            &lwi);
-
-               if (thread_is_stopping(thread))
-                       break;
-               thread_clear_flags(thread, SVC_EVENT);
-
-               if (cfs_time_before(cfs_time_current(), mdt->mdt_ck_expiry))
-                       break;
-
-               *tmp = *rkey;
-               make_capa_key(tmp, mdsnum, rkey->lk_keyid);
-
-               next = mdt->mdt_child;
-               rc = next->md_ops->mdo_update_capa_key(&env, next, tmp);
-               if (!rc) {
-                       spin_lock(&capa_lock);
-                       *bkey = *rkey;
-                       *rkey = *tmp;
-                       spin_unlock(&capa_lock);
-
-                       rc = write_capa_keys(&env, mdt, mdt->mdt_capa_keys);
-                       if (rc) {
-                               spin_lock(&capa_lock);
-                               *rkey = *bkey;
-                               memset(bkey, 0, sizeof(*bkey));
-                               spin_unlock(&capa_lock);
-                       } else {
-                               set_capa_key_expiry(mdt);
-                               DEBUG_CAPA_KEY(D_SEC, rkey, "new");
-                       }
-               }
-               if (rc) {
-                       DEBUG_CAPA_KEY(D_ERROR, rkey, "update failed for");
-                       /* next retry is in 300 sec */
-                       mdt->mdt_ck_expiry = jiffies +
-                                            msecs_to_jiffies(300 *
-                                                             MSEC_PER_SEC);
-               }
-
-               cfs_timer_arm(&mdt->mdt_ck_timer, mdt->mdt_ck_expiry);
-               CDEBUG(D_SEC, "mdt_ck_timer %lu\n", mdt->mdt_ck_expiry);
-       }
-       lu_env_fini(&env);
-
-       thread_set_flags(thread, SVC_STOPPED);
-       wake_up(&thread->t_ctl_waitq);
-       RETURN(0);
-}
-
-int mdt_ck_thread_start(struct mdt_device *mdt)
-{
-       struct ptlrpc_thread *thread = &mdt->mdt_ck_thread;
-       struct task_struct *task;
-
-       init_waitqueue_head(&thread->t_ctl_waitq);
-       task = kthread_run(mdt_ck_thread_main, mdt, "mdt_ck");
-       if (IS_ERR(task)) {
-               CERROR("cannot start mdt_ck thread, rc = %ld\n", PTR_ERR(task));
-               return PTR_ERR(task);
-       }
-
-       l_wait_condition(thread->t_ctl_waitq, thread_is_running(thread));
-       return 0;
-}
-
-void mdt_ck_thread_stop(struct mdt_device *mdt)
-{
-       struct ptlrpc_thread *thread = &mdt->mdt_ck_thread;
-
-       if (!thread_is_running(thread))
-               return;
-
-       thread_set_flags(thread, SVC_STOPPING);
-       wake_up(&thread->t_ctl_waitq);
-       l_wait_condition(thread->t_ctl_waitq, thread_is_stopped(thread));
-}
index a0af42e..5124770 100644 (file)
@@ -284,24 +284,6 @@ static int mdt_getstatus(struct tgt_session_info *tsi)
        repbody->mbo_fid1 = mdt->mdt_md_root_fid;
        repbody->mbo_valid |= OBD_MD_FLID;
 
-       if (tsi->tsi_tgt->lut_mds_capa &&
-           exp_connect_flags(info->mti_exp) & OBD_CONNECT_MDS_CAPA) {
-               struct mdt_object       *root;
-               struct lustre_capa      *capa;
-
-               root = mdt_object_find(info->mti_env, mdt, &repbody->mbo_fid1);
-               if (IS_ERR(root))
-                       GOTO(out, rc = PTR_ERR(root));
-
-                capa = req_capsule_server_get(info->mti_pill, &RMF_CAPA1);
-                LASSERT(capa);
-                capa->lc_opc = CAPA_OPC_MDS_DEFAULT;
-                rc = mo_capa_get(info->mti_env, mdt_object_child(root), capa,
-                                 0);
-                mdt_object_put(info->mti_env, root);
-                if (rc == 0)
-                       repbody->mbo_valid |= OBD_MD_FLMDSCAPA;
-        }
        EXIT;
 out:
        mdt_thread_info_fini(info);
@@ -1047,20 +1029,6 @@ static int mdt_getattr_internal(struct mdt_thread_info *info,
                rc = mdt_pack_acl2body(info, repbody, o, nodemap);
 #endif
 
-       if (reqbody->mbo_valid & OBD_MD_FLMDSCAPA &&
-           info->mti_mdt->mdt_lut.lut_mds_capa &&
-           exp_connect_flags(info->mti_exp) & OBD_CONNECT_MDS_CAPA) {
-                struct lustre_capa *capa;
-
-                capa = req_capsule_server_get(pill, &RMF_CAPA1);
-                LASSERT(capa);
-                capa->lc_opc = CAPA_OPC_MDS_DEFAULT;
-                rc = mo_capa_get(env, next, capa, 0);
-                if (rc)
-                        RETURN(rc);
-               repbody->mbo_valid |= OBD_MD_FLMDSCAPA;
-        }
-
 out:
         if (rc == 0)
                mdt_counter_incr(req, LPROC_MDT_GETATTR);
@@ -1068,38 +1036,6 @@ out:
         RETURN(rc);
 }
 
-static int mdt_renew_capa(struct mdt_thread_info *info)
-{
-        struct mdt_object  *obj = info->mti_object;
-        struct mdt_body    *body;
-        struct lustre_capa *capa, *c;
-        int rc;
-        ENTRY;
-
-        /* if object doesn't exist, or server has disabled capability,
-         * return directly, client will find body->valid OBD_MD_FLOSSCAPA
-         * flag not set.
-         */
-       if (!obj || !info->mti_mdt->mdt_lut.lut_oss_capa ||
-           !(exp_connect_flags(info->mti_exp) & OBD_CONNECT_OSS_CAPA))
-               RETURN(0);
-
-        body = req_capsule_server_get(info->mti_pill, &RMF_MDT_BODY);
-        LASSERT(body != NULL);
-
-        c = req_capsule_client_get(info->mti_pill, &RMF_CAPA1);
-        LASSERT(c);
-
-        capa = req_capsule_server_get(info->mti_pill, &RMF_CAPA2);
-        LASSERT(capa);
-
-        *capa = *c;
-        rc = mo_capa_get(info->mti_env, mdt_object_child(obj), capa, 1);
-        if (rc == 0)
-               body->mbo_valid |= OBD_MD_FLOSSCAPA;
-        RETURN(rc);
-}
-
 static int mdt_getattr(struct tgt_session_info *tsi)
 {
        struct mdt_thread_info  *info = tsi2mdt_info(tsi);
@@ -1112,15 +1048,6 @@ static int mdt_getattr(struct tgt_session_info *tsi)
 
         reqbody = req_capsule_client_get(pill, &RMF_MDT_BODY);
         LASSERT(reqbody);
-
-       if (reqbody->mbo_valid & OBD_MD_FLOSSCAPA) {
-                rc = req_capsule_server_pack(pill);
-                if (unlikely(rc))
-                        RETURN(err_serious(rc));
-                rc = mdt_renew_capa(info);
-                GOTO(out_shrink, rc);
-        }
-
         LASSERT(obj != NULL);
        LASSERT(lu_object_assert_exists(&obj->mot_obj));
 
@@ -1173,11 +1100,6 @@ static int mdt_getattr(struct tgt_session_info *tsi)
 
        info->mti_cross_ref = !!(reqbody->mbo_valid & OBD_MD_FLCROSSREF);
 
-       /*
-        * Don't check capability at all, because rename might getattr for
-        * remote obj, and at that time no capability is available.
-        */
-       mdt_set_capainfo(info, 1, &reqbody->mbo_fid1, BYPASS_CAPA);
        rc = mdt_getattr_internal(info, obj, 0);
        if (reqbody->mbo_valid & OBD_MD_FLRMTPERM)
                 mdt_exit_ucred(info);
@@ -1244,16 +1166,6 @@ static int mdt_swap_layouts(struct tgt_session_info *tsi)
        if (info->mti_dlm_req != NULL)
                ldlm_request_cancel(req, info->mti_dlm_req, 0, LATF_SKIP);
 
-       if (req_capsule_get_size(info->mti_pill, &RMF_CAPA1, RCL_CLIENT))
-               mdt_set_capainfo(info, 0, &info->mti_body->mbo_fid1,
-                                req_capsule_client_get(info->mti_pill,
-                                                       &RMF_CAPA1));
-
-       if (req_capsule_get_size(info->mti_pill, &RMF_CAPA2, RCL_CLIENT))
-               mdt_set_capainfo(info, 1, &info->mti_body->mbo_fid2,
-                                req_capsule_client_get(info->mti_pill,
-                                                       &RMF_CAPA2));
-
        o1 = info->mti_object;
        o = o2 = mdt_object_find(info->mti_env, info->mti_mdt,
                                &info->mti_body->mbo_fid2);
@@ -1419,7 +1331,6 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info,
                        RETURN(-ENOENT);
                }
 
-               mdt_set_capainfo(info, 0, mdt_object_fid(child), BYPASS_CAPA);
                rc = mdt_getattr_internal(info, child, 0);
                if (unlikely(rc != 0))
                        mdt_object_unlock(info, child, lhc, 1);
@@ -1601,7 +1512,6 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info,
         lock = ldlm_handle2lock(&lhc->mlh_reg_lh);
 
         /* finally, we can get attr for child. */
-        mdt_set_capainfo(info, 1, child_fid, BYPASS_CAPA);
         rc = mdt_getattr_internal(info, child, ma_need);
         if (unlikely(rc != 0)) {
                 mdt_object_unlock(info, child, lhc, 1);
@@ -2752,27 +2662,11 @@ static int mdt_body_unpack(struct mdt_thread_info *info, __u32 flags)
                 RETURN(-EINVAL);
         }
 
-        /*
-         * Do not get size or any capa fields before we check that request
-         * contains capa actually. There are some requests which do not, for
-         * instance MDS_IS_SUBDIR.
-         */
-        if (req_capsule_has_field(pill, &RMF_CAPA1, RCL_CLIENT) &&
-            req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
-               mdt_set_capainfo(info, 0, &body->mbo_fid1,
-                                req_capsule_client_get(pill, &RMF_CAPA1));
-
        obj = mdt_object_find(env, info->mti_mdt, &body->mbo_fid1);
        if (!IS_ERR(obj)) {
-               if ((flags & HABEO_CORPUS) &&
-                   !mdt_object_exists(obj)) {
+               if ((flags & HABEO_CORPUS) && !mdt_object_exists(obj)) {
                        mdt_object_put(env, obj);
-                       /* for capability renew ENOENT will be handled in
-                        * mdt_renew_capa */
-                       if (body->mbo_valid & OBD_MD_FLOSSCAPA)
-                                rc = 0;
-                        else
-                                rc = -ENOENT;
+                       rc = -ENOENT;
                 } else {
                         info->mti_object = obj;
                         rc = 0;
@@ -2808,17 +2702,6 @@ static int mdt_unpack_req_pack_rep(struct mdt_thread_info *info, __u32 flags)
         RETURN(rc);
 }
 
-static int mdt_init_capa_ctxt(const struct lu_env *env, struct mdt_device *m)
-{
-       struct md_device *next = m->mdt_child;
-
-       return next->md_ops->mdo_init_capa_ctxt(env, next,
-                                               m->mdt_lut.lut_mds_capa,
-                                               m->mdt_capa_timeout,
-                                               m->mdt_capa_alg,
-                                               m->mdt_capa_keys);
-}
-
 void mdt_lock_handle_init(struct mdt_lock_handle *lh)
 {
         lh->mlh_type = MDT_NUL_LOCK;
@@ -2901,28 +2784,14 @@ void mdt_thread_info_fini(struct mdt_thread_info *info)
 struct mdt_thread_info *tsi2mdt_info(struct tgt_session_info *tsi)
 {
        struct mdt_thread_info  *mti;
-       struct lustre_capa      *lc;
 
        mti = mdt_th_info(tsi->tsi_env);
        LASSERT(mti != NULL);
 
        mdt_thread_info_init(tgt_ses_req(tsi), mti);
        if (tsi->tsi_corpus != NULL) {
-               struct req_capsule *pill = tsi->tsi_pill;
-
                mti->mti_object = mdt_obj(tsi->tsi_corpus);
                lu_object_get(tsi->tsi_corpus);
-
-               /*
-                * XXX: must be part of tgt_mdt_body_unpack but moved here
-                * due to mdt_set_capainfo().
-                */
-               if (req_capsule_has_field(pill, &RMF_CAPA1, RCL_CLIENT) &&
-                   req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT) > 0) {
-                       lc = req_capsule_client_get(pill, &RMF_CAPA1);
-                       mdt_set_capainfo(mti, 0, &tsi->tsi_mdt_body->mbo_fid1,
-                                        lc);
-               }
        }
        mti->mti_body = tsi->tsi_mdt_body;
        mti->mti_dlm_req = tsi->tsi_dlm_req;
@@ -4408,10 +4277,6 @@ static void mdt_fini(const struct lu_env *env, struct mdt_device *m)
         mdt_seq_fini(env, m);
         mdt_fld_fini(env, m);
 
-        next->md_ops->mdo_init_capa_ctxt(env, next, 0, 0, 0, NULL);
-        cfs_timer_disarm(&m->mdt_ck_timer);
-        mdt_ck_thread_stop(m);
-
        /*
         * Finish the stack
         */
@@ -4483,9 +4348,6 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
                obd->u.obt.obt_magic = OBT_MAGIC;
        }
 
-        m->mdt_capa_timeout = CAPA_TIMEOUT;
-        m->mdt_capa_alg = CAPA_HMAC_ALG_SHA1;
-        m->mdt_ck_timeout = CAPA_KEY_TIMEOUT;
        m->mdt_squash.rsi_uid = 0;
        m->mdt_squash.rsi_gid = 0;
        INIT_LIST_HEAD(&m->mdt_squash.rsi_nosquash_nids);
@@ -4556,8 +4418,6 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
         /* set obd_namespace for compatibility with old code */
         obd->obd_namespace = m->mdt_namespace;
 
-        cfs_timer_init(&m->mdt_ck_timer, mdt_ck_timer_callback, m);
-
        rc = mdt_hsm_cdt_init(m);
        if (rc != 0) {
                CERROR("%s: error initializing coordinator, rc %d\n",
@@ -4565,15 +4425,11 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
                 GOTO(err_free_ns, rc);
        }
 
-        rc = mdt_ck_thread_start(m);
-        if (rc)
-                GOTO(err_free_hsm, rc);
-
        rc = tgt_init(env, &m->mdt_lut, obd, m->mdt_bottom, mdt_common_slice,
                      OBD_FAIL_MDS_ALL_REQUEST_NET,
                      OBD_FAIL_MDS_ALL_REPLY_NET);
        if (rc)
-               GOTO(err_capa, rc);
+               GOTO(err_free_hsm, rc);
 
        rc = mdt_fs_setup(env, m, obd, lsi);
        if (rc)
@@ -4635,8 +4491,6 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
         * when the whole stack is complete and ready
         * to serve the requests */
 
-        mdt_init_capa_ctxt(env, m);
-
         /* Reduce the initial timeout on an MDS because it doesn't need such
          * a long timeout as an OST does. Adaptive timeouts will adjust this
          * value appropriately. */
@@ -4654,9 +4508,6 @@ err_fs_cleanup:
        mdt_fs_cleanup(env, m);
 err_tgt:
        tgt_fini(env, &m->mdt_lut);
-err_capa:
-       cfs_timer_disarm(&m->mdt_ck_timer);
-       mdt_ck_thread_stop(m);
 err_free_hsm:
        mdt_hsm_cdt_fini(m);
 err_free_ns:
index a5220a1..5261799 100644 (file)
@@ -225,11 +225,6 @@ int mdt_hsm_state_get(struct tgt_session_info *tsi)
        if (rc)
                GOTO(out_unlock, rc);
 
-       if (req_capsule_get_size(info->mti_pill, &RMF_CAPA1, RCL_CLIENT))
-               mdt_set_capainfo(info, 0, &info->mti_body->mbo_fid1,
-                                req_capsule_client_get(info->mti_pill,
-                                &RMF_CAPA1));
-
        hus = req_capsule_server_get(tsi->tsi_pill, &RMF_HSM_USER_STATE);
        if (hus == NULL)
                GOTO(out_unlock, rc = -EPROTO);
@@ -285,10 +280,6 @@ int mdt_hsm_state_set(struct tgt_session_info *tsi)
        if (rc < 0)
                GOTO(out_ucred, rc);
 
-       if (req_capsule_get_size(info->mti_pill, &RMF_CAPA1, RCL_CLIENT))
-               mdt_set_capainfo(info, 0, &info->mti_body->mbo_fid1,
-                           req_capsule_client_get(info->mti_pill, &RMF_CAPA1));
-
        /* Detect out-of range masks */
        if ((hss->hss_setmask | hss->hss_clearmask) & ~HSM_FLAGS_MASK) {
                CDEBUG(D_HSM, "Incompatible masks provided (set "LPX64
@@ -402,11 +393,6 @@ int mdt_hsm_action(struct tgt_session_info *tsi)
        if (rc)
                GOTO(out, rc = err_serious(rc));
 
-       if (req_capsule_get_size(tsi->tsi_pill, &RMF_CAPA1, RCL_CLIENT))
-               mdt_set_capainfo(info, 0, &info->mti_body->mbo_fid1,
-                                req_capsule_client_get(info->mti_pill,
-                                                       &RMF_CAPA1));
-
        /* Coordinator information */
        hal_size = sizeof(*hal) +
                   cfs_size_round(MTI_NAME_MAXLEN) /* fsname */ +
index ddbe9d4..61816a0 100644 (file)
@@ -200,15 +200,6 @@ struct mdt_device {
 
         struct upcall_cache        *mdt_identity_cache;
 
-       /* capability keys */
-       unsigned long              mdt_capa_timeout;
-       __u32                      mdt_capa_alg;
-       struct dt_object          *mdt_ck_obj;
-       unsigned long              mdt_ck_timeout;
-       unsigned long              mdt_ck_expiry;
-       struct timer_list          mdt_ck_timer;
-       struct ptlrpc_thread       mdt_ck_thread;
-       struct lustre_capa_key     mdt_capa_keys[2];
        unsigned int               mdt_capa_conf:1,
                                   /* Enable remote dir on non-MDT0 */
                                   mdt_enable_remote_dir:1;
@@ -429,7 +420,6 @@ struct mdt_thread_info {
        loff_t                     mti_off;
        struct lu_buf              mti_buf;
        struct lu_buf              mti_big_buf;
-       struct lustre_capa_key     mti_capa_key;
 
         /* Ops object filename */
         struct lu_name             mti_name;
@@ -1024,15 +1014,6 @@ void mdt_rename_counter_tally(struct mdt_thread_info *info,
                              struct ptlrpc_request *req,
                              struct mdt_object *src, struct mdt_object *tgt);
 
-/* Capability */
-int mdt_ck_thread_start(struct mdt_device *mdt);
-void mdt_ck_thread_stop(struct mdt_device *mdt);
-void mdt_ck_timer_callback(unsigned long castmeharder);
-int mdt_capa_keys_init(const struct lu_env *env, struct mdt_device *mdt);
-void mdt_set_capainfo(struct mdt_thread_info *info, int offset,
-                     const struct lu_fid *fid, struct lustre_capa *capa);
-void mdt_dump_capainfo(struct mdt_thread_info *info);
-
 static inline struct obd_device *mdt2obd_dev(const struct mdt_device *mdt)
 {
        return mdt->mdt_lu_dev.ld_obd;
index c724cc9..bef58a9 100644 (file)
@@ -699,11 +699,8 @@ int mdt_fix_reply(struct mdt_thread_info *info)
                acl_size = 0;
        }
 
-        CDEBUG(D_INFO, "Shrink to md_size = %d cookie/acl_size = %d"
-              " MDSCAPA = %llx, OSSCAPA = %llx\n",
-              md_size, acl_size,
-              (unsigned long long)(body->mbo_valid & OBD_MD_FLMDSCAPA),
-              (unsigned long long)(body->mbo_valid & OBD_MD_FLOSSCAPA));
+       CDEBUG(D_INFO, "Shrink to md_size = %d cookie/acl_size = %d\n",
+              md_size, acl_size);
 /*
             &RMF_MDT_BODY,
             &RMF_MDT_MD,
@@ -803,7 +800,6 @@ int mdt_handle_last_unlink(struct mdt_thread_info *info, struct mdt_object *mo,
 {
         struct mdt_body       *repbody;
         const struct lu_attr *la = &ma->ma_attr;
-        int rc;
         ENTRY;
 
         repbody = req_capsule_server_get(info->mti_pill, &RMF_MDT_BODY);
@@ -818,21 +814,6 @@ int mdt_handle_last_unlink(struct mdt_thread_info *info, struct mdt_object *mo,
         }
        repbody->mbo_eadatasize = 0;
 
-       if (info->mti_mdt->mdt_lut.lut_oss_capa &&
-           exp_connect_flags(info->mti_exp) & OBD_CONNECT_OSS_CAPA &&
-           repbody->mbo_valid & OBD_MD_FLEASIZE) {
-                struct lustre_capa *capa;
-
-                capa = req_capsule_server_get(info->mti_pill, &RMF_CAPA2);
-                LASSERT(capa);
-                capa->lc_opc = CAPA_OPC_OSS_DESTROY;
-                rc = mo_capa_get(info->mti_env, mdt_object_child(mo), capa, 0);
-                if (rc)
-                        RETURN(rc);
-
-               repbody->mbo_valid |= OBD_MD_FLOSSCAPA;
-        }
-
         RETURN(0);
 }
 
@@ -883,47 +864,6 @@ static __u64 mdt_attr_valid_xlate(__u64 in, struct mdt_reint_record *rr,
        return out;
 }
 
-void mdt_set_capainfo(struct mdt_thread_info *info, int offset,
-                     const struct lu_fid *fid, struct lustre_capa *capa)
-{
-       struct lu_capainfo *lci;
-
-       LASSERT(offset >= 0 && offset < LU_CAPAINFO_MAX);
-       if (!info->mti_mdt->mdt_lut.lut_mds_capa ||
-           !(exp_connect_flags(info->mti_exp) & OBD_CONNECT_MDS_CAPA))
-               return;
-
-       lci = lu_capainfo_get(info->mti_env);
-       LASSERT(lci);
-       lci->lci_fid[offset]  = *fid;
-       lci->lci_capa[offset] = capa;
-}
-
-#ifdef DEBUG_CAPA
-void mdt_dump_capainfo(struct mdt_thread_info *info)
-{
-       struct lu_capainfo *lci = lu_capainfo_get(info->mti_env);
-       int i;
-
-       if (lci == NULL)
-               return;
-
-       for (i = 0; i < LU_CAPAINFO_MAX; i++) {
-               if (lci->lci_capa[i] == NULL) {
-                       CERROR("no capa for index %d "DFID"\n",
-                              i, PFID(&lci->lci_fid[i]));
-                       continue;
-               }
-               if (lci->lci_capa[i] == BYPASS_CAPA) {
-                       CERROR("bypass for index %d "DFID"\n",
-                              i, PFID(&lci->lci_fid[i]));
-                       continue;
-               }
-               DEBUG_CAPA(D_ERROR, lci->lci_capa[i], "index %d", i);
-       }
-}
-#endif /* DEBUG_CAPA */
-
 /* unpacking */
 
 int mdt_name_unpack(struct req_capsule *pill,
@@ -1016,10 +956,6 @@ static int mdt_setattr_unpack_rec(struct mdt_thread_info *info)
        else
                ma->ma_attr_flags &= ~MDS_HSM_RELEASE;
 
-       if (req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
-               mdt_set_capainfo(info, 0, rr->rr_fid1,
-                                req_capsule_client_get(pill, &RMF_CAPA1));
-
        RETURN(0);
 }
 
@@ -1168,11 +1104,6 @@ static int mdt_create_unpack(struct mdt_thread_info *info)
         memset(&sp->u, 0, sizeof(sp->u));
         sp->sp_cr_flags = get_mrc_cr_flags(rec);
 
-        if (req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
-                mdt_set_capainfo(info, 0, rr->rr_fid1,
-                                 req_capsule_client_get(pill, &RMF_CAPA1));
-        mdt_set_capainfo(info, 1, rr->rr_fid2, BYPASS_CAPA);
-
        rc = mdt_name_unpack(pill, &RMF_NAME, &rr->rr_name, 0);
        if (rc < 0)
                RETURN(rc);
@@ -1234,13 +1165,6 @@ static int mdt_link_unpack(struct mdt_thread_info *info)
         attr->la_mtime = rec->lk_time;
         attr->la_valid = LA_UID | LA_GID | LA_CTIME | LA_MTIME;
 
-        if (req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
-                mdt_set_capainfo(info, 0, rr->rr_fid1,
-                                 req_capsule_client_get(pill, &RMF_CAPA1));
-        if (req_capsule_get_size(pill, &RMF_CAPA2, RCL_CLIENT))
-                mdt_set_capainfo(info, 1, rr->rr_fid2,
-                                 req_capsule_client_get(pill, &RMF_CAPA2));
-
        rc = mdt_name_unpack(pill, &RMF_NAME, &rr->rr_name, 0);
        if (rc < 0)
                RETURN(rc);
@@ -1282,10 +1206,6 @@ static int mdt_unlink_unpack(struct mdt_thread_info *info)
         attr->la_mode  = rec->ul_mode;
         attr->la_valid = LA_UID | LA_GID | LA_CTIME | LA_MTIME | LA_MODE;
 
-        if (req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
-                mdt_set_capainfo(info, 0, rr->rr_fid1,
-                                 req_capsule_client_get(pill, &RMF_CAPA1));
-
        rc = mdt_name_unpack(pill, &RMF_NAME, &rr->rr_name, 0);
        if (rc < 0)
                RETURN(rc);
@@ -1340,13 +1260,6 @@ static int mdt_rename_unpack(struct mdt_thread_info *info)
         attr->la_mode = rec->rn_mode;
         attr->la_valid = LA_UID | LA_GID | LA_CTIME | LA_MTIME | LA_MODE;
 
-        if (req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
-                mdt_set_capainfo(info, 0, rr->rr_fid1,
-                                 req_capsule_client_get(pill, &RMF_CAPA1));
-        if (req_capsule_get_size(pill, &RMF_CAPA2, RCL_CLIENT))
-                mdt_set_capainfo(info, 1, rr->rr_fid2,
-                                 req_capsule_client_get(pill, &RMF_CAPA2));
-
        rc = mdt_name_unpack(pill, &RMF_NAME, &rr->rr_name, 0);
        if (rc < 0)
                RETURN(rc);
@@ -1436,24 +1349,6 @@ static int mdt_open_unpack(struct mdt_thread_info *info)
 
         info->mti_cross_ref = !!(rec->cr_bias & MDS_CROSS_REF);
 
-        if (req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
-                mdt_set_capainfo(info, 0, rr->rr_fid1,
-                                 req_capsule_client_get(pill, &RMF_CAPA1));
-        if (req_is_replay(req) &&
-            req_capsule_get_size(pill, &RMF_CAPA2, RCL_CLIENT)) {
-#if 0
-                mdt_set_capainfo(info, 1, rr->rr_fid2,
-                                 req_capsule_client_get(pill, &RMF_CAPA2));
-#else
-                /*
-                 * FIXME: capa in replay open request might have expired,
-                 * bypass capa check. Security hole?
-                 */
-                mdt_set_capainfo(info, 0, rr->rr_fid1, BYPASS_CAPA);
-                mdt_set_capainfo(info, 1, rr->rr_fid2, BYPASS_CAPA);
-#endif
-        }
-
        mdt_name_unpack(pill, &RMF_NAME, &rr->rr_name, MNF_FIX_ANON);
 
         if (req_capsule_field_present(pill, &RMF_EADATA, RCL_CLIENT)) {
@@ -1513,12 +1408,6 @@ static int mdt_setxattr_unpack(struct mdt_thread_info *info)
         attr->la_size = rec->sx_size;
         attr->la_flags = rec->sx_flags;
 
-        if (req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
-                mdt_set_capainfo(info, 0, rr->rr_fid1,
-                                 req_capsule_client_get(pill, &RMF_CAPA1));
-        else
-                mdt_set_capainfo(info, 0, rr->rr_fid1, BYPASS_CAPA);
-
        rc = mdt_name_unpack(pill, &RMF_NAME, &rr->rr_name, 0);
        if (rc < 0)
                RETURN(rc);
index 8cdae12..667285d 100644 (file)
@@ -409,68 +409,6 @@ out:
 }
 LPROC_SEQ_FOPS_WO_TYPE(mdt, identity_info);
 
-/* for debug only */
-static int mdt_capa_seq_show(struct seq_file *m, void *data)
-{
-       struct obd_device *obd = m->private;
-       struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-       return seq_printf(m, "capability on: %s %s\n",
-                         mdt->mdt_lut.lut_oss_capa ? "oss" : "",
-                         mdt->mdt_lut.lut_mds_capa ? "mds" : "");
-}
-
-static ssize_t
-mdt_capa_seq_write(struct file *file, const char __user *buffer,
-                  size_t count, loff_t *off)
-{
-       struct seq_file   *m = file->private_data;
-       struct obd_device *obd = m->private;
-       struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-       int val, rc;
-
-       rc = lprocfs_write_helper(buffer, count, &val);
-       if (rc)
-               return rc;
-
-       if (val < 0 || val > 3) {
-               CERROR("invalid capability mode, only 0/2/3 is accepted.\n"
-                      " 0:  disable fid capability\n"
-                      " 2:  enable MDS fid capability\n"
-                      " 3:  enable both MDS and OSS fid capability\n");
-               return -EINVAL;
-       }
-
-       /* OSS fid capability needs enable both MDS and OSS fid capability on
-        * MDS */
-       if (val == 1) {
-               CERROR("can't enable OSS fid capability only, you should use "
-                      "'3' to enable both MDS and OSS fid capability.\n");
-               return -EINVAL;
-       }
-
-       spin_lock(&mdt->mdt_lut.lut_flags_lock);
-       mdt->mdt_lut.lut_oss_capa = !!(val & 0x1);
-       mdt->mdt_lut.lut_mds_capa = !!(val & 0x2);
-       spin_unlock(&mdt->mdt_lut.lut_flags_lock);
-       mdt->mdt_capa_conf = 1;
-       LCONSOLE_INFO("MDS %s %s MDS fid capability.\n",
-                     mdt_obd_name(mdt),
-                     mdt->mdt_lut.lut_mds_capa ? "enabled" : "disabled");
-       LCONSOLE_INFO("MDS %s %s OSS fid capability.\n",
-                     mdt_obd_name(mdt),
-                     mdt->mdt_lut.lut_oss_capa ? "enabled" : "disabled");
-       return count;
-}
-LPROC_SEQ_FOPS(mdt_capa);
-
-static int mdt_capa_count_seq_show(struct seq_file *m, void *data)
-{
-       return seq_printf(m, "%d %d\n", capa_count[CAPA_SITE_CLIENT],
-                         capa_count[CAPA_SITE_SERVER]);
-}
-LPROC_SEQ_FOPS_RO(mdt_capa_count);
-
 static int mdt_site_stats_seq_show(struct seq_file *m, void *data)
 {
        struct obd_device *obd = m->private;
@@ -480,60 +418,6 @@ static int mdt_site_stats_seq_show(struct seq_file *m, void *data)
 }
 LPROC_SEQ_FOPS_RO(mdt_site_stats);
 
-static int mdt_capa_timeout_seq_show(struct seq_file *m, void *data)
-{
-       struct obd_device *obd = m->private;
-       struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-       return seq_printf(m, "%lu\n", mdt->mdt_capa_timeout);
-}
-
-static ssize_t
-mdt_capa_timeout_seq_write(struct file *file, const char __user *buffer,
-                          size_t count, loff_t *off)
-{
-       struct seq_file   *m = file->private_data;
-       struct obd_device *obd = m->private;
-       struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-       int val, rc;
-
-       rc = lprocfs_write_helper(buffer, count, &val);
-       if (rc)
-               return rc;
-
-       mdt->mdt_capa_timeout = (unsigned long)val;
-       mdt->mdt_capa_conf = 1;
-       return count;
-}
-LPROC_SEQ_FOPS(mdt_capa_timeout);
-
-static int mdt_ck_timeout_seq_show(struct seq_file *m, void *data)
-{
-       struct obd_device *obd = m->private;
-       struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-       return seq_printf(m, "%lu\n", mdt->mdt_ck_timeout);
-}
-
-static ssize_t
-mdt_ck_timeout_seq_write(struct file *file, const char __user *buffer,
-                        size_t count, loff_t *off)
-{
-       struct seq_file   *m = file->private_data;
-       struct obd_device *obd = m->private;
-       struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-       int val, rc;
-
-       rc = lprocfs_write_helper(buffer, count, &val);
-       if (rc)
-               return rc;
-
-       mdt->mdt_ck_timeout = (unsigned long)val;
-       mdt->mdt_capa_conf = 1;
-       return count;
-}
-LPROC_SEQ_FOPS(mdt_ck_timeout);
-
 #define BUFLEN (UUID_MAX + 4)
 
 static ssize_t
@@ -780,14 +664,6 @@ static struct lprocfs_vars lprocfs_mdt_obd_vars[] = {
          .fops =       &mdt_identity_flush_fops                },
        { .name =       "identity_info",
          .fops =       &mdt_identity_info_fops                 },
-       { .name =       "capa",
-         .fops =       &mdt_capa_fops                          },
-       { .name =       "capa_timeout",
-         .fops =       &mdt_capa_timeout_fops                  },
-       { .name =       "capa_key_timeout",
-         .fops =       &mdt_ck_timeout_fops                    },
-       { .name =       "capa_count",
-         .fops =       &mdt_capa_count_fops                    },
        { .name =       "site_stats",
          .fops =       &mdt_site_stats_fops                    },
        { .name =       "evict_client",
index b092b5a..84f0e7e 100644 (file)
@@ -542,32 +542,6 @@ static int mdt_finish_open(struct mdt_thread_info *info,
                                       exp->exp_target_data.ted_nodemap);
 #endif
 
-       if (info->mti_mdt->mdt_lut.lut_mds_capa &&
-           exp_connect_flags(exp) & OBD_CONNECT_MDS_CAPA) {
-                struct lustre_capa *capa;
-
-                capa = req_capsule_server_get(info->mti_pill, &RMF_CAPA1);
-                LASSERT(capa);
-                capa->lc_opc = CAPA_OPC_MDS_DEFAULT;
-                rc = mo_capa_get(info->mti_env, mdt_object_child(o), capa, 0);
-                if (rc)
-                        RETURN(rc);
-               repbody->mbo_valid |= OBD_MD_FLMDSCAPA;
-        }
-       if (info->mti_mdt->mdt_lut.lut_oss_capa &&
-           exp_connect_flags(exp) & OBD_CONNECT_OSS_CAPA &&
-           S_ISREG(lu_object_attr(&o->mot_obj))) {
-                struct lustre_capa *capa;
-
-                capa = req_capsule_server_get(info->mti_pill, &RMF_CAPA2);
-                LASSERT(capa);
-                capa->lc_opc = CAPA_OPC_OSS_DEFAULT | capa_open_opc(flags);
-                rc = mo_capa_get(info->mti_env, mdt_object_child(o), capa, 0);
-                if (rc)
-                        RETURN(rc);
-               repbody->mbo_valid |= OBD_MD_FLOSSCAPA;
-        }
-
         /*
          * If we are following a symlink, don't open; and do not return open
          * handle for special nodes as client required.
@@ -714,8 +688,6 @@ void mdt_reconstruct_open(struct mdt_thread_info *info,
                        rc = 0;
                } else {
                        if (mdt_object_exists(child)) {
-                               mdt_set_capainfo(info, 1, rr->rr_fid2,
-                                                BYPASS_CAPA);
                                mdt_prep_ma_buf_from_rep(info, child, ma);
                                rc = mdt_attr_get_complex(info, child, ma);
                                if (rc == 0)
@@ -1171,7 +1143,6 @@ static int mdt_cross_open(struct mdt_thread_info *info,
                                goto out;
 
                        mdt_prep_ma_buf_from_rep(info, o, ma);
-                       mdt_set_capainfo(info, 0, fid, BYPASS_CAPA);
                        rc = mdt_attr_get_complex(info, o, ma);
                        if (rc != 0)
                                GOTO(out, rc);
@@ -1353,7 +1324,6 @@ int mdt_reint_open(struct mdt_thread_info *info, struct mdt_lock_handle *lhc)
         if (rc)
                 GOTO(out_child, result = rc);
 
-        mdt_set_capainfo(info, 1, child_fid, BYPASS_CAPA);
         if (result == -ENOENT) {
                /* Create under OBF and .lustre is not permitted */
                if (!fid_is_md_operative(rr->rr_fid1))
index f9260a3..e162279 100644 (file)
@@ -123,9 +123,6 @@ void mdt_fs_cleanup(const struct lu_env *env, struct mdt_device *mdt)
 
         /* Remove transaction callback */
         dt_txn_callback_del(mdt->mdt_bottom, &mdt->mdt_txn_cb);
-        if (mdt->mdt_ck_obj)
-                lu_object_put(env, &mdt->mdt_ck_obj->do_lu);
-        mdt->mdt_ck_obj = NULL;
         EXIT;
 }
 
index bbb20c3..0e66689 100644 (file)
@@ -57,33 +57,6 @@ static inline void mdt_reint_init_ma(struct mdt_thread_info *info,
         ma->ma_valid = 0;
 }
 
-static int mdt_create_pack_capa(struct mdt_thread_info *info, int rc,
-                                struct mdt_object *object,
-                                struct mdt_body *repbody)
-{
-        ENTRY;
-
-        /* for cross-ref mkdir, mds capa has been fetched from remote obj, then
-         * we won't go to below*/
-       if (repbody->mbo_valid & OBD_MD_FLMDSCAPA)
-                RETURN(rc);
-
-       if (rc == 0 && info->mti_mdt->mdt_lut.lut_mds_capa &&
-           exp_connect_flags(info->mti_exp) & OBD_CONNECT_MDS_CAPA) {
-                struct lustre_capa *capa;
-
-                capa = req_capsule_server_get(info->mti_pill, &RMF_CAPA1);
-                LASSERT(capa);
-                capa->lc_opc = CAPA_OPC_MDS_DEFAULT;
-                rc = mo_capa_get(info->mti_env, mdt_object_child(object), capa,
-                                 0);
-                if (rc == 0)
-                       repbody->mbo_valid |= OBD_MD_FLMDSCAPA;
-        }
-
-        RETURN(rc);
-}
-
 /**
  * Get version of object by fid.
  *
@@ -400,10 +373,6 @@ static int mdt_md_create(struct mdt_thread_info *info)
 
                ma->ma_need = MA_INODE;
                 ma->ma_valid = 0;
-                /* capa for cross-ref will be stored here */
-                ma->ma_capa = req_capsule_server_get(info->mti_pill,
-                                                     &RMF_CAPA1);
-                LASSERT(ma->ma_capa);
 
                 mdt_fail_write(info->mti_env, info->mti_mdt->mdt_bottom,
                                OBD_FAIL_MDS_REINT_CREATE_WRITE);
@@ -437,11 +406,9 @@ static int mdt_md_create(struct mdt_thread_info *info)
                                                   mdt_object_fid(child));
                }
 out_put_child:
-               mdt_create_pack_capa(info, rc, child, repbody);
                mdt_object_put(info->mti_env, child);
        } else {
                rc = PTR_ERR(child);
-               mdt_create_pack_capa(info, rc, NULL, repbody);
        }
 unlock_parent:
        mdt_object_unlock(info, parent, lh, rc);
@@ -749,21 +716,6 @@ static int mdt_reint_setattr(struct mdt_thread_info *info,
 
        mdt_pack_attr2body(info, repbody, &ma->ma_attr, mdt_object_fid(mo));
 
-       if (info->mti_mdt->mdt_lut.lut_oss_capa &&
-           exp_connect_flags(info->mti_exp) & OBD_CONNECT_OSS_CAPA &&
-           S_ISREG(lu_object_attr(&mo->mot_obj)) &&
-           (ma->ma_attr.la_valid & LA_SIZE)) {
-                struct lustre_capa *capa;
-
-                capa = req_capsule_server_get(info->mti_pill, &RMF_CAPA2);
-                LASSERT(capa);
-                capa->lc_opc = CAPA_OPC_OSS_DEFAULT | CAPA_OPC_OSS_TRUNC;
-                rc = mo_capa_get(info->mti_env, mdt_object_child(mo), capa, 0);
-                if (rc)
-                        GOTO(out_put, rc);
-               repbody->mbo_valid |= OBD_MD_FLOSSCAPA;
-        }
-
         EXIT;
 out_put:
         mdt_object_put(info->mti_env, mo);
@@ -944,7 +896,6 @@ static int mdt_reint_unlink(struct mdt_thread_info *info,
 
                        ma->ma_need = MA_INODE;
                        ma->ma_valid = 0;
-                       mdt_set_capainfo(info, 1, child_fid, BYPASS_CAPA);
                        rc = mdo_unlink(info->mti_env, mdt_object_child(mp),
                                        NULL, &rr->rr_name, ma, no_name);
                        GOTO(put_child, rc);
@@ -996,8 +947,6 @@ static int mdt_reint_unlink(struct mdt_thread_info *info,
        /* save version when object is locked */
        mdt_version_get_save(info, mc, 1);
 
-       mdt_set_capainfo(info, 1, child_fid, BYPASS_CAPA);
-
        mutex_lock(&mc->mot_lov_mutex);
 
        rc = mdo_unlink(info->mti_env, mdt_object_child(mp),
@@ -1799,7 +1748,6 @@ static int mdt_reint_rename_internal(struct mdt_thread_info *info,
        tgt_vbr_obj_set(info->mti_env, mdt_obj2dt(mold));
        /* save version after locking */
        mdt_version_get_save(info, mold, 2);
-       mdt_set_capainfo(info, 2, old_fid, BYPASS_CAPA);
 
        /* step 4: find & lock the new object. */
        /* new target object may not exist now */
@@ -1872,7 +1820,6 @@ static int mdt_reint_rename_internal(struct mdt_thread_info *info,
 
                /* get and save version after locking */
                mdt_version_get_save(info, mnew, 3);
-               mdt_set_capainfo(info, 3, new_fid, BYPASS_CAPA);
        } else if (rc != -EREMOTE && rc != -ENOENT) {
                GOTO(out_put_old, rc);
        } else {
index 5ce98a6..d804de4 100644 (file)
@@ -72,7 +72,7 @@ int class_dentry_readdir(const struct lu_env *env,
        LASSERT(dir->do_index_ops);
 
        iops = &dir->do_index_ops->dio_it;
-       it = iops->init(env, dir, LUDA_64BITHASH, BYPASS_CAPA);
+       it = iops->init(env, dir, LUDA_64BITHASH);
        if (IS_ERR(it))
                RETURN(PTR_ERR(it));
 
index 7a756f5..9ad0a94 100644 (file)
@@ -203,10 +203,10 @@ EXPORT_SYMBOL(dt_mode_to_dft);
 int dt_lookup_dir(const struct lu_env *env, struct dt_object *dir,
                   const char *name, struct lu_fid *fid)
 {
-        if (dt_try_as_dir(env, dir))
-                return dt_lookup(env, dir, (struct dt_rec *)fid,
-                                 (const struct dt_key *)name, BYPASS_CAPA);
-        return -ENOTDIR;
+       if (dt_try_as_dir(env, dir))
+               return dt_lookup(env, dir, (struct dt_rec *)fid,
+                                (const struct dt_key *)name);
+       return -ENOTDIR;
 }
 EXPORT_SYMBOL(dt_lookup_dir);
 
@@ -448,8 +448,8 @@ void dt_global_fini(void)
 int dt_read(const struct lu_env *env, struct dt_object *dt,
             struct lu_buf *buf, loff_t *pos)
 {
-        LASSERTF(dt != NULL, "dt is NULL when we want to read record\n");
-        return dt->do_body_ops->dbo_read(env, dt, buf, pos, BYPASS_CAPA);
+       LASSERTF(dt != NULL, "dt is NULL when we want to read record\n");
+       return dt->do_body_ops->dbo_read(env, dt, buf, pos);
 }
 EXPORT_SYMBOL(dt_read);
 
@@ -473,8 +473,7 @@ int dt_record_read(const struct lu_env *env, struct dt_object *dt,
 
        LASSERTF(dt != NULL, "dt is NULL when we want to read record\n");
 
-       size = dt->do_body_ops->dbo_read(env, dt, buf, pos, BYPASS_CAPA);
-
+       size = dt->do_body_ops->dbo_read(env, dt, buf, pos);
        if (size < 0)
                return size;
        return (size == (ssize_t)buf->lb_len) ? 0 : -EFAULT;
@@ -491,8 +490,7 @@ int dt_record_write(const struct lu_env *env, struct dt_object *dt,
        LASSERT(dt->do_body_ops);
        LASSERT(dt->do_body_ops->dbo_write);
 
-       size = dt->do_body_ops->dbo_write(env, dt, buf, pos, th, BYPASS_CAPA, 1);
-
+       size = dt->do_body_ops->dbo_write(env, dt, buf, pos, th, 1);
        if (size < 0)
                return size;
        return (size == (ssize_t)buf->lb_len) ? 0 : -EFAULT;
@@ -524,7 +522,7 @@ void dt_version_set(const struct lu_env *env, struct dt_object *o,
         vbuf.lb_buf = &version;
         vbuf.lb_len = sizeof(version);
 
-        rc = dt_xattr_set(env, o, &vbuf, xname, 0, th, BYPASS_CAPA);
+       rc = dt_xattr_set(env, o, &vbuf, xname, 0, th);
         if (rc < 0)
                 CDEBUG(D_INODE, "Can't set version, rc %d\n", rc);
         return;
@@ -541,7 +539,7 @@ dt_obj_version_t dt_version_get(const struct lu_env *env, struct dt_object *o)
         LASSERT(o);
         vbuf.lb_buf = &version;
         vbuf.lb_len = sizeof(version);
-        rc = dt_xattr_get(env, o, &vbuf, xname, BYPASS_CAPA);
+       rc = dt_xattr_get(env, o, &vbuf, xname);
         if (rc != sizeof(version)) {
                 CDEBUG(D_INODE, "Can't get version, rc %d\n", rc);
                 version = 0;
@@ -799,7 +797,7 @@ int dt_index_walk(const struct lu_env *env, struct dt_object *obj,
        /* Iterate through index and fill containers from @rdpg */
        iops = &obj->do_index_ops->dio_it;
        LASSERT(iops != NULL);
-       it = iops->init(env, obj, rdpg->rp_attrs, BYPASS_CAPA);
+       it = iops->init(env, obj, rdpg->rp_attrs);
        if (IS_ERR(it))
                RETURN(PTR_ERR(it));
 
index a084301..5d3e246 100644 (file)
@@ -199,7 +199,7 @@ static int llog_osd_read_header(const struct lu_env *env,
 
        lgi = llog_info(env);
 
-       rc = dt_attr_get(env, o, &lgi->lgi_attr, NULL);
+       rc = dt_attr_get(env, o, &lgi->lgi_attr);
        if (rc)
                RETURN(rc);
 
@@ -365,7 +365,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
        if (reclen > LLOG_CHUNK_SIZE)
                RETURN(-E2BIG);
 
-       rc = dt_attr_get(env, o, &lgi->lgi_attr, NULL);
+       rc = dt_attr_get(env, o, &lgi->lgi_attr);
        if (rc)
                RETURN(rc);
 
@@ -526,7 +526,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
                GOTO(out, rc);
 
        header_is_updated = true;
-       rc = dt_attr_get(env, o, &lgi->lgi_attr, NULL);
+       rc = dt_attr_get(env, o, &lgi->lgi_attr);
        if (rc)
                GOTO(out, rc);
 
@@ -664,7 +664,7 @@ static int llog_osd_next_block(const struct lu_env *env,
        dt = lu2dt_dev(o->do_lu.lo_dev);
        LASSERT(dt);
 
-       rc = dt_attr_get(env, o, &lgi->lgi_attr, BYPASS_CAPA);
+       rc = dt_attr_get(env, o, &lgi->lgi_attr);
        if (rc)
                GOTO(out, rc);
 
@@ -802,7 +802,7 @@ static int llog_osd_prev_block(const struct lu_env *env,
        cur_offset = LLOG_CHUNK_SIZE;
        llog_skip_over(&cur_offset, 0, prev_idx);
 
-       rc = dt_attr_get(env, o, &lgi->lgi_attr, BYPASS_CAPA);
+       rc = dt_attr_get(env, o, &lgi->lgi_attr);
        if (rc)
                GOTO(out, rc);
 
@@ -1166,7 +1166,7 @@ static int llog_osd_create(const struct lu_env *env, struct llog_handle *res,
                dt_read_lock(env, llog_dir, 0);
                rc = dt_insert(env, llog_dir, (struct dt_rec *)rec,
                               (struct dt_key *)res->lgh_name,
-                              th, BYPASS_CAPA, 1);
+                              th, 1);
                dt_read_unlock(env, llog_dir);
                lu_object_put(env, &llog_dir->do_lu);
                if (rc)
@@ -1280,7 +1280,7 @@ static int llog_osd_destroy(const struct lu_env *env,
                        dt_read_lock(env, llog_dir, 0);
                        rc = dt_delete(env, llog_dir,
                                       (struct dt_key *) name,
-                                      th, BYPASS_CAPA);
+                                      th);
                        dt_read_unlock(env, llog_dir);
                        if (rc) {
                                CERROR("%s: can't remove llog %s: rc = %d\n",
@@ -1475,7 +1475,7 @@ out_trans:
                        GOTO(out, rc);
        }
 
-       rc = dt_attr_get(env, o, &lgi->lgi_attr, BYPASS_CAPA);
+       rc = dt_attr_get(env, o, &lgi->lgi_attr);
        if (rc)
                GOTO(out, rc);
 
@@ -1562,7 +1562,7 @@ int llog_osd_put_cat_list(const struct lu_env *env, struct dt_device *d,
        if (!dt_object_exists(o))
                GOTO(out, rc = -ENOENT);
 
-       rc = dt_attr_get(env, o, &lgi->lgi_attr, BYPASS_CAPA);
+       rc = dt_attr_get(env, o, &lgi->lgi_attr);
        if (rc)
                GOTO(out, rc);
 
index eaa63cc..902bbaa 100644 (file)
@@ -886,7 +886,7 @@ static int llog_truncate(const struct lu_env *env, struct dt_object *o)
        d = lu2dt_dev(o->do_lu.lo_dev);
        LASSERT(d);
 
-       rc = dt_attr_get(env, o, &la, NULL);
+       rc = dt_attr_get(env, o, &la);
        if (rc)
                RETURN(rc);
 
@@ -915,11 +915,11 @@ static int llog_truncate(const struct lu_env *env, struct dt_object *o)
        if (rc)
                GOTO(stop, rc);
 
-       rc = dt_punch(env, o, la.la_size, OBD_OBJECT_EOF, th, BYPASS_CAPA);
+       rc = dt_punch(env, o, la.la_size, OBD_OBJECT_EOF, th);
        if (rc)
                GOTO(stop, rc);
 
-       rc = dt_attr_set(env, o, &la, th, BYPASS_CAPA);
+       rc = dt_attr_set(env, o, &la, th);
        if (rc)
                GOTO(stop, rc);
 
index 2cc4afe..d183adf 100644 (file)
@@ -368,14 +368,14 @@ static struct dt_object *__local_file_create(const struct lu_env *env,
                rec->rec_fid = fid;
                /* Add "." and ".." for newly created dir */
                rc = dt_insert(env, dto, (const struct dt_rec *)rec,
-                              (const struct dt_key *)".", th, BYPASS_CAPA, 1);
+                              (const struct dt_key *)".", th, 1);
                if (rc != 0)
                        GOTO(destroy, rc);
 
                dt_ref_add(env, dto, th);
                rec->rec_fid = lu_object_fid(&parent->do_lu);
                rc = dt_insert(env, dto, (const struct dt_rec *)rec,
-                              (const struct dt_key *)"..", th, BYPASS_CAPA, 1);
+                              (const struct dt_key *)"..", th, 1);
                if (rc != 0)
                        GOTO(destroy, rc);
        }
@@ -384,7 +384,7 @@ static struct dt_object *__local_file_create(const struct lu_env *env,
        rec->rec_type = dto->do_lu.lo_header->loh_attr;
        dt_write_lock(env, parent, 0);
        rc = dt_insert(env, parent, (const struct dt_rec *)rec,
-                      (const struct dt_key *)name, th, BYPASS_CAPA, 1);
+                      (const struct dt_key *)name, th, 1);
        if (dti->dti_dof.dof_type == DFT_DIR)
                dt_ref_add(env, parent, th);
        dt_write_unlock(env, parent);
@@ -640,7 +640,7 @@ int local_object_unlink(const struct lu_env *env, struct dt_device *dt,
                GOTO(stop, rc);
 
        dt_write_lock(env, dto, 0);
-       rc = dt_delete(env, parent, (struct dt_key *)name, th, BYPASS_CAPA);
+       rc = dt_delete(env, parent, (struct dt_key *)name, th);
        if (rc < 0)
                GOTO(unlock, rc);
 
@@ -651,7 +651,7 @@ int local_object_unlink(const struct lu_env *env, struct dt_device *dt,
                rec->rec_fid = &dti->dti_fid;
                rec->rec_type = dto->do_lu.lo_header->loh_attr;
                rc = dt_insert(env, parent, (const struct dt_rec *)rec,
-                              (const struct dt_key *)name, th, BYPASS_CAPA, 1);
+                              (const struct dt_key *)name, th, 1);
                GOTO(unlock, rc);
        }
 
index 5386975..107fab1 100644 (file)
@@ -402,8 +402,7 @@ static int echo_preprw(const struct lu_env *env, int cmd,
                       struct obd_export *export, struct obdo *oa,
                       int objcount, struct obd_ioobj *obj,
                       struct niobuf_remote *nb, int *pages,
-                      struct niobuf_local *res, struct obd_trans_info *oti,
-                      struct lustre_capa *unused)
+                      struct niobuf_local *res, struct obd_trans_info *oti)
 {
         struct obd_device *obd;
         int tot_bytes = 0;
index bc7b834..d830b43 100644 (file)
@@ -2454,7 +2454,7 @@ static int echo_client_prep_commit(const struct lu_env *env,
 
                 lpages = npages;
                ret = obd_preprw(env, rw, exp, oa, 1, &ioo, rnb, &lpages,
-                                 lnb, oti, NULL);
+                                lnb, oti);
                 if (ret != 0)
                         GOTO(out, ret);
                 LASSERT(lpages == npages);
index 2d5aa43..3d624f9 100644 (file)
@@ -1,7 +1,7 @@
 MODULES := ofd
 
 ofd-objs := ofd_dev.o ofd_obd.o ofd_fs.o ofd_trans.o ofd_objects.o ofd_io.o
-ofd-objs += lproc_ofd.o ofd_capa.o ofd_fmd.o ofd_grant.o ofd_dlm.o ofd_lvb.o
+ofd-objs += lproc_ofd.o ofd_fmd.o ofd_grant.o ofd_dlm.o ofd_lvb.o
 
 EXTRA_DIST = $(ofd-objs:%.o=%.c) ofd_internal.h
 
index 72f5e45..65b57f3 100644 (file)
@@ -414,78 +414,6 @@ ofd_fmd_max_age_seq_write(struct file *file, const char __user *buffer,
 LPROC_SEQ_FOPS(ofd_fmd_max_age);
 
 /**
- * Show if OSS FID capability is enabled or disabled
- *
- * \param[in] m                seq_file handle
- * \param[in] data     unused for single entry
- *
- * \retval             0 on success
- * \retval             negative value on error
- */
-static int ofd_capa_seq_show(struct seq_file *m, void *data)
-{
-       struct obd_device       *obd = m->private;
-
-       return seq_printf(m, "capability on: %s\n",
-                         obd->u.filter.fo_fl_oss_capa ? "oss" : "");
-}
-
-/**
- * Enable or disable OSS FID capability mode.
- *
- * \param[in] file     proc file
- * \param[in] buffer   string which represents mode
- *                     1: enable mode
- *                     0: disable mode
- * \param[in] count    \a buffer length
- * \param[in] off      unused for single entry
- *
- * \retval             \a count on success
- * \retval             negative number on error
- */
-static ssize_t
-ofd_capa_seq_write(struct file *file, const char *__user buffer, size_t count,
-                  loff_t *off)
-{
-       struct seq_file         *m = file->private_data;
-       struct obd_device       *obd = m->private;
-       int                      val, rc;
-
-       rc = lprocfs_write_helper(buffer, count, &val);
-       if (rc)
-               return rc;
-
-       if (val & ~0x1) {
-               CERROR("invalid capability mode, only 0/1 are accepted.\n"
-                      " 1: enable oss fid capability\n"
-                      " 0: disable oss fid capability\n");
-               return -EINVAL;
-       }
-
-       obd->u.filter.fo_fl_oss_capa = val;
-       LCONSOLE_INFO("OSS %s %s fid capability.\n", obd->obd_name,
-                     val ? "enabled" : "disabled");
-       return count;
-}
-LPROC_SEQ_FOPS(ofd_capa);
-
-/**
- * Show capability count on client and server side.
- *
- * \param[in] m                seq_file handle
- * \param[in] data     unused for single entry
- *
- * \retval             0 on success
- * \retval             negative value on error
- */
-static int ofd_capa_count_seq_show(struct seq_file *m, void *data)
-{
-       return seq_printf(m, "%d %d\n", capa_count[CAPA_SITE_CLIENT],
-                         capa_count[CAPA_SITE_SERVER]);
-}
-LPROC_SEQ_FOPS_RO(ofd_capa_count);
-
-/**
  * Show if the OFD is in degraded mode.
  *
  * Degraded means OFD has a failed drive or is undergoing RAID rebuild.
@@ -1042,10 +970,6 @@ struct lprocfs_vars lprocfs_ofd_obd_vars[] = {
          .fops =       &ofd_fmd_max_num_fops           },
        { .name =       "client_cache_seconds",
          .fops =       &ofd_fmd_max_age_fops           },
-       { .name =       "capa",
-         .fops =       &ofd_capa_fops                  },
-       { .name =       "capa_count",
-         .fops =       &ofd_capa_count_fops            },
        { .name =       "job_cleanup_interval",
          .fops =       &ofd_job_interval_fops          },
        { .name =       "soft_sync_limit",
diff --git a/lustre/ofd/ofd_capa.c b/lustre/ofd/ofd_capa.c
deleted file mode 100644 (file)
index 34be763..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.gnu.org/licenses/gpl-2.0.html
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, 2014 Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/ofd/ofd_capa.c
- *
- * This file provides helper functions for Lustre capability key management and
- * capability authentication. A capability is a token of authority, which is
- * distributed by MDT to client upon open/lookup/getattr/setattr and unlink
- * (this is not needed for new servers because destroying objects on OST is
- * originated from MDT, which doesn't need capability), and will be packed
- * into subsequent requests to MDT and OST. Capability key is shared by MDT and
- * OST, which is used to sign and authenticate capability (HMAC algorithm).
- *
- * Author: Lai Siyao <lai.siyao@intel.com>
- */
-
-#define DEBUG_SUBSYSTEM S_FILTER
-
-#include "ofd_internal.h"
-
-static inline __u32 ofd_ck_keyid(struct filter_capa_key *key)
-{
-       return key->k_key.lk_keyid;
-}
-
-/**
- * Update capability key
- *
- * A new capability key is received from MDT, because MDT only uses the
- * latest key to sign capability, OFD caches the latest two keys in case client
- * still helds capability signed with old key.
- *
- * \param[in] ofd      OFD device
- * \param[in] new      new capability key
- * \retval             0 on success
- * \retval             negative number on error
- */
-int ofd_update_capa_key(struct ofd_device *ofd, struct lustre_capa_key *new)
-{
-       struct obd_device       *obd = ofd_obd(ofd);
-       struct filter_capa_key  *k, *keys[2] = { NULL, NULL };
-       int                      i;
-
-       spin_lock(&capa_lock);
-       list_for_each_entry(k, &obd->u.filter.fo_capa_keys, k_list) {
-               if (k->k_key.lk_seq != new->lk_seq)
-                       continue;
-
-               if (keys[0]) {
-                       keys[1] = k;
-                       if (ofd_ck_keyid(keys[1]) > ofd_ck_keyid(keys[0]))
-                               keys[1] = keys[0], keys[0] = k;
-               } else {
-                       keys[0] = k;
-               }
-       }
-       spin_unlock(&capa_lock);
-
-       for (i = 0; i < 2; i++) {
-               if (!keys[i])
-                       continue;
-               if (ofd_ck_keyid(keys[i]) != new->lk_keyid)
-                       continue;
-               /* maybe because of recovery or other reasons, MDS sent the
-                * the old capability key again.
-                */
-               spin_lock(&capa_lock);
-               keys[i]->k_key = *new;
-               spin_unlock(&capa_lock);
-
-               RETURN(0);
-       }
-
-       if (keys[1]) {
-               /* if OSS already have two keys, update the old one */
-               k = keys[1];
-       } else {
-               OBD_ALLOC_PTR(k);
-               if (!k)
-                       RETURN(-ENOMEM);
-               INIT_LIST_HEAD(&k->k_list);
-       }
-
-       spin_lock(&capa_lock);
-       k->k_key = *new;
-       if (list_empty(&k->k_list))
-               list_add(&k->k_list, &obd->u.filter.fo_capa_keys);
-       spin_unlock(&capa_lock);
-
-       DEBUG_CAPA_KEY(D_SEC, new, "new");
-       RETURN(0);
-}
-
-/**
- * Authenticate capability
- *
- * OFD authenticate the capability packed in client request. Firstly, it will
- * lookup from local cache, if found, compare with it, otherwise sign it with
- * capability key to validate it. If the capability is valid, it will be added
- * into local cache for later use.
- *
- * \param[in] exp      export for the client
- * \param[in] fid      master fid (on MDT) of the file
- * \param[in] seq      OST sequence extracted from master fid
- * \param[in] capa     capability extracted from client request
- * \param[in] opc      opcode the caller requested
- * \retval             0 on success
- * \retval             negative number on error
- */
-int ofd_auth_capa(struct obd_export *exp, const struct lu_fid *fid,
-                 u64 seq, struct lustre_capa *capa, __u64 opc)
-{
-       struct filter_obd       *filter = &exp->exp_obd->u.filter;
-       struct filter_capa_key  *k;
-       struct lustre_capa_key   key;
-       struct obd_capa         *oc;
-       __u8                    *hmac;
-       int                      keys_ready = 0, key_found = 0, rc = 0;
-
-       ENTRY;
-
-       /* skip capa check for llog and obdecho */
-       if (!fid_seq_is_mdt(seq))
-               RETURN(0);
-
-       /* capability is disabled */
-       if (!filter->fo_fl_oss_capa)
-               RETURN(0);
-
-       if (!(exp_connect_flags(exp) & OBD_CONNECT_OSS_CAPA))
-               RETURN(0);
-
-       if (capa == NULL) {
-               if (fid)
-                       CERROR("seq/fid/opc "LPU64"/"DFID"/"LPX64
-                              ": no capability has been passed\n",
-                              seq, PFID(fid), opc);
-               else
-                       CERROR("seq/opc "LPU64"/"LPX64
-                              ": no capability has been passed\n",
-                              seq, opc);
-               RETURN(-EACCES);
-       }
-
-       if (opc == CAPA_OPC_OSS_READ) {
-               if (!(capa->lc_opc & CAPA_OPC_OSS_RW))
-                       rc = -EACCES;
-       } else if (!capa_opc_supported(capa, opc)) {
-               rc = -EACCES;
-       }
-
-       if (rc) {
-               DEBUG_CAPA(D_ERROR, capa, "opc "LPX64" not supported by", opc);
-               RETURN(rc);
-       }
-
-       oc = capa_lookup(filter->fo_capa_hash, capa, 0);
-       if (oc) {
-               spin_lock(&oc->c_lock);
-               if (capa_is_expired(oc)) {
-                       DEBUG_CAPA(D_ERROR, capa, "expired");
-                       rc = -ESTALE;
-               }
-               spin_unlock(&oc->c_lock);
-
-               capa_put(oc);
-               RETURN(rc);
-       }
-
-       if (capa_is_expired_sec(capa)) {
-               DEBUG_CAPA(D_ERROR, capa, "expired");
-               RETURN(-ESTALE);
-       }
-
-       spin_lock(&capa_lock);
-       list_for_each_entry(k, &filter->fo_capa_keys, k_list) {
-               if (k->k_key.lk_seq == seq) {
-                       keys_ready = 1;
-                       if (k->k_key.lk_keyid == capa_keyid(capa)) {
-                               key = k->k_key;
-                               key_found = 1;
-                               break;
-                       }
-               }
-       }
-       spin_unlock(&capa_lock);
-
-       if (!keys_ready) {
-               CDEBUG(D_SEC, "MDS hasn't propagated capability keys yet, "
-                      "ignore check!\n");
-               RETURN(0);
-       }
-
-       if (!key_found) {
-               DEBUG_CAPA(D_ERROR, capa, "no matched capability key for");
-               RETURN(-ESTALE);
-       }
-
-       OBD_ALLOC(hmac, CAPA_HMAC_MAX_LEN);
-       if (hmac == NULL)
-               RETURN(-ENOMEM);
-
-       rc = capa_hmac(hmac, capa, key.lk_key);
-       if (rc) {
-               DEBUG_CAPA(D_ERROR, capa, "HMAC failed: rc %d", rc);
-               OBD_FREE(hmac, CAPA_HMAC_MAX_LEN);
-               RETURN(rc);
-       }
-
-       rc = memcmp(hmac, capa->lc_hmac, CAPA_HMAC_MAX_LEN);
-       OBD_FREE(hmac, CAPA_HMAC_MAX_LEN);
-       if (rc) {
-               DEBUG_CAPA_KEY(D_ERROR, &key, "calculate HMAC with ");
-               DEBUG_CAPA(D_ERROR, capa, "HMAC mismatch");
-               RETURN(-EACCES);
-       }
-
-       /* store in capa hash */
-       oc = capa_add(filter->fo_capa_hash, capa);
-       capa_put(oc);
-       RETURN(0);
-}
-
-/**
- * Free capability keys
- *
- * OFD free cached capability keys when OFD device is destroyed.
- *
- *  \param[in] ofd     OFD device
- */
-void ofd_free_capa_keys(struct ofd_device *ofd)
-{
-       struct obd_device       *obd = ofd_obd(ofd);
-       struct filter_capa_key  *key, *n;
-
-       spin_lock(&capa_lock);
-       list_for_each_entry_safe(key, n, &obd->u.filter.fo_capa_keys, k_list) {
-               list_del_init(&key->k_list);
-               OBD_FREE_PTR(key);
-       }
-       spin_unlock(&capa_lock);
-}
index 874e991..e6cfb21 100644 (file)
@@ -899,7 +899,6 @@ static int ofd_set_info_hdl(struct tgt_session_info *tsi)
        void                    *key, *val = NULL;
        int                      keylen, vallen, rc = 0;
        bool                     is_grant_shrink;
-       struct ofd_device       *ofd = ofd_exp(tsi->tsi_exp);
 
        ENTRY;
 
@@ -942,8 +941,6 @@ static int ofd_set_info_hdl(struct tgt_session_info *tsi)
                if (vallen > 0)
                        obd_export_evict_by_nid(tsi->tsi_exp->exp_obd, val);
                rc = 0;
-       } else if (KEY_IS(KEY_CAPA_KEY)) {
-               rc = ofd_update_capa_key(ofd, val);
        } else if (KEY_IS(KEY_SPTLRPC_CONF)) {
                rc = tgt_adapt_sptlrpc_conf(tsi->tsi_tgt, 0);
        } else {
@@ -2757,12 +2754,6 @@ static int ofd_init0(const struct lu_env *env, struct ofd_device *m,
        spin_lock_init(&m->ofd_batch_lock);
        init_rwsem(&m->ofd_lastid_rwsem);
 
-       obd->u.filter.fo_fl_oss_capa = 0;
-       INIT_LIST_HEAD(&obd->u.filter.fo_capa_keys);
-       obd->u.filter.fo_capa_hash = init_capa_hash();
-       if (obd->u.filter.fo_capa_hash == NULL)
-               RETURN(-ENOMEM);
-
        m->ofd_dt_dev.dd_lu_dev.ld_ops = &ofd_lu_ops;
        m->ofd_dt_dev.dd_lu_dev.ld_obd = obd;
        /* set this lu_device to obd, because error handling need it */
@@ -2902,9 +2893,6 @@ static void ofd_fini(const struct lu_env *env, struct ofd_device *m)
        lfsck_degister(env, m->ofd_osd);
        ofd_fs_cleanup(env, m);
 
-       ofd_free_capa_keys(m);
-       cleanup_capa_hash(obd->u.filter.fo_capa_hash);
-
        if (m->ofd_namespace != NULL) {
                ldlm_namespace_free(m->ofd_namespace, NULL,
                                    d->ld_obd->obd_force);
index 0686a6b..be9a4ad 100644 (file)
@@ -403,7 +403,7 @@ struct ofd_seq *ofd_seq_load(const struct lu_env *env, struct ofd_device *ofd,
 
        atomic_set(&oseq->os_refc, 1);
 
-       rc = dt_attr_get(env, dob, &info->fti_attr, BYPASS_CAPA);
+       rc = dt_attr_get(env, dob, &info->fti_attr);
        if (rc)
                GOTO(cleanup, rc);
 
index 386b013..02c71b6 100644 (file)
@@ -42,7 +42,6 @@
 #include <dt_object.h>
 #include <md_object.h>
 #include <lustre_fid.h>
-#include <lustre_capa.h>
 
 #define OFD_INIT_OBJID 0
 #define OFD_PRECREATE_BATCH_DEFAULT (OBJ_SUBDIR_COUNT * 4)
@@ -253,13 +252,6 @@ static inline struct ofd_device *ofd_obj2dev(const struct ofd_object *fo)
        return ofd_dev(fo->ofo_obj.do_lu.lo_dev);
 }
 
-static inline struct lustre_capa *ofd_object_capa(const struct lu_env *env,
-                                                 const struct ofd_object *obj)
-{
-       /* TODO: see mdd_object_capa() */
-       return BYPASS_CAPA;
-}
-
 static inline void ofd_read_lock(const struct lu_env *env,
                                 struct ofd_object *fo)
 {
@@ -333,12 +325,6 @@ struct ofd_thread_info {
 extern void target_recovery_fini(struct obd_device *obd);
 extern void target_recovery_init(struct lu_target *lut, svc_handler_t handler);
 
-/* ofd_capa.c */
-int ofd_update_capa_key(struct ofd_device *ofd, struct lustre_capa_key *key);
-int ofd_auth_capa(struct obd_export *exp, const struct lu_fid *fid,
-                 u64 seq, struct lustre_capa *capa, __u64 opc);
-void ofd_free_capa_keys(struct ofd_device *ofd);
-
 /* ofd_dev.c */
 extern struct lu_context_key ofd_thread_key;
 int ofd_postrecov(const struct lu_env *env, struct ofd_device *ofd);
@@ -382,8 +368,7 @@ int ofd_verify_ff(const struct lu_env *env, struct ofd_object *fo,
 int ofd_preprw(const struct lu_env *env,int cmd, struct obd_export *exp,
               struct obdo *oa, int objcount, struct obd_ioobj *obj,
               struct niobuf_remote *rnb, int *nr_local,
-              struct niobuf_local *lnb, struct obd_trans_info *oti,
-              struct lustre_capa *capa);
+              struct niobuf_local *lnb, struct obd_trans_info *oti);
 int ofd_commitrw(const struct lu_env *env, int cmd, struct obd_export *exp,
                 struct obdo *oa, int objcount, struct obd_ioobj *obj,
                 struct niobuf_remote *rnb, int npages,
index 269a723..f46a916 100644 (file)
@@ -464,7 +464,7 @@ static int ofd_preprw_read(const struct lu_env *env, struct obd_export *exp,
        *nr_local = 0;
        for (i = 0, j = 0; i < niocount; i++) {
                rc = dt_bufs_get(env, ofd_object_child(fo), rnb + i,
-                                lnb + j, 0, ofd_object_capa(env, fo));
+                                lnb + j, 0);
                if (unlikely(rc < 0))
                        GOTO(buf_put, rc);
                LASSERT(rc <= PTLRPC_MAX_BRW_PAGES);
@@ -476,8 +476,7 @@ static int ofd_preprw_read(const struct lu_env *env, struct obd_export *exp,
        }
 
        LASSERT(*nr_local > 0 && *nr_local <= PTLRPC_MAX_BRW_PAGES);
-       rc = dt_attr_get(env, ofd_object_child(fo), la,
-                        ofd_object_capa(env, fo));
+       rc = dt_attr_get(env, ofd_object_child(fo), la);
        if (unlikely(rc))
                GOTO(buf_put, rc);
 
@@ -620,8 +619,7 @@ static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp,
        *nr_local = 0;
        for (i = 0, j = 0; i < obj->ioo_bufcnt; i++) {
                rc = dt_bufs_get(env, ofd_object_child(fo),
-                                rnb + i, lnb + j, 1,
-                                ofd_object_capa(env, fo));
+                                rnb + i, lnb + j, 1);
                if (unlikely(rc < 0))
                        GOTO(err, rc);
                LASSERT(rc <= PTLRPC_MAX_BRW_PAGES);
@@ -677,7 +675,6 @@ out:
  * \param[in] nr_local number of local buffers
  * \param[in] lnb      local buffers
  * \param[in] oti      request data from OST
- * \param[in] capa     capability
  *
  * \retval             0 on successful prepare
  * \retval             negative value on error
@@ -685,8 +682,7 @@ out:
 int ofd_preprw(const struct lu_env *env, int cmd, struct obd_export *exp,
               struct obdo *oa, int objcount, struct obd_ioobj *obj,
               struct niobuf_remote *rnb, int *nr_local,
-              struct niobuf_local *lnb, struct obd_trans_info *oti,
-              struct lustre_capa *capa)
+              struct niobuf_local *lnb, struct obd_trans_info *oti)
 {
        struct tgt_session_info *tsi = tgt_ses_info(env);
        struct ofd_device       *ofd = ofd_exp(exp);
@@ -739,25 +735,15 @@ int ofd_preprw(const struct lu_env *env, int cmd, struct obd_export *exp,
        LASSERT(obj->ioo_bufcnt > 0);
 
        if (cmd == OBD_BRW_WRITE) {
-               rc = ofd_auth_capa(exp, fid, ostid_seq(&oa->o_oi),
-                                  capa, CAPA_OPC_OSS_WRITE);
-               if (rc == 0) {
-                       la_from_obdo(&info->fti_attr, oa, OBD_MD_FLGETATTR);
-                       rc = ofd_preprw_write(env, exp, ofd, fid,
-                                             &info->fti_attr, oa, objcount,
-                                             obj, rnb, nr_local, lnb, jobid);
-               }
+               la_from_obdo(&info->fti_attr, oa, OBD_MD_FLGETATTR);
+               rc = ofd_preprw_write(env, exp, ofd, fid, &info->fti_attr, oa,
+                                     objcount, obj, rnb, nr_local, lnb, jobid);
        } else if (cmd == OBD_BRW_READ) {
-               rc = ofd_auth_capa(exp, fid, ostid_seq(&oa->o_oi),
-                                  capa, CAPA_OPC_OSS_READ);
-               if (rc == 0) {
-                       ofd_grant_prepare_read(env, exp, oa);
-                       rc = ofd_preprw_read(env, exp, ofd, fid,
-                                            &info->fti_attr, oa,
-                                            obj->ioo_bufcnt, rnb, nr_local,
-                                            lnb, jobid);
-                       obdo_from_la(oa, &info->fti_attr, LA_ATIME);
-               }
+               ofd_grant_prepare_read(env, exp, oa);
+               rc = ofd_preprw_read(env, exp, ofd, fid, &info->fti_attr, oa,
+                                    obj->ioo_bufcnt, rnb, nr_local, lnb,
+                                    jobid);
+               obdo_from_la(oa, &info->fti_attr, LA_ATIME);
        } else {
                CERROR("%s: wrong cmd %d received!\n",
                       exp->exp_obd->obd_name, cmd);
@@ -892,8 +878,7 @@ ofd_write_attr_set(const struct lu_env *env, struct ofd_device *ofd,
 
        /* set uid/gid */
        if (la->la_valid) {
-               rc = dt_attr_set(env, dt_obj, la, th,
-                                ofd_object_capa(env, ofd_obj));
+               rc = dt_attr_set(env, dt_obj, la, th);
                if (rc)
                        GOTO(out_tx, rc);
        }
@@ -904,7 +889,7 @@ ofd_write_attr_set(const struct lu_env *env, struct ofd_device *ofd,
                        GOTO(out_tx, rc);
 
                rc = dt_xattr_set(env, dt_obj, &info->fti_buf, XATTR_NAME_FID,
-                                 0, th, BYPASS_CAPA);
+                                 0, th);
                if (rc == 0) {
                        ofd_obj->ofo_pfid.f_seq = le64_to_cpu(ff->ff_parent.f_seq);
                        ofd_obj->ofo_pfid.f_oid = le32_to_cpu(ff->ff_parent.f_oid);
@@ -1101,13 +1086,13 @@ retry:
                GOTO(out_stop, rc);
 
        if (la->la_valid) {
-               rc = dt_attr_set(env, o, la, th, ofd_object_capa(env, fo));
+               rc = dt_attr_set(env, o, la, th);
                if (rc)
                        GOTO(out_stop, rc);
        }
 
        /* get attr to return */
-       rc = dt_attr_get(env, o, la, ofd_object_capa(env, fo));
+       rc = dt_attr_get(env, o, la);
 
 out_stop:
        /* Force commit to make the just-deleted blocks
index 3aa18f5..888186c 100644 (file)
@@ -148,8 +148,7 @@ int ofd_object_ff_load(const struct lu_env *env, struct ofd_object *fo)
 
        buf->lb_buf = ff;
        buf->lb_len = sizeof(*ff);
-       rc = dt_xattr_get(env, ofd_object_child(fo), buf, XATTR_NAME_FID,
-                         BYPASS_CAPA);
+       rc = dt_xattr_get(env, ofd_object_child(fo), buf, XATTR_NAME_FID);
        if (rc < 0)
                return rc;
 
@@ -445,7 +444,7 @@ int ofd_attr_handle_ugid(const struct lu_env *env, struct ofd_object *fo,
        if (!(la->la_valid & LA_UID) && !(la->la_valid & LA_GID))
                RETURN(0);
 
-       rc = dt_attr_get(env, ofd_object_child(fo), ln, BYPASS_CAPA);
+       rc = dt_attr_get(env, ofd_object_child(fo), ln);
        if (rc != 0)
                RETURN(rc);
 
@@ -550,14 +549,13 @@ int ofd_attr_set(const struct lu_env *env, struct ofd_object *fo,
        if (rc)
                GOTO(stop, rc);
 
-       rc = dt_attr_set(env, ofd_object_child(fo), la, th,
-                        ofd_object_capa(env, fo));
+       rc = dt_attr_set(env, ofd_object_child(fo), la, th);
        if (rc)
                GOTO(stop, rc);
 
        if (ff_needed) {
                rc = dt_xattr_set(env, ofd_object_child(fo), &info->fti_buf,
-                                 XATTR_NAME_FID, 0, th, BYPASS_CAPA);
+                                 XATTR_NAME_FID, 0, th);
                if (rc == 0) {
                        fo->ofo_pfid.f_seq = le64_to_cpu(ff->ff_parent.f_seq);
                        fo->ofo_pfid.f_oid = le32_to_cpu(ff->ff_parent.f_oid);
@@ -674,18 +672,17 @@ int ofd_object_punch(const struct lu_env *env, struct ofd_object *fo,
        if (rc)
                GOTO(stop, rc);
 
-       rc = dt_punch(env, dob, start, OBD_OBJECT_EOF, th,
-                     ofd_object_capa(env, fo));
+       rc = dt_punch(env, dob, start, OBD_OBJECT_EOF, th);
        if (rc)
                GOTO(stop, rc);
 
-       rc = dt_attr_set(env, dob, la, th, ofd_object_capa(env, fo));
+       rc = dt_attr_set(env, dob, la, th);
        if (rc)
                GOTO(stop, rc);
 
        if (ff_needed) {
                rc = dt_xattr_set(env, ofd_object_child(fo), &info->fti_buf,
-                                 XATTR_NAME_FID, 0, th, BYPASS_CAPA);
+                                 XATTR_NAME_FID, 0, th);
                if (rc == 0) {
                        fo->ofo_pfid.f_seq = le64_to_cpu(ff->ff_parent.f_seq);
                        fo->ofo_pfid.f_oid = le32_to_cpu(ff->ff_parent.f_oid);
@@ -786,8 +783,7 @@ int ofd_attr_get(const struct lu_env *env, struct ofd_object *fo,
        ENTRY;
 
        if (ofd_object_exists(fo)) {
-               rc = dt_attr_get(env, ofd_object_child(fo), la,
-                                ofd_object_capa(env, fo));
+               rc = dt_attr_get(env, ofd_object_child(fo), la);
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0)
                /* Try to correct for a bug in 2.1.0 (LU-221) that caused
index a321a5e..e2d7e68 100644 (file)
@@ -1456,23 +1456,6 @@ static int osd_ro(const struct lu_env *env, struct dt_device *d)
        RETURN(rc);
 }
 
-/*
- * Concurrency: serialization provided by callers.
- */
-static int osd_init_capa_ctxt(const struct lu_env *env, struct dt_device *d,
-                              int mode, unsigned long timeout, __u32 alg,
-                              struct lustre_capa_key *keys)
-{
-        struct osd_device *dev = osd_dt_dev(d);
-        ENTRY;
-
-        dev->od_fl_capa = mode;
-        dev->od_capa_timeout = timeout;
-        dev->od_capa_alg = alg;
-        dev->od_capa_keys = keys;
-        RETURN(0);
-}
-
 /**
  * Note: we do not count into QUOTA here.
  * If we mount with --data_journal we may need more.
@@ -1542,7 +1525,6 @@ static const struct dt_device_operations osd_dt_ops = {
         .dt_sync           = osd_sync,
         .dt_ro             = osd_ro,
         .dt_commit_async   = osd_commit_async,
-        .dt_init_capa_ctxt = osd_init_capa_ctxt,
 };
 
 static void osd_object_read_lock(const struct lu_env *env,
@@ -1614,108 +1596,6 @@ static int osd_object_write_locked(const struct lu_env *env,
         return obj->oo_owner == env;
 }
 
-static int capa_is_sane(const struct lu_env *env,
-                        struct osd_device *dev,
-                        struct lustre_capa *capa,
-                        struct lustre_capa_key *keys)
-{
-        struct osd_thread_info *oti = osd_oti_get(env);
-        struct lustre_capa *tcapa = &oti->oti_capa;
-        struct obd_capa *oc;
-        int i, rc = 0;
-        ENTRY;
-
-        oc = capa_lookup(dev->od_capa_hash, capa, 0);
-        if (oc) {
-                if (capa_is_expired(oc)) {
-                        DEBUG_CAPA(D_ERROR, capa, "expired");
-                        rc = -ESTALE;
-                }
-                capa_put(oc);
-                RETURN(rc);
-        }
-
-        if (capa_is_expired_sec(capa)) {
-                DEBUG_CAPA(D_ERROR, capa, "expired");
-                RETURN(-ESTALE);
-        }
-
-       spin_lock(&capa_lock);
-       for (i = 0; i < 2; i++) {
-               if (keys[i].lk_keyid == capa->lc_keyid) {
-                       oti->oti_capa_key = keys[i];
-                       break;
-               }
-       }
-       spin_unlock(&capa_lock);
-
-        if (i == 2) {
-                DEBUG_CAPA(D_ERROR, capa, "no matched capa key");
-                RETURN(-ESTALE);
-        }
-
-        rc = capa_hmac(tcapa->lc_hmac, capa, oti->oti_capa_key.lk_key);
-        if (rc)
-                RETURN(rc);
-
-        if (memcmp(tcapa->lc_hmac, capa->lc_hmac, sizeof(capa->lc_hmac))) {
-                DEBUG_CAPA(D_ERROR, capa, "HMAC mismatch");
-                RETURN(-EACCES);
-        }
-
-        oc = capa_add(dev->od_capa_hash, capa);
-        capa_put(oc);
-
-        RETURN(0);
-}
-
-int osd_object_auth(const struct lu_env *env, struct dt_object *dt,
-                   struct lustre_capa *capa, __u64 opc)
-{
-       const struct lu_fid *fid = lu_object_fid(&dt->do_lu);
-       struct osd_device *osd = osd_dev(dt->do_lu.lo_dev);
-       struct lu_capainfo *lci;
-       int rc;
-
-       if (!osd->od_fl_capa)
-               return 0;
-
-       if (capa == BYPASS_CAPA)
-               return 0;
-
-       lci = lu_capainfo_get(env);
-       if (unlikely(lci == NULL))
-               return 0;
-
-       if (lci->lci_auth == LC_ID_NONE)
-               return 0;
-
-       if (capa == NULL) {
-               CERROR("%s: no capability provided for FID "DFID": rc = %d\n",
-                      osd_name(osd), PFID(fid), -EACCES);
-               return -EACCES;
-       }
-
-       if (!lu_fid_eq(fid, &capa->lc_fid)) {
-               DEBUG_CAPA(D_ERROR, capa, "fid "DFID" mismatch with",
-                          PFID(fid));
-               return -EACCES;
-       }
-
-       if (!capa_opc_supported(capa, opc)) {
-               DEBUG_CAPA(D_ERROR, capa, "opc "LPX64" not supported by", opc);
-               return -EACCES;
-       }
-
-       rc = capa_is_sane(env, osd, capa, osd->od_capa_keys);
-       if (rc != 0) {
-               DEBUG_CAPA(D_ERROR, capa, "insane: rc = %d", rc);
-               return -EACCES;
-       }
-
-       return 0;
-}
-
 static struct timespec *osd_inode_time(const struct lu_env *env,
                                       struct inode *inode, __u64 seconds)
 {
@@ -1754,8 +1634,7 @@ static void osd_inode_getattr(const struct lu_env *env,
 
 static int osd_attr_get(const struct lu_env *env,
                        struct dt_object *dt,
-                       struct lu_attr *attr,
-                       struct lustre_capa *capa)
+                       struct lu_attr *attr)
 {
        struct osd_object *obj = osd_dt_obj(dt);
 
@@ -1765,9 +1644,6 @@ static int osd_attr_get(const struct lu_env *env,
        LASSERT(!dt_object_remote(dt));
        LINVRNT(osd_invariant(obj));
 
-       if (osd_object_auth(env, dt, capa, CAPA_OPC_META_READ))
-               return -EACCES;
-
        spin_lock(&obj->oo_guard);
        osd_inode_getattr(env, obj->oo_inode, attr);
        spin_unlock(&obj->oo_guard);
@@ -1997,8 +1873,7 @@ static int osd_quota_transfer(struct inode *inode, const struct lu_attr *attr)
 static int osd_attr_set(const struct lu_env *env,
                        struct dt_object *dt,
                        const struct lu_attr *attr,
-                       struct thandle *handle,
-                       struct lustre_capa *capa)
+                       struct thandle *handle)
 {
        struct osd_object *obj = osd_dt_obj(dt);
        struct inode      *inode;
@@ -2011,9 +1886,6 @@ static int osd_attr_set(const struct lu_env *env,
        LASSERT(!dt_object_remote(dt));
        LASSERT(osd_invariant(obj));
 
-       if (osd_object_auth(env, dt, capa, CAPA_OPC_META_WRITE))
-               return -EACCES;
-
        osd_trans_exec_op(env, handle, OSD_OT_ATTR_SET);
 
        if (OBD_FAIL_CHECK(OBD_FAIL_OSD_FID_MAPPING)) {
@@ -2986,8 +2858,7 @@ static int osd_object_version_get(const struct lu_env *env,
  * Concurrency: @dt is read locked.
  */
 static int osd_xattr_get(const struct lu_env *env, struct dt_object *dt,
-                         struct lu_buf *buf, const char *name,
-                         struct lustre_capa *capa)
+                        struct lu_buf *buf, const char *name)
 {
         struct osd_object      *obj    = osd_dt_obj(dt);
         struct inode           *inode  = obj->oo_inode;
@@ -3016,9 +2887,6 @@ static int osd_xattr_get(const struct lu_env *env, struct dt_object *dt,
        LASSERT(inode->i_op != NULL);
        LASSERT(inode->i_op->getxattr != NULL);
 
-       if (osd_object_auth(env, dt, capa, CAPA_OPC_META_READ))
-               return -EACCES;
-
        return __osd_xattr_get(inode, dentry, name, buf->lb_buf, buf->lb_len);
 }
 
@@ -3085,8 +2953,8 @@ static void osd_object_version_set(const struct lu_env *env,
  * Concurrency: @dt is write locked.
  */
 static int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
-                         const struct lu_buf *buf, const char *name, int fl,
-                         struct thandle *handle, struct lustre_capa *capa)
+                        const struct lu_buf *buf, const char *name, int fl,
+                        struct thandle *handle)
 {
        struct osd_object      *obj      = osd_dt_obj(dt);
        struct inode           *inode    = obj->oo_inode;
@@ -3105,9 +2973,6 @@ static int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
                 return sizeof(dt_obj_version_t);
         }
 
-        if (osd_object_auth(env, dt, capa, CAPA_OPC_META_WRITE))
-                return -EACCES;
-
        CDEBUG(D_INODE, DFID" set xattr '%s' with size %zu\n",
               PFID(lu_object_fid(&dt->do_lu)), name, buf->lb_len);
 
@@ -3146,7 +3011,7 @@ static int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
  * Concurrency: @dt is read locked.
  */
 static int osd_xattr_list(const struct lu_env *env, struct dt_object *dt,
-                         const struct lu_buf *buf, struct lustre_capa *capa)
+                         const struct lu_buf *buf)
 {
        struct osd_object      *obj    = osd_dt_obj(dt);
        struct inode           *inode  = obj->oo_inode;
@@ -3160,9 +3025,6 @@ static int osd_xattr_list(const struct lu_env *env, struct dt_object *dt,
        LASSERT(inode->i_op != NULL);
        LASSERT(inode->i_op->listxattr != NULL);
 
-       if (osd_object_auth(env, dt, capa, CAPA_OPC_META_READ))
-               return -EACCES;
-
        dentry->d_inode = inode;
        dentry->d_sb = inode->i_sb;
        return inode->i_op->listxattr(dentry, buf->lb_buf, buf->lb_len);
@@ -3196,8 +3058,7 @@ static int osd_declare_xattr_del(const struct lu_env *env,
  * Concurrency: @dt is write locked.
  */
 static int osd_xattr_del(const struct lu_env *env, struct dt_object *dt,
-                        const char *name, struct thandle *handle,
-                        struct lustre_capa *capa)
+                        const char *name, struct thandle *handle)
 {
        struct osd_object      *obj    = osd_dt_obj(dt);
        struct inode           *inode  = obj->oo_inode;
@@ -3213,9 +3074,6 @@ static int osd_xattr_del(const struct lu_env *env, struct dt_object *dt,
        LASSERT(inode->i_op->removexattr != NULL);
        LASSERT(handle != NULL);
 
-       if (osd_object_auth(env, dt, capa, CAPA_OPC_META_WRITE))
-               return -EACCES;
-
        osd_trans_exec_op(env, handle, OSD_OT_XATTR_SET);
 
        ll_vfs_dq_init(inode);
@@ -3225,95 +3083,6 @@ static int osd_xattr_del(const struct lu_env *env, struct dt_object *dt,
        return rc;
 }
 
-static struct obd_capa *osd_capa_get(const struct lu_env *env,
-                                    struct dt_object *dt,
-                                    struct lustre_capa *old, __u64 opc)
-{
-       struct osd_thread_info *info = osd_oti_get(env);
-       const struct lu_fid *fid = lu_object_fid(&dt->do_lu);
-       struct osd_object *obj = osd_dt_obj(dt);
-       struct osd_device *osd = osd_obj2dev(obj);
-       struct lustre_capa_key *key = &info->oti_capa_key;
-       struct lustre_capa *capa = &info->oti_capa;
-       struct obd_capa *oc;
-       struct lu_capainfo *lci;
-       int rc;
-       ENTRY;
-
-       if (!osd->od_fl_capa)
-               RETURN(ERR_PTR(-ENOENT));
-
-       if (!dt_object_exists(dt))
-               RETURN(ERR_PTR(-ENOENT));
-
-       LASSERT(!dt_object_remote(dt));
-       LINVRNT(osd_invariant(obj));
-
-       /* renewal sanity check */
-       if (old && osd_object_auth(env, dt, old, opc))
-               RETURN(ERR_PTR(-EACCES));
-
-       lci = lu_capainfo_get(env);
-       if (unlikely(lci == NULL))
-               RETURN(ERR_PTR(-ENOENT));
-
-       switch (lci->lci_auth) {
-       case LC_ID_NONE:
-               RETURN(NULL);
-       case LC_ID_PLAIN:
-               capa->lc_uid = i_uid_read(obj->oo_inode);
-               capa->lc_gid = i_gid_read(obj->oo_inode);
-               capa->lc_flags = LC_ID_PLAIN;
-               break;
-       case LC_ID_CONVERT: {
-               __u32 d[4], s[4];
-
-               s[0] = i_uid_read(obj->oo_inode);
-               cfs_get_random_bytes(&(s[1]), sizeof(__u32));
-               s[2] = i_uid_read(obj->oo_inode);
-               cfs_get_random_bytes(&(s[3]), sizeof(__u32));
-               rc = capa_encrypt_id(d, s, key->lk_key, CAPA_HMAC_KEY_MAX_LEN);
-               if (unlikely(rc))
-                       RETURN(ERR_PTR(rc));
-
-               capa->lc_uid   = ((__u64)d[1] << 32) | d[0];
-               capa->lc_gid   = ((__u64)d[3] << 32) | d[2];
-               capa->lc_flags = LC_ID_CONVERT;
-               break;
-        }
-       default:
-               RETURN(ERR_PTR(-EINVAL));
-       }
-
-       capa->lc_fid = *fid;
-       capa->lc_opc = opc;
-       capa->lc_flags |= osd->od_capa_alg << 24;
-       capa->lc_timeout = osd->od_capa_timeout;
-       capa->lc_expiry = 0;
-
-       oc = capa_lookup(osd->od_capa_hash, capa, 1);
-       if (oc) {
-               LASSERT(!capa_is_expired(oc));
-               RETURN(oc);
-       }
-
-       spin_lock(&capa_lock);
-       *key = osd->od_capa_keys[1];
-       spin_unlock(&capa_lock);
-
-       capa->lc_keyid = key->lk_keyid;
-       capa->lc_expiry = cfs_time_current_sec() + osd->od_capa_timeout;
-
-       rc = capa_hmac(capa->lc_hmac, capa, key->lk_key);
-       if (rc) {
-               DEBUG_CAPA(D_ERROR, capa, "HMAC failed: %d for", rc);
-               RETURN(ERR_PTR(rc));
-       }
-
-       oc = capa_add(osd->od_capa_hash, capa);
-       RETURN(oc);
-}
-
 static int osd_object_sync(const struct lu_env *env, struct dt_object *dt,
                           __u64 start, __u64 end)
 {
@@ -3338,16 +3107,6 @@ static int osd_object_sync(const struct lu_env *env, struct dt_object *dt,
        RETURN(rc);
 }
 
-static int osd_data_get(const struct lu_env *env, struct dt_object *dt,
-                        void **data)
-{
-        struct osd_object *obj = osd_dt_obj(dt);
-        ENTRY;
-
-        *data = (void *)obj->oo_inode;
-        RETURN(0);
-}
-
 /*
  * Index operations.
  */
@@ -3483,8 +3242,7 @@ static int osd_index_try(const struct lu_env *env, struct dt_object *dt,
 
 static int osd_otable_it_attr_get(const struct lu_env *env,
                                 struct dt_object *dt,
-                                struct lu_attr *attr,
-                                struct lustre_capa *capa)
+                                struct lu_attr *attr)
 {
        attr->la_valid = 0;
        return 0;
@@ -3515,9 +3273,7 @@ static const struct dt_object_operations osd_obj_ops = {
         .do_declare_xattr_del = osd_declare_xattr_del,
         .do_xattr_del         = osd_xattr_del,
         .do_xattr_list        = osd_xattr_list,
-        .do_capa_get          = osd_capa_get,
         .do_object_sync       = osd_object_sync,
-        .do_data_get          = osd_data_get,
 };
 
 /**
@@ -3549,9 +3305,7 @@ static const struct dt_object_operations osd_obj_ea_ops = {
         .do_declare_xattr_del = osd_declare_xattr_del,
         .do_xattr_del         = osd_xattr_del,
         .do_xattr_list        = osd_xattr_list,
-        .do_capa_get          = osd_capa_get,
         .do_object_sync       = osd_object_sync,
-        .do_data_get          = osd_data_get,
 };
 
 static const struct dt_object_operations osd_obj_otable_it_ops = {
@@ -3588,8 +3342,7 @@ static int osd_index_declare_iam_delete(const struct lu_env *env,
  */
 static int osd_index_iam_delete(const struct lu_env *env, struct dt_object *dt,
                                const struct dt_key *key,
-                               struct thandle *handle,
-                               struct lustre_capa *capa)
+                               struct thandle *handle)
 {
        struct osd_thread_info *oti = osd_oti_get(env);
        struct osd_object      *obj = osd_dt_obj(dt);
@@ -3607,9 +3360,6 @@ static int osd_index_iam_delete(const struct lu_env *env, struct dt_object *dt,
        LASSERT(bag->ic_object == obj->oo_inode);
        LASSERT(handle != NULL);
 
-       if (osd_object_auth(env, dt, capa, CAPA_OPC_INDEX_DELETE))
-               RETURN(-EACCES);
-
        osd_trans_exec_op(env, handle, OSD_OT_DELETE);
 
         ipd = osd_idx_ipd_get(env, bag);
@@ -3706,8 +3456,7 @@ static int osd_remote_fid(const struct lu_env *env, struct osd_device *osd,
  * \retval -ve, on error
  */
 static int osd_index_ea_delete(const struct lu_env *env, struct dt_object *dt,
-                              const struct dt_key *key, struct thandle *handle,
-                              struct lustre_capa *capa)
+                              const struct dt_key *key, struct thandle *handle)
 {
        struct osd_object          *obj = osd_dt_obj(dt);
        struct inode               *dir = obj->oo_inode;
@@ -3734,9 +3483,6 @@ static int osd_index_ea_delete(const struct lu_env *env, struct dt_object *dt,
         LASSERT(oh->ot_handle != NULL);
         LASSERT(oh->ot_handle->h_transaction != NULL);
 
-        if (osd_object_auth(env, dt, capa, CAPA_OPC_INDEX_DELETE))
-                RETURN(-EACCES);
-
        ll_vfs_dq_init(dir);
         dentry = osd_child_dentry_get(env, obj,
                                       (char *)key, strlen((char *)key));
@@ -3865,8 +3611,7 @@ out:
  *      \retval -ve   failure
  */
 static int osd_index_iam_lookup(const struct lu_env *env, struct dt_object *dt,
-                               struct dt_rec *rec, const struct dt_key *key,
-                               struct lustre_capa *capa)
+                               struct dt_rec *rec, const struct dt_key *key)
 {
        struct osd_object      *obj = osd_dt_obj(dt);
        struct iam_path_descr  *ipd;
@@ -3884,9 +3629,6 @@ static int osd_index_iam_lookup(const struct lu_env *env, struct dt_object *dt,
        LASSERT(!dt_object_remote(dt));
        LASSERT(bag->ic_object == obj->oo_inode);
 
-        if (osd_object_auth(env, dt, capa, CAPA_OPC_INDEX_LOOKUP))
-                RETURN(-EACCES);
-
         ipd = osd_idx_ipd_get(env, bag);
         if (IS_ERR(ipd))
                 RETURN(-ENOMEM);
@@ -3958,7 +3700,7 @@ static int osd_index_declare_iam_insert(const struct lu_env *env,
 static int osd_index_iam_insert(const struct lu_env *env, struct dt_object *dt,
                                const struct dt_rec *rec,
                                const struct dt_key *key, struct thandle *th,
-                               struct lustre_capa *capa, int ignore_quota)
+                               int ignore_quota)
 {
        struct osd_object     *obj = osd_dt_obj(dt);
        struct iam_path_descr *ipd;
@@ -3979,9 +3721,6 @@ static int osd_index_iam_insert(const struct lu_env *env, struct dt_object *dt,
        LASSERT(bag->ic_object == obj->oo_inode);
        LASSERT(th != NULL);
 
-       if (osd_object_auth(env, dt, capa, CAPA_OPC_INDEX_INSERT))
-               RETURN(-EACCES);
-
        osd_trans_exec_op(env, th, OSD_OT_INSERT);
 
         ipd = osd_idx_ipd_get(env, bag);
@@ -4582,9 +4321,9 @@ static int osd_index_declare_ea_insert(const struct lu_env *env,
  * \retval -ve, on error
  */
 static int osd_index_ea_insert(const struct lu_env *env, struct dt_object *dt,
-                               const struct dt_rec *rec,
-                               const struct dt_key *key, struct thandle *th,
-                               struct lustre_capa *capa, int ignore_quota)
+                              const struct dt_rec *rec,
+                              const struct dt_key *key, struct thandle *th,
+                              int ignore_quota)
 {
        struct osd_object       *obj = osd_dt_obj(dt);
        struct osd_device       *osd = osd_dev(dt->do_lu.lo_dev);
@@ -4607,9 +4346,6 @@ static int osd_index_ea_insert(const struct lu_env *env, struct dt_object *dt,
 
        osd_trans_exec_op(env, th, OSD_OT_INSERT);
 
-       if (osd_object_auth(env, dt, capa, CAPA_OPC_INDEX_INSERT))
-               RETURN(-EACCES);
-
        LASSERTF(fid_is_sane(fid), "fid"DFID" is insane!\n", PFID(fid));
 
        rc = osd_remote_fid(env, osd, fid);
@@ -4675,9 +4411,8 @@ static int osd_index_ea_insert(const struct lu_env *env, struct dt_object *dt,
  */
 
 static struct dt_it *osd_it_iam_init(const struct lu_env *env,
-                                     struct dt_object *dt,
-                                     __u32 unused,
-                                     struct lustre_capa *capa)
+                                    struct dt_object *dt,
+                                    __u32 unused)
 {
        struct osd_it_iam      *it;
        struct osd_object      *obj = osd_dt_obj(dt);
@@ -4688,9 +4423,6 @@ static struct dt_it *osd_it_iam_init(const struct lu_env *env,
        if (!dt_object_exists(dt))
                return ERR_PTR(-ENOENT);
 
-       if (osd_object_auth(env, dt, capa, CAPA_OPC_BODY_READ))
-               return ERR_PTR(-EACCES);
-
        OBD_ALLOC_PTR(it);
        if (it == NULL)
                return ERR_PTR(-ENOMEM);
@@ -4959,8 +4691,7 @@ static const struct dt_index_operations osd_index_iam_ops = {
  */
 static struct dt_it *osd_it_ea_init(const struct lu_env *env,
                                    struct dt_object *dt,
-                                   __u32 attr,
-                                   struct lustre_capa *capa)
+                                   __u32 attr)
 {
        struct osd_object       *obj  = osd_dt_obj(dt);
        struct osd_thread_info  *info = osd_oti_get(env);
@@ -5788,8 +5519,7 @@ static int osd_it_ea_load(const struct lu_env *env,
  * \retval -ve, on error
  */
 static int osd_index_ea_lookup(const struct lu_env *env, struct dt_object *dt,
-                               struct dt_rec *rec, const struct dt_key *key,
-                               struct lustre_capa *capa)
+                              struct dt_rec *rec, const struct dt_key *key)
 {
         struct osd_object *obj = osd_dt_obj(dt);
         int rc = 0;
@@ -5799,9 +5529,6 @@ static int osd_index_ea_lookup(const struct lu_env *env, struct dt_object *dt,
         LASSERT(S_ISDIR(obj->oo_inode->i_mode));
         LINVRNT(osd_invariant(obj));
 
-        if (osd_object_auth(env, dt, capa, CAPA_OPC_INDEX_LOOKUP))
-                return -EACCES;
-
         rc = osd_ea_lookup_rec(env, obj, rec, key);
         if (rc == 0)
                 rc = +1;
@@ -6174,10 +5901,6 @@ static int osd_device_init0(const struct lu_env *env,
        spin_lock_init(&o->od_osfs_lock);
        mutex_init(&o->od_otable_mutex);
 
-       o->od_capa_hash = init_capa_hash();
-       if (o->od_capa_hash == NULL)
-               GOTO(out, rc = -ENOMEM);
-
        o->od_read_cache = 1;
        o->od_writethrough_cache = 1;
        o->od_readcache_max_filesize = OSD_MAX_CACHE_SIZE;
@@ -6186,7 +5909,7 @@ static int osd_device_init0(const struct lu_env *env,
                        sizeof(o->od_svname));
        if (cplen >= sizeof(o->od_svname)) {
                rc = -E2BIG;
-               GOTO(out_capa, rc);
+               GOTO(out, rc);
        }
 
        if (server_name_is_ost(o->od_svname))
@@ -6196,7 +5919,7 @@ static int osd_device_init0(const struct lu_env *env,
        o->od_full_scrub_threshold_rate = FULL_SCRUB_THRESHOLD_RATE_DEFAULT;
        rc = osd_mount(env, o, cfg);
        if (rc != 0)
-               GOTO(out_capa, rc);
+               GOTO(out, rc);
 
        rc = osd_obj_map_init(env, o);
        if (rc != 0)
@@ -6248,8 +5971,6 @@ out_compat:
        osd_obj_map_fini(o);
 out_mnt:
        osd_umount(env, o);
-out_capa:
-       cleanup_capa_hash(o->od_capa_hash);
 out:
        return rc;
 }
@@ -6287,7 +6008,6 @@ static struct lu_device *osd_device_free(const struct lu_env *env,
         struct osd_device *o = osd_dev(d);
         ENTRY;
 
-        cleanup_capa_hash(o->od_capa_hash);
        /* XXX: make osd top device in order to release reference */
        d->ld_site->ls_top_dev = d;
        lu_site_purge(env, d->ld_site, -1);
index 0acde51..16ce2d1 100644 (file)
@@ -239,12 +239,7 @@ struct osd_device {
                                  od_is_ost:1,
                                  od_index_in_idif:1;
 
-       unsigned long             od_capa_timeout;
-       __u32                     od_capa_alg;
        __u32                     od_dirent_journal;
-       struct lustre_capa_key   *od_capa_keys;
-       struct hlist_head        *od_capa_hash;
-
        struct proc_dir_entry    *od_proc_entry;
        struct lprocfs_stats     *od_stats;
 
@@ -525,11 +520,6 @@ struct osd_thread_info {
          * XXX temporary: for ->i_op calls.
          */
         struct timespec        oti_time;
-        /*
-         * XXX temporary: for capa operations.
-         */
-        struct lustre_capa_key oti_capa_key;
-        struct lustre_capa     oti_capa;
 
         /** osd_device reference, initialized in osd_trans_start() and
             used in osd_trans_stop() */
@@ -647,8 +637,6 @@ int osd_register_proc_index_in_idif(struct osd_device *osd);
 #endif
 int osd_statfs(const struct lu_env *env, struct dt_device *dev,
                struct obd_statfs *sfs);
-int osd_object_auth(const struct lu_env *env, struct dt_object *dt,
-                    struct lustre_capa *capa, __u64 opc);
 struct inode *osd_iget(struct osd_thread_info *info, struct osd_device *dev,
                       struct osd_inode_id *id);
 int osd_ea_fid_set(struct osd_thread_info *info, struct inode *inode,
index 390582b..8be3a98 100644 (file)
@@ -505,7 +505,7 @@ static int osd_bufs_put(const struct lu_env *env, struct dt_object *dt,
  */
 static int osd_bufs_get(const struct lu_env *env, struct dt_object *dt,
                        loff_t pos, ssize_t len, struct niobuf_local *lnb,
-                       int rw, struct lustre_capa *capa)
+                       int rw)
 {
        struct osd_object   *obj    = osd_dt_obj(dt);
        int npages, i, rc = 0;
@@ -1430,15 +1430,11 @@ int osd_ldiskfs_read(struct inode *inode, void *buf, int size, loff_t *offs)
 }
 
 static ssize_t osd_read(const struct lu_env *env, struct dt_object *dt,
-                        struct lu_buf *buf, loff_t *pos,
-                        struct lustre_capa *capa)
+                       struct lu_buf *buf, loff_t *pos)
 {
         struct inode *inode = osd_dt_obj(dt)->oo_inode;
         int           rc;
 
-        if (osd_object_auth(env, dt, capa, CAPA_OPC_BODY_READ))
-                RETURN(-EACCES);
-
         /* Read small symlink from inode body as we need to maintain correct
          * on-disk symlinks for ldiskfs.
          */
@@ -1694,9 +1690,8 @@ int osd_ldiskfs_write_record(struct inode *inode, void *buf, int bufsize,
 }
 
 static ssize_t osd_write(const struct lu_env *env, struct dt_object *dt,
-                         const struct lu_buf *buf, loff_t *pos,
-                         struct thandle *handle, struct lustre_capa *capa,
-                         int ignore_quota)
+                        const struct lu_buf *buf, loff_t *pos,
+                        struct thandle *handle, int ignore_quota)
 {
        struct inode            *inode = osd_dt_obj(dt)->oo_inode;
        struct osd_thandle      *oh;
@@ -1705,9 +1700,6 @@ static ssize_t osd_write(const struct lu_env *env, struct dt_object *dt,
 
         LASSERT(dt_object_exists(dt));
 
-        if (osd_object_auth(env, dt, capa, CAPA_OPC_BODY_WRITE))
-                return -EACCES;
-
         LASSERT(handle != NULL);
        LASSERT(inode != NULL);
        ll_vfs_dq_init(inode);
@@ -1765,8 +1757,7 @@ static int osd_declare_punch(const struct lu_env *env, struct dt_object *dt,
 }
 
 static int osd_punch(const struct lu_env *env, struct dt_object *dt,
-                    __u64 start, __u64 end, struct thandle *th,
-                    struct lustre_capa *capa)
+                    __u64 start, __u64 end, struct thandle *th)
 {
        struct osd_thandle *oh;
        struct osd_object  *obj = osd_dt_obj(dt);
index dbbf7a3..174fe37 100644 (file)
@@ -92,7 +92,6 @@ int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
  * \param dtrec - is the record to fill with space usage information
  * \param dtkey - is the id the of the user or group for which we would
  *                like to access disk usage.
- * \param capa - is the capability, not used.
  *
  * \retval +ve - success : exact match
  * \retval -ve - failure
@@ -100,8 +99,7 @@ int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
 static int osd_acct_index_lookup(const struct lu_env *env,
                                 struct dt_object *dtobj,
                                 struct dt_rec *dtrec,
-                                const struct dt_key *dtkey,
-                                struct lustre_capa *capa)
+                                const struct dt_key *dtkey)
 {
        struct osd_thread_info  *info = osd_oti_get(env);
 #ifdef HAVE_DQUOT_FS_DISK_QUOTA
@@ -148,11 +146,10 @@ static int osd_acct_index_lookup(const struct lu_env *env,
  *
  * \param  dt    - osd index object
  * \param  attr  - not used
- * \param  capa  - BYPASS_CAPA
  */
 static struct dt_it *osd_it_acct_init(const struct lu_env *env,
                                      struct dt_object *dt,
-                                     __u32 attr, struct lustre_capa *capa)
+                                     __u32 attr)
 {
        struct osd_it_quota     *it;
        struct lu_object        *lo = &dt->do_lu;
@@ -380,8 +377,7 @@ static int osd_it_acct_rec(const struct lu_env *env,
 
        ENTRY;
 
-       rc = osd_acct_index_lookup(env, &it->oiq_obj->oo_dt, dtrec, key,
-                                  BYPASS_CAPA);
+       rc = osd_acct_index_lookup(env, &it->oiq_obj->oo_dt, dtrec, key);
        RETURN(rc > 0 ? 0 : rc);
 }
 
@@ -824,7 +820,7 @@ static int convert_quota_file(const struct lu_env *env,
 
        /* iterate the old admin file, insert each record into the
         * new index file. */
-       it = iops->init(env, old, 0, BYPASS_CAPA);
+       it = iops->init(env, old, 0);
        if (IS_ERR(it))
                GOTO(out, rc = PTR_ERR(it));
 
@@ -932,11 +928,11 @@ static int truncate_quota_index(const struct lu_env *env, struct dt_object *dt,
                GOTO(out, rc);
 
        dt_write_lock(env, dt, 0);
-       rc = dt_punch(env, dt, 0, OBD_OBJECT_EOF, th, BYPASS_CAPA);
+       rc = dt_punch(env, dt, 0, OBD_OBJECT_EOF, th);
        if (rc)
                GOTO(out_lock, rc);
 
-       rc = dt_attr_set(env, dt, attr, th, BYPASS_CAPA);
+       rc = dt_attr_set(env, dt, attr, th);
        if (rc)
                GOTO(out_lock, rc);
 
index d59ad51..435c0fc 100644 (file)
@@ -2516,8 +2516,7 @@ void osd_scrub_cleanup(const struct lu_env *env, struct osd_device *dev)
 /* object table based iteration APIs */
 
 static struct dt_it *osd_otable_it_init(const struct lu_env *env,
-                                      struct dt_object *dt, __u32 attr,
-                                      struct lustre_capa *capa)
+                                      struct dt_object *dt, __u32 attr)
 {
        enum dt_otable_it_flags flags = attr >> DT_OTABLE_IT_FLAGS_SHIFT;
        enum dt_otable_it_valid valid = attr & ~DT_OTABLE_IT_FLAGS_MASK;
index 5d77809..dfae067 100644 (file)
@@ -582,24 +582,6 @@ static int osd_ro(const struct lu_env *env, struct dt_device *d)
        RETURN(0);
 }
 
-/*
- * Concurrency: serialization provided by callers.
- */
-static int osd_init_capa_ctxt(const struct lu_env *env, struct dt_device *d,
-                             int mode, unsigned long timeout, __u32 alg,
-                             struct lustre_capa_key *keys)
-{
-       struct osd_device *dev = osd_dt_dev(d);
-       ENTRY;
-
-       dev->od_fl_capa = mode;
-       dev->od_capa_timeout = timeout;
-       dev->od_capa_alg = alg;
-       dev->od_capa_keys = keys;
-
-       RETURN(0);
-}
-
 static struct dt_device_operations osd_dt_ops = {
        .dt_root_get            = osd_root_get,
        .dt_statfs              = osd_statfs,
@@ -611,7 +593,6 @@ static struct dt_device_operations osd_dt_ops = {
        .dt_sync                = osd_sync,
        .dt_commit_async        = osd_commit_async,
        .dt_ro                  = osd_ro,
-       .dt_init_capa_ctxt      = osd_init_capa_ctxt,
 };
 
 /*
@@ -901,10 +882,6 @@ static int osd_device_init0(const struct lu_env *env,
        l->ld_ops = &osd_lu_ops;
        o->od_dt_dev.dd_ops = &osd_dt_ops;
 
-       o->od_capa_hash = init_capa_hash();
-       if (o->od_capa_hash == NULL)
-               GOTO(out, rc = -ENOMEM);
-
 out:
        RETURN(rc);
 }
@@ -947,7 +924,6 @@ static struct lu_device *osd_device_free(const struct lu_env *env,
        struct osd_device *o = osd_dev(d);
        ENTRY;
 
-       cleanup_capa_hash(o->od_capa_hash);
        /* XXX: make osd top device in order to release reference */
        d->ld_site->ls_top_dev = d;
        lu_site_purge(env, d->ld_site, -1);
index 8f5905e..367b7f7 100644 (file)
@@ -151,8 +151,7 @@ static inline int osd_obj_cursor_init(zap_cursor_t **zc, struct osd_object *o,
 
 static struct dt_it *osd_index_it_init(const struct lu_env *env,
                                       struct dt_object *dt,
-                                      __u32 unused,
-                                      struct lustre_capa *capa)
+                                      __u32 unused)
 {
        struct osd_thread_info  *info = osd_oti_get(env);
        struct osd_zap_it       *it;
@@ -161,8 +160,6 @@ static struct dt_it *osd_index_it_init(const struct lu_env *env,
        int                      rc;
        ENTRY;
 
-       /* XXX: check capa ? */
-
        LASSERT(lu_object_exists(lo));
        LASSERT(obj->oo_db);
        LASSERT(osd_object_is_zap(obj->oo_db));
@@ -179,7 +176,6 @@ static struct dt_it *osd_index_it_init(const struct lu_env *env,
        }
 
        it->ozi_obj   = obj;
-       it->ozi_capa  = capa;
        it->ozi_reset = 1;
        lu_object_get(lo);
 
@@ -328,10 +324,9 @@ static int osd_find_parent_fid(const struct lu_env *env, struct dt_object *o,
        buf.lb_buf = osd_oti_get(env)->oti_buf;
        buf.lb_len = sizeof(osd_oti_get(env)->oti_buf);
 
-       rc = osd_xattr_get(env, o, &buf, XATTR_NAME_LINK, BYPASS_CAPA);
+       rc = osd_xattr_get(env, o, &buf, XATTR_NAME_LINK);
        if (rc == -ERANGE) {
-               rc = osd_xattr_get(env, o, &LU_BUF_NULL,
-                                  XATTR_NAME_LINK, BYPASS_CAPA);
+               rc = osd_xattr_get(env, o, &LU_BUF_NULL, XATTR_NAME_LINK);
                if (rc < 0)
                        RETURN(rc);
                LASSERT(rc > 0);
@@ -339,7 +334,7 @@ static int osd_find_parent_fid(const struct lu_env *env, struct dt_object *o,
                if (buf.lb_buf == NULL)
                        RETURN(-ENOMEM);
                buf.lb_len = rc;
-               rc = osd_xattr_get(env, o, &buf, XATTR_NAME_LINK, BYPASS_CAPA);
+               rc = osd_xattr_get(env, o, &buf, XATTR_NAME_LINK);
        }
        if (rc < 0)
                GOTO(out, rc);
@@ -387,8 +382,7 @@ out:
 }
 
 static int osd_dir_lookup(const struct lu_env *env, struct dt_object *dt,
-                         struct dt_rec *rec, const struct dt_key *key,
-                         struct lustre_capa *capa)
+                         struct dt_rec *rec, const struct dt_key *key)
 {
        struct osd_thread_info *oti = osd_oti_get(env);
        struct osd_object  *obj = osd_dt_obj(dt);
@@ -564,7 +558,6 @@ static int osd_remote_fid(const struct lu_env *env, struct osd_device *osd,
  *      \param  key     key for index
  *      \param  rec     record reference
  *      \param  th      transaction handler
- *      \param  capa    capability descriptor
  *      \param  ignore_quota update should not affect quota
  *
  *      \retval  0  success
@@ -572,8 +565,7 @@ static int osd_remote_fid(const struct lu_env *env, struct osd_device *osd,
  */
 static int osd_dir_insert(const struct lu_env *env, struct dt_object *dt,
                          const struct dt_rec *rec, const struct dt_key *key,
-                         struct thandle *th, struct lustre_capa *capa,
-                         int ignore_quota)
+                         struct thandle *th, int ignore_quota)
 {
        struct osd_thread_info *oti = osd_oti_get(env);
        struct osd_object   *parent = osd_dt_obj(dt);
@@ -696,8 +688,7 @@ static int osd_declare_dir_delete(const struct lu_env *env,
 }
 
 static int osd_dir_delete(const struct lu_env *env, struct dt_object *dt,
-                         const struct dt_key *key, struct thandle *th,
-                         struct lustre_capa *capa)
+                         const struct dt_key *key, struct thandle *th)
 {
        struct osd_object *obj = osd_dt_obj(dt);
        struct osd_device *osd = osd_obj2dev(obj);
@@ -737,12 +728,11 @@ static int osd_dir_delete(const struct lu_env *env, struct dt_object *dt,
 
 static struct dt_it *osd_dir_it_init(const struct lu_env *env,
                                     struct dt_object *dt,
-                                    __u32 unused,
-                                    struct lustre_capa *capa)
+                                    __u32 unused)
 {
        struct osd_zap_it *it;
 
-       it = (struct osd_zap_it *)osd_index_it_init(env, dt, unused, capa);
+       it = (struct osd_zap_it *)osd_index_it_init(env, dt, unused);
        if (!IS_ERR(it))
                it->ozi_pos = 0;
 
@@ -1140,8 +1130,7 @@ static int osd_prepare_key_uint64(struct osd_object *o, __u64 *dst,
 }
 
 static int osd_index_lookup(const struct lu_env *env, struct dt_object *dt,
-                       struct dt_rec *rec, const struct dt_key *key,
-                       struct lustre_capa *capa)
+                       struct dt_rec *rec, const struct dt_key *key)
 {
        struct osd_object *obj = osd_dt_obj(dt);
        struct osd_device *osd = osd_obj2dev(obj);
@@ -1184,8 +1173,7 @@ static int osd_declare_index_insert(const struct lu_env *env,
 
 static int osd_index_insert(const struct lu_env *env, struct dt_object *dt,
                            const struct dt_rec *rec, const struct dt_key *key,
-                           struct thandle *th, struct lustre_capa *capa,
-                           int ignore_quota)
+                           struct thandle *th, int ignore_quota)
 {
        struct osd_object  *obj = osd_dt_obj(dt);
        struct osd_device  *osd = osd_obj2dev(obj);
@@ -1231,8 +1219,7 @@ static int osd_declare_index_delete(const struct lu_env *env,
 }
 
 static int osd_index_delete(const struct lu_env *env, struct dt_object *dt,
-                           const struct dt_key *key, struct thandle *th,
-                           struct lustre_capa *capa)
+                           const struct dt_key *key, struct thandle *th)
 {
        struct osd_object  *obj = osd_dt_obj(dt);
        struct osd_device  *osd = osd_obj2dev(obj);
@@ -1417,8 +1404,7 @@ struct osd_metadnode_it {
 };
 
 static struct dt_it *osd_zfs_otable_it_init(const struct lu_env *env,
-                                           struct dt_object *dt, __u32 attr,
-                                           struct lustre_capa *capa)
+                                           struct dt_object *dt, __u32 attr)
 {
        struct osd_device       *dev   = osd_dev(dt->do_lu.lo_dev);
        struct osd_metadnode_it *it;
index 4284f6c..d746578 100644 (file)
@@ -117,7 +117,6 @@ struct osd_it_quota {
 struct osd_zap_it {
        zap_cursor_t            *ozi_zc;
        struct osd_object       *ozi_obj;
-       struct lustre_capa      *ozi_capa;
        unsigned                 ozi_reset:1;   /* 1 -- no need to advance */
        /* ozi_pos - position of the cursor:
         * 0 - before any record
@@ -172,11 +171,6 @@ struct osd_thread_info {
         * XXX temporary: for ->i_op calls.
         */
        struct timespec          oti_time;
-       /*
-        * XXX temporary: for capa operations.
-        */
-       struct lustre_capa_key   oti_capa_key;
-       struct lustre_capa       oti_capa;
 
        struct ost_id            oti_ostid;
 
@@ -255,15 +249,6 @@ struct osd_device {
         * name is the same as in ZFS to use defines SA_ZPL_...*/
        sa_attr_type_t           *z_attr_table;
 
-       /*
-        * Fid Capability
-        */
-       unsigned int             od_fl_capa:1;
-       unsigned long            od_capa_timeout;
-       __u32                    od_capa_alg;
-       struct lustre_capa_key  *od_capa_keys;
-       struct hlist_head       *od_capa_hash;
-
        struct proc_dir_entry   *od_proc_entry;
        struct lprocfs_stats    *od_stats;
 
@@ -487,21 +472,19 @@ int __osd_xattr_get_large(const struct lu_env *env, struct osd_device *osd,
                          uint64_t xattr, struct lu_buf *buf,
                          const char *name, int *sizep);
 int osd_xattr_get(const struct lu_env *env, struct dt_object *dt,
-                 struct lu_buf *buf, const char *name,
-                 struct lustre_capa *capa);
+                 struct lu_buf *buf, const char *name);
 int osd_declare_xattr_set(const struct lu_env *env, struct dt_object *dt,
                          const struct lu_buf *buf, const char *name,
                          int fl, struct thandle *handle);
 int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
                  const struct lu_buf *buf, const char *name, int fl,
-                 struct thandle *handle, struct lustre_capa *capa);
+                 struct thandle *handle);
 int osd_declare_xattr_del(const struct lu_env *env, struct dt_object *dt,
                          const char *name, struct thandle *handle);
 int osd_xattr_del(const struct lu_env *env, struct dt_object *dt,
-                 const char *name, struct thandle *handle,
-                 struct lustre_capa *capa);
+                 const char *name, struct thandle *handle);
 int osd_xattr_list(const struct lu_env *env, struct dt_object *dt,
-                  const struct lu_buf *lb, struct lustre_capa *capa);
+                  const struct lu_buf *lb);
 void __osd_xattr_declare_set(const struct lu_env *env, struct osd_object *obj,
                        int vallen, const char *name, struct osd_thandle *oh);
 int __osd_sa_xattr_set(const struct lu_env *env, struct osd_object *obj,
@@ -513,7 +496,7 @@ int __osd_xattr_set(const struct lu_env *env, struct osd_object *obj,
 static inline int
 osd_xattr_set_internal(const struct lu_env *env, struct osd_object *obj,
                       const struct lu_buf *buf, const char *name, int fl,
-                      struct osd_thandle *oh, struct lustre_capa *capa)
+                      struct osd_thandle *oh)
 {
        int rc;
 
index c283cdc..c588256 100644 (file)
@@ -112,8 +112,7 @@ static void record_end_io(struct osd_device *osd, int rw,
 }
 
 static ssize_t osd_read(const struct lu_env *env, struct dt_object *dt,
-                       struct lu_buf *buf, loff_t *pos,
-                       struct lustre_capa *capa)
+                       struct lu_buf *buf, loff_t *pos)
 {
        struct osd_object *obj  = osd_dt_obj(dt);
        struct osd_device *osd = osd_obj2dev(obj);
@@ -200,8 +199,7 @@ static ssize_t osd_declare_write(const struct lu_env *env, struct dt_object *dt,
 
 static ssize_t osd_write(const struct lu_env *env, struct dt_object *dt,
                        const struct lu_buf *buf, loff_t *pos,
-                       struct thandle *th, struct lustre_capa *capa,
-                       int ignore_quota)
+                       struct thandle *th, int ignore_quota)
 {
        struct osd_object  *obj  = osd_dt_obj(dt);
        struct osd_device  *osd = osd_obj2dev(obj);
@@ -511,7 +509,7 @@ out_err:
 
 static int osd_bufs_get(const struct lu_env *env, struct dt_object *dt,
                        loff_t offset, ssize_t len, struct niobuf_local *lnb,
-                       int rw, struct lustre_capa *capa)
+                       int rw)
 {
        struct osd_object *obj  = osd_dt_obj(dt);
        int                rc;
@@ -876,8 +874,7 @@ static int __osd_object_punch(objset_t *os, dmu_buf_t *db, dmu_tx_t *tx,
 }
 
 static int osd_punch(const struct lu_env *env, struct dt_object *dt,
-                       __u64 start, __u64 end, struct thandle *th,
-                       struct lustre_capa *capa)
+                       __u64 start, __u64 end, struct thandle *th)
 {
        struct osd_object  *obj = osd_dt_obj(dt);
        struct osd_device  *osd = osd_obj2dev(obj);
index 2d0ff07..ad6752f 100644 (file)
@@ -352,7 +352,7 @@ static int osd_check_lma(const struct lu_env *env, struct osd_object *obj)
        buf.lb_buf = lma;
        buf.lb_len = sizeof(info->oti_buf);
 
-       rc = osd_xattr_get(env, &obj->oo_dt, &buf, XATTR_NAME_LMA, BYPASS_CAPA);
+       rc = osd_xattr_get(env, &obj->oo_dt, &buf, XATTR_NAME_LMA);
        if (rc > 0) {
                rc = 0;
                lustre_lma_swab(lma);
@@ -734,8 +734,7 @@ static int osd_object_write_locked(const struct lu_env *env,
 
 static int osd_attr_get(const struct lu_env *env,
                        struct dt_object *dt,
-                       struct lu_attr *attr,
-                       struct lustre_capa *capa)
+                       struct lu_attr *attr)
 {
        struct osd_object       *obj = osd_dt_obj(dt);
        uint64_t                 blocks;
@@ -905,8 +904,7 @@ static int osd_declare_attr_set(const struct lu_env *env,
  * to a transaction group.
  */
 static int osd_attr_set(const struct lu_env *env, struct dt_object *dt,
-                       const struct lu_attr *la, struct thandle *handle,
-                       struct lustre_capa *capa)
+                       const struct lu_attr *la, struct thandle *handle)
 {
        struct osd_object       *obj = osd_dt_obj(dt);
        struct osd_device       *osd = osd_obj2dev(obj);
@@ -1429,7 +1427,7 @@ static inline int osd_init_lma(const struct lu_env *env, struct osd_object *obj,
        buf.lb_len = sizeof(*lma);
 
        rc = osd_xattr_set_internal(env, obj, &buf, XATTR_NAME_LMA,
-                                   LU_XATTR_CREATE, oh, BYPASS_CAPA);
+                                   LU_XATTR_CREATE, oh);
 
        return rc;
 }
@@ -1600,145 +1598,6 @@ static int osd_object_ref_del(const struct lu_env *env,
        return rc;
 }
 
-static int capa_is_sane(const struct lu_env *env, struct osd_device *dev,
-                       struct lustre_capa *capa, struct lustre_capa_key *keys)
-{
-       struct osd_thread_info  *oti = osd_oti_get(env);
-       struct obd_capa         *oc;
-       int                      i, rc = 0;
-       ENTRY;
-
-       oc = capa_lookup(dev->od_capa_hash, capa, 0);
-       if (oc) {
-               if (capa_is_expired(oc)) {
-                       DEBUG_CAPA(D_ERROR, capa, "expired");
-                       rc = -ESTALE;
-               }
-               capa_put(oc);
-               RETURN(rc);
-       }
-
-       spin_lock(&capa_lock);
-       for (i = 0; i < 2; i++) {
-               if (keys[i].lk_keyid == capa->lc_keyid) {
-                       oti->oti_capa_key = keys[i];
-                       break;
-               }
-       }
-       spin_unlock(&capa_lock);
-
-       if (i == 2) {
-               DEBUG_CAPA(D_ERROR, capa, "no matched capa key");
-               RETURN(-ESTALE);
-       }
-
-       rc = capa_hmac(oti->oti_capa.lc_hmac, capa, oti->oti_capa_key.lk_key);
-       if (rc)
-               RETURN(rc);
-       if (memcmp(oti->oti_capa.lc_hmac, capa->lc_hmac, sizeof(capa->lc_hmac)))
-       {
-               DEBUG_CAPA(D_ERROR, capa, "HMAC mismatch");
-               RETURN(-EACCES);
-       }
-
-       oc = capa_add(dev->od_capa_hash, capa);
-       capa_put(oc);
-
-       RETURN(0);
-}
-
-static int osd_object_auth(const struct lu_env *env, struct dt_object *dt,
-                          struct lustre_capa *capa, __u64 opc)
-{
-       const struct lu_fid     *fid = lu_object_fid(&dt->do_lu);
-       struct osd_device       *dev = osd_dev(dt->do_lu.lo_dev);
-       int                      rc;
-
-       if (!dev->od_fl_capa)
-               return 0;
-
-       if (capa == BYPASS_CAPA)
-               return 0;
-
-       if (!capa) {
-               CERROR("no capability is provided for fid "DFID"\n", PFID(fid));
-               return -EACCES;
-       }
-
-       if (!lu_fid_eq(fid, &capa->lc_fid)) {
-               DEBUG_CAPA(D_ERROR, capa, "fid "DFID" mismatch with",PFID(fid));
-               return -EACCES;
-       }
-
-       if (!capa_opc_supported(capa, opc)) {
-               DEBUG_CAPA(D_ERROR, capa, "opc "LPX64" not supported by", opc);
-               return -EACCES;
-       }
-
-       if ((rc = capa_is_sane(env, dev, capa, dev->od_capa_keys))) {
-               DEBUG_CAPA(D_ERROR, capa, "insane (rc %d)", rc);
-               return -EACCES;
-       }
-
-       return 0;
-}
-
-static struct obd_capa *osd_capa_get(const struct lu_env *env,
-                                    struct dt_object *dt,
-                                    struct lustre_capa *old,
-                                    __u64 opc)
-{
-       struct osd_thread_info  *info = osd_oti_get(env);
-       const struct lu_fid     *fid = lu_object_fid(&dt->do_lu);
-       struct osd_object       *obj = osd_dt_obj(dt);
-       struct osd_device       *dev = osd_obj2dev(obj);
-       struct lustre_capa_key  *key = &info->oti_capa_key;
-       struct lustre_capa      *capa = &info->oti_capa;
-       struct obd_capa         *oc;
-       int                      rc;
-       ENTRY;
-
-       if (!dev->od_fl_capa)
-               RETURN(ERR_PTR(-ENOENT));
-
-       LASSERT(dt_object_exists(dt));
-       LASSERT(osd_invariant(obj));
-
-       /* renewal sanity check */
-       if (old && osd_object_auth(env, dt, old, opc))
-               RETURN(ERR_PTR(-EACCES));
-
-       capa->lc_fid = *fid;
-       capa->lc_opc = opc;
-       capa->lc_uid = 0;
-       capa->lc_flags = dev->od_capa_alg << 24;
-       capa->lc_timeout = dev->od_capa_timeout;
-       capa->lc_expiry = 0;
-
-       oc = capa_lookup(dev->od_capa_hash, capa, 1);
-       if (oc) {
-               LASSERT(!capa_is_expired(oc));
-               RETURN(oc);
-       }
-
-       spin_lock(&capa_lock);
-       *key = dev->od_capa_keys[1];
-       spin_unlock(&capa_lock);
-
-       capa->lc_keyid = key->lk_keyid;
-       capa->lc_expiry = cfs_time_current_sec() + dev->od_capa_timeout;
-
-       rc = capa_hmac(capa->lc_hmac, capa, key->lk_key);
-       if (rc) {
-               DEBUG_CAPA(D_ERROR, capa, "HMAC failed: %d for", rc);
-               LBUG();
-               RETURN(ERR_PTR(rc));
-       }
-
-       oc = capa_add(dev->od_capa_hash, capa);
-       RETURN(oc);
-}
-
 static int osd_object_sync(const struct lu_env *env, struct dt_object *dt,
                           __u64 start, __u64 end)
 {
@@ -1779,7 +1638,6 @@ static struct dt_object_operations osd_obj_ops = {
        .do_declare_xattr_del   = osd_declare_xattr_del,
        .do_xattr_del           = osd_xattr_del,
        .do_xattr_list          = osd_xattr_list,
-       .do_capa_get            = osd_capa_get,
        .do_object_sync         = osd_object_sync,
 };
 
@@ -1794,8 +1652,7 @@ static struct lu_object_operations osd_lu_obj_ops = {
 
 static int osd_otable_it_attr_get(const struct lu_env *env,
                                struct dt_object *dt,
-                               struct lu_attr *attr,
-                               struct lustre_capa *capa)
+                               struct lu_attr *attr)
 {
        attr->la_valid = 0;
        return 0;
index 3a0fbda..abffb58 100644 (file)
@@ -80,7 +80,6 @@ static uint64_t osd_objset_user_iused(struct osd_device *osd, uint64_t uidbytes)
  * \param dtrec - is the record to fill with space usage information
  * \param dtkey - is the id the of the user or group for which we would
  *                like to access disk usage.
- * \param capa - is the capability, not used.
  *
  * \retval +ve - success : exact match
  * \retval -ve - failure
@@ -88,8 +87,7 @@ static uint64_t osd_objset_user_iused(struct osd_device *osd, uint64_t uidbytes)
 static int osd_acct_index_lookup(const struct lu_env *env,
                                struct dt_object *dtobj,
                                struct dt_rec *dtrec,
-                               const struct dt_key *dtkey,
-                               struct lustre_capa *capa)
+                               const struct dt_key *dtkey)
 {
        struct osd_thread_info  *info = osd_oti_get(env);
        char                    *buf  = info->oti_buf;
@@ -148,12 +146,10 @@ static int osd_acct_index_lookup(const struct lu_env *env,
  *
  * \param  dt    - osd index object
  * \param  attr  - not used
- * \param  capa  - BYPASS_CAPA
  */
 static struct dt_it *osd_it_acct_init(const struct lu_env *env,
                                      struct dt_object *dt,
-                                     __u32 attr,
-                                     struct lustre_capa *capa)
+                                     __u32 attr)
 {
        struct osd_thread_info  *info = osd_oti_get(env);
        struct osd_it_quota     *it;
index 9a220a7..4ec0912 100644 (file)
@@ -239,8 +239,7 @@ int __osd_xattr_get(const struct lu_env *env, struct osd_object *obj,
 }
 
 int osd_xattr_get(const struct lu_env *env, struct dt_object *dt,
-                 struct lu_buf *buf, const char *name,
-                 struct lustre_capa *capa)
+                 struct lu_buf *buf, const char *name)
 {
        struct osd_object  *obj  = osd_dt_obj(dt);
        int                 rc, size = 0;
@@ -585,7 +584,7 @@ out:
 
 int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
                  const struct lu_buf *buf, const char *name, int fl,
-                 struct thandle *handle, struct lustre_capa *capa)
+                 struct thandle *handle)
 {
        struct osd_object  *obj = osd_dt_obj(dt);
        struct osd_thandle *oh;
@@ -611,7 +610,7 @@ int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
        down(&obj->oo_guard);
        CDEBUG(D_INODE, "Setting xattr %s with size %d\n",
                name, (int)buf->lb_len);
-       rc = osd_xattr_set_internal(env, obj, buf, name, fl, oh, capa);
+       rc = osd_xattr_set_internal(env, obj, buf, name, fl, oh);
        up(&obj->oo_guard);
 
        RETURN(rc);
@@ -727,8 +726,7 @@ int __osd_xattr_del(const struct lu_env *env, struct osd_object *obj,
 }
 
 int osd_xattr_del(const struct lu_env *env, struct dt_object *dt,
-                 const char *name, struct thandle *handle,
-                 struct lustre_capa *capa)
+                 const char *name, struct thandle *handle)
 {
        struct osd_object  *obj = osd_dt_obj(dt);
        struct osd_thandle *oh;
@@ -791,7 +789,7 @@ osd_sa_xattr_list(const struct lu_env *env, struct osd_object *obj,
 }
 
 int osd_xattr_list(const struct lu_env *env, struct dt_object *dt,
-                  const struct lu_buf *lb, struct lustre_capa *capa)
+                  const struct lu_buf *lb)
 {
        struct osd_object      *obj = osd_dt_obj(dt);
        struct osd_device      *osd = osd_obj2dev(obj);
index 86a9fac..db105c4 100644 (file)
@@ -180,7 +180,7 @@ static struct dt_object
                RETURN(dto);
 
        /* Get attributes of the local object. */
-       rc = dt_attr_get(env, dto, attr, NULL);
+       rc = dt_attr_get(env, dto, attr);
        if (rc) {
                CERROR("%s: can't be initialized: rc = %d\n",
                       osp->opd_obd->obd_name, rc);
index 7d84e56..243d3ca 100644 (file)
@@ -542,21 +542,19 @@ int osp_remote_sync(const struct lu_env *env, struct osp_device *osp,
                    struct ptlrpc_request **reqp, bool rpc_lock);
 /* osp_object.c */
 int osp_attr_get(const struct lu_env *env, struct dt_object *dt,
-                struct lu_attr *attr, struct lustre_capa *capa);
+                struct lu_attr *attr);
 int osp_xattr_get(const struct lu_env *env, struct dt_object *dt,
-                 struct lu_buf *buf, const char *name,
-                 struct lustre_capa *capa);
+                 struct lu_buf *buf, const char *name);
 int osp_declare_xattr_set(const struct lu_env *env, struct dt_object *dt,
                          const struct lu_buf *buf, const char *name,
                          int flag, struct thandle *th);
 int osp_xattr_set(const struct lu_env *env, struct dt_object *dt,
                  const struct lu_buf *buf, const char *name, int fl,
-                 struct thandle *th, struct lustre_capa *capa);
+                 struct thandle *th);
 int osp_declare_xattr_del(const struct lu_env *env, struct dt_object *dt,
                          const char *name, struct thandle *th);
 int osp_xattr_del(const struct lu_env *env, struct dt_object *dt,
-                 const char *name, struct thandle *th,
-                 struct lustre_capa *capa);
+                 const char *name, struct thandle *th);
 
 int osp_declare_object_destroy(const struct lu_env *env,
                               struct dt_object *dt, struct thandle *th);
@@ -567,7 +565,7 @@ int osp_trans_stop(const struct lu_env *env, struct dt_device *dt,
                   struct thandle *th);
 
 struct dt_it *osp_it_init(const struct lu_env *env, struct dt_object *dt,
-                         __u32 attr, struct lustre_capa *capa);
+                         __u32 attr);
 void osp_it_fini(const struct lu_env *env, struct dt_it *di);
 int osp_it_get(const struct lu_env *env, struct dt_it *di,
               const struct dt_key *key);
index a60417c..c031457 100644 (file)
@@ -501,13 +501,11 @@ int osp_md_declare_attr_set(const struct lu_env *env, struct dt_object *dt,
  * \param[in] dt       object to set attributes
  * \param[in] attr     attributes to be set
  * \param[in] th       the transaction handle
- * \param[in] capa     capability of setting attributes (not yet implemented).
  *
  * \retval             only return 0 for now
  */
 int osp_md_attr_set(const struct lu_env *env, struct dt_object *dt,
-                   const struct lu_attr *attr, struct thandle *th,
-                   struct lustre_capa *capa)
+                   const struct lu_attr *attr, struct thandle *th)
 {
        int rc = 0;
 
@@ -624,14 +622,12 @@ static int osp_md_object_write_locked(const struct lu_env *env,
  * \param[in] dt       index object to lookup
  * \param[out] rec     record in which to return lookup result
  * \param[in] key      key of index which will be looked up
- * \param[in] capa     capability of lookup (not yet implemented)
  *
  * \retval             1 if the lookup succeeds.
  * \retval              negative errno if the lookup fails.
  */
 static int osp_md_index_lookup(const struct lu_env *env, struct dt_object *dt,
-                              struct dt_rec *rec, const struct dt_key *key,
-                              struct lustre_capa *capa)
+                              struct dt_rec *rec, const struct dt_key *key)
 {
        struct lu_buf           *lbuf   = &osp_env_info(env)->osi_lb2;
        struct osp_device       *osp    = lu2osp_dev(dt->do_lu.lo_dev);
@@ -789,7 +785,6 @@ static int osp_md_declare_index_insert(const struct lu_env *env,
  * \param[in] rec      record of the index to be inserted
  * \param[in] key      key of the index to be inserted
  * \param[in] th       the transaction handle
- * \param[in] capa     capability of insert (not yet implemented)
  * \param[in] ignore_quota quota enforcement for insert
  *
  * \retval             only return 0 for now
@@ -799,7 +794,6 @@ static int osp_md_index_insert(const struct lu_env *env,
                               const struct dt_rec *rec,
                               const struct dt_key *key,
                               struct thandle *th,
-                              struct lustre_capa *capa,
                               int ignore_quota)
 {
        int rc = 0;
@@ -890,15 +884,13 @@ static int osp_md_declare_index_delete(const struct lu_env *env,
  * \param[in] dt       object for which to delete index
  * \param[in] key      key of the index which will be deleted
  * \param[in] th       the transaction handle
- * \param[in] capa     capability of delete (not yet implemented)
  *
  * \retval             only return 0 for now
  */
 static int osp_md_index_delete(const struct lu_env *env,
                               struct dt_object *dt,
                               const struct dt_key *key,
-                              struct thandle *th,
-                              struct lustre_capa *capa)
+                              struct thandle *th)
 {
        int rc = 0;
 
@@ -1261,15 +1253,13 @@ static ssize_t osp_md_declare_write(const struct lu_env *env,
  * \param[in] buf      buffer to write which includes an embedded size field
  * \param[in] pos      offet in the object to start writing at
  * \param[in] th       transaction handle
- * \param[in] capa     capability of the write (not yet implemented)
  * \param[in] ignore_quota quota enforcement for this write
  *
  * \retval             the buffer size in bytes.
  */
 static ssize_t osp_md_write(const struct lu_env *env, struct dt_object *dt,
                            const struct lu_buf *buf, loff_t *pos,
-                           struct thandle *handle,
-                           struct lustre_capa *capa, int ignore_quota)
+                           struct thandle *handle, int ignore_quota)
 {
        *pos += buf->lb_len;
        return buf->lb_len;
index 185e36d..8388f63 100644 (file)
@@ -493,13 +493,11 @@ static int osp_attr_get_interpterer(const struct lu_env *env,
  *
  * \param[in] env      pointer to the thread context
  * \param[in] dt       pointer to the OSP layer dt_object
- * \param[in] capa     the capability for this operation
  *
  * \retval             0 for success
  * \retval             negative error number on failure
  */
-static int osp_declare_attr_get(const struct lu_env *env, struct dt_object *dt,
-                               struct lustre_capa *capa)
+static int osp_declare_attr_get(const struct lu_env *env, struct dt_object *dt)
 {
        struct osp_object       *obj    = dt2osp_obj(dt);
        struct osp_device       *osp    = lu2osp_dev(dt->do_lu.lo_dev);
@@ -533,13 +531,12 @@ static int osp_declare_attr_get(const struct lu_env *env, struct dt_object *dt,
  * \param[in] env      pointer to the thread context
  * \param[in] dt       pointer to the OSP layer dt_object
  * \param[out] attr    pointer to the buffer to hold the output attribute
- * \param[in] capa     the capability for this operation
  *
  * \retval             0 for success
  * \retval             negative error number on failure
  */
 int osp_attr_get(const struct lu_env *env, struct dt_object *dt,
-                struct lu_attr *attr, struct lustre_capa *capa)
+                struct lu_attr *attr)
 {
        struct osp_device               *osp = lu2osp_dev(dt->do_lu.lo_dev);
        struct osp_object               *obj = dt2osp_obj(dt);
@@ -736,14 +733,12 @@ static int osp_declare_attr_set(const struct lu_env *env, struct dt_object *dt,
  * \param[in] dt       pointer to the OSP layer dt_object
  * \param[in] attr     pointer to the attribute to be set
  * \param[in] th       pointer to the transaction handler
- * \param[in] capa     the capability for this operation
  *
  * \retval             0 for success
  * \retval             negative error number on failure
  */
 static int osp_attr_set(const struct lu_env *env, struct dt_object *dt,
-                       const struct lu_attr *attr, struct thandle *th,
-                       struct lustre_capa *capa)
+                       const struct lu_attr *attr, struct thandle *th)
 {
        struct osp_object       *o = dt2osp_obj(dt);
        int                      rc = 0;
@@ -849,14 +844,12 @@ static int osp_xattr_get_interpterer(const struct lu_env *env,
  * \param[in] dt       pointer to the OSP layer dt_object
  * \param[out] buf     pointer to the lu_buf to hold the extended attribute
  * \param[in] name     the name for the expected extended attribute
- * \param[in] capa     the capability for this operation
  *
  * \retval             0 for success
  * \retval             negative error number on failure
  */
 static int osp_declare_xattr_get(const struct lu_env *env, struct dt_object *dt,
-                                struct lu_buf *buf, const char *name,
-                                struct lustre_capa *capa)
+                                struct lu_buf *buf, const char *name)
 {
        struct osp_object       *obj     = dt2osp_obj(dt);
        struct osp_device       *osp     = lu2osp_dev(dt->do_lu.lo_dev);
@@ -929,14 +922,12 @@ static int osp_declare_xattr_get(const struct lu_env *env, struct dt_object *dt,
  * \param[in] dt       pointer to the OSP layer dt_object
  * \param[out] buf     pointer to the lu_buf to hold the extended attribute
  * \param[in] name     the name for the expected extended attribute
- * \param[in] capa     the capability for this operation
  *
  * \retval             0 for success
  * \retval             negative error number on failure
  */
 int osp_xattr_get(const struct lu_env *env, struct dt_object *dt,
-                 struct lu_buf *buf, const char *name,
-                 struct lustre_capa *capa)
+                 struct lu_buf *buf, const char *name)
 {
        struct osp_device       *osp    = lu2osp_dev(dt->do_lu.lo_dev);
        struct osp_object       *obj    = dt2osp_obj(dt);
@@ -1246,14 +1237,13 @@ int osp_declare_xattr_set(const struct lu_env *env, struct dt_object *dt,
  * \param[in] fl       to indicate the detailed set operation: LU_XATTR_CREATE
  *                     or LU_XATTR_REPLACE or others
  * \param[in] th       pointer to the transaction handler
- * \param[in] capa     the capability for this operation
  *
  * \retval             0 for success
  * \retval             negative error number on failure
  */
 int osp_xattr_set(const struct lu_env *env, struct dt_object *dt,
                  const struct lu_buf *buf, const char *name, int fl,
-                 struct thandle *th, struct lustre_capa *capa)
+                 struct thandle *th)
 {
        int rc = 0;
 
@@ -1344,14 +1334,12 @@ int osp_declare_xattr_del(const struct lu_env *env, struct dt_object *dt,
  * \param[in] dt       pointer to the OSP layer dt_object
  * \param[in] name     the name of the extended attribute to be set
  * \param[in] th       pointer to the transaction handler
- * \param[in] capa     the capability for this operation
  *
  * \retval             0 for success
  * \retval             negative error number on failure
  */
 int osp_xattr_del(const struct lu_env *env, struct dt_object *dt,
-                 const char *name, struct thandle *th,
-                 struct lustre_capa *capa)
+                 const char *name, struct thandle *th)
 {
        int rc = 0;
 
@@ -1655,8 +1643,7 @@ int osp_object_destroy(const struct lu_env *env, struct dt_object *dt,
 static int osp_orphan_index_lookup(const struct lu_env *env,
                                   struct dt_object *dt,
                                   struct dt_rec *rec,
-                                  const struct dt_key *key,
-                                  struct lustre_capa *capa)
+                                  const struct dt_key *key)
 {
        return -EOPNOTSUPP;
 }
@@ -1675,7 +1662,6 @@ static int osp_orphan_index_insert(const struct lu_env *env,
                                   const struct dt_rec *rec,
                                   const struct dt_key *key,
                                   struct thandle *handle,
-                                  struct lustre_capa *capa,
                                   int ignore_quota)
 {
        return -EOPNOTSUPP;
@@ -1692,8 +1678,7 @@ static int osp_orphan_index_declare_delete(const struct lu_env *env,
 static int osp_orphan_index_delete(const struct lu_env *env,
                                   struct dt_object *dt,
                                   const struct dt_key *key,
-                                  struct thandle *handle,
-                                  struct lustre_capa *capa)
+                                  struct thandle *handle)
 {
        return -EOPNOTSUPP;
 }
@@ -1704,13 +1689,12 @@ static int osp_orphan_index_delete(const struct lu_env *env,
  * \param[in] env      pointer to the thread context
  * \param[in] dt       pointer to the index object to be iterated
  * \param[in] attr     unused
- * \param[in] capa     the capability for this operation
  *
  * \retval             pointer to the iteration structure
  * \retval             negative error number on failure
  */
 struct dt_it *osp_it_init(const struct lu_env *env, struct dt_object *dt,
-                         __u32 attr, struct lustre_capa *capa)
+                         __u32 attr)
 {
        struct osp_it *it;
 
@@ -2203,8 +2187,7 @@ static int osp_object_init(const struct lu_env *env, struct lu_object *o,
 
                po->opo_obj.do_ops = &osp_md_obj_ops;
                po->opo_obj.do_body_ops = &osp_md_body_ops;
-               rc = po->opo_obj.do_ops->do_attr_get(env, lu2dt_obj(o),
-                                                    la, NULL);
+               rc = po->opo_obj.do_ops->do_attr_get(env, lu2dt_obj(o), la);
                if (rc == 0)
                        o->lo_header->loh_attr |=
                                LOHA_EXISTS | (la->la_mode & S_IFMT);
index 913db2c..3b3e648 100644 (file)
@@ -66,7 +66,7 @@ static void *lprocfs_quota_seq_start(struct seq_file *p, loff_t *pos)
 
        /* initialize iterator */
        iops = &lqp->lqp_obj->do_index_ops->dio_it;
-       it = iops->init(&lqp->lqp_env, lqp->lqp_obj, 0, BYPASS_CAPA);
+       it = iops->init(&lqp->lqp_env, lqp->lqp_obj, 0);
        if (IS_ERR(it)) {
                CERROR("%s: failed to initialize iterator: rc = %ld\n",
                       lqp->lqp_obj->do_lu.lo_dev->ld_obd->obd_name,
index 2eaa3ec..5b3edd6 100644 (file)
@@ -486,7 +486,7 @@ int lquota_disk_for_each_slv(const struct lu_env *env, struct dt_object *parent,
        sprintf(name, "0x%x-", glb_fid->f_oid);
 
        iops = &parent->do_index_ops->dio_it;
-       it = iops->init(env, parent, 0, BYPASS_CAPA);
+       it = iops->init(env, parent, 0);
        if (IS_ERR(it)) {
                OBD_FREE(name, LQUOTA_NAME_MAX);
                RETURN(PTR_ERR(it));
@@ -578,8 +578,7 @@ int lquota_disk_read(const struct lu_env *env, struct dt_object *obj,
 
        /* lookup on-disk record from index file */
        dt_read_lock(env, obj, 0);
-       rc = dt_lookup(env, obj, rec, (struct dt_key *)&id->qid_uid,
-                      BYPASS_CAPA);
+       rc = dt_lookup(env, obj, rec, (struct dt_key *)&id->qid_uid);
        dt_read_unlock(env, obj);
 
        RETURN(rc);
@@ -655,11 +654,10 @@ int lquota_disk_write(const struct lu_env *env, struct thandle *th,
        dt_write_lock(env, obj, 0);
 
        /* check whether there is already an existing record for this ID */
-       rc = dt_lookup(env, obj, (struct dt_rec *)&qti->qti_rec, key,
-                      BYPASS_CAPA);
+       rc = dt_lookup(env, obj, (struct dt_rec *)&qti->qti_rec, key);
        if (rc == 0) {
                /* delete existing record in order to replace it */
-               rc = dt_delete(env, obj, key, th, BYPASS_CAPA);
+               rc = dt_delete(env, obj, key, th);
                if (rc)
                        GOTO(out, rc);
        } else if (rc == -ENOENT) {
@@ -671,11 +669,11 @@ int lquota_disk_write(const struct lu_env *env, struct thandle *th,
 
        if (rec != NULL) {
                /* insert record with updated quota settings */
-               rc = dt_insert(env, obj, rec, key, th, BYPASS_CAPA, 1);
+               rc = dt_insert(env, obj, rec, key, th, 1);
                if (rc) {
                        /* try to insert the old one */
                        rc = dt_insert(env, obj, (struct dt_rec *)&qti->qti_rec,
-                                      key, th, BYPASS_CAPA, 1);
+                                      key, th, 1);
                        LASSERTF(rc == 0, "failed to insert record in quota "
                                 "index "DFID"\n",
                                 PFID(lu_object_fid(&obj->do_lu)));
@@ -782,19 +780,18 @@ int lquota_disk_write_glb(const struct lu_env *env, struct dt_object *obj,
                if (tmp == NULL)
                        GOTO(out_lock, rc = -ENOMEM);
 
-               rc = dt_lookup(env, obj, (struct dt_rec *)tmp, key,
-                              BYPASS_CAPA);
+               rc = dt_lookup(env, obj, (struct dt_rec *)tmp, key);
 
                OBD_FREE_PTR(tmp);
                if (rc == 0) {
-                       rc = dt_delete(env, obj, key, th, BYPASS_CAPA);
+                       rc = dt_delete(env, obj, key, th);
                        if (rc)
                                GOTO(out_lock, rc);
                }
                rc = 0;
        }
 
-       rc = dt_insert(env, obj, (struct dt_rec *)rec, key, th, BYPASS_CAPA, 1);
+       rc = dt_insert(env, obj, (struct dt_rec *)rec, key, th, 1);
 out_lock:
        dt_write_unlock(env, obj);
 out:
index 0aec965..8bb7515 100644 (file)
@@ -190,7 +190,7 @@ int lquotactl_slv(const struct lu_env *env, struct dt_device *dev,
 
        /* lookup record storing space accounting information for this ID */
        rc = dt_lookup(env, obj, (struct dt_rec *)&qti->qti_acct_rec,
-                      (struct dt_key *)&key, BYPASS_CAPA);
+                      (struct dt_key *)&key);
        if (rc < 0)
                GOTO(out, rc);
 
@@ -212,7 +212,7 @@ int lquotactl_slv(const struct lu_env *env, struct dt_device *dev,
        memset(&qti->qti_slv_rec, 0, sizeof(qti->qti_slv_rec));
        /* lookup record storing enforcement information for this ID */
        rc = dt_lookup(env, obj, (struct dt_rec *)&qti->qti_slv_rec,
-                      (struct dt_key *)&key, BYPASS_CAPA);
+                      (struct dt_key *)&key);
        if (rc < 0 && rc != -ENOENT)
                GOTO(out, rc = 0);
 
index 1d92bce..e92937d 100644 (file)
@@ -305,7 +305,7 @@ static int qsd_reconciliation(const struct lu_env *env,
        LASSERT(qqi->qqi_glb_obj != NULL);
        iops = &qqi->qqi_glb_obj->do_index_ops->dio_it;
 
-       it = iops->init(env, qqi->qqi_glb_obj, 0, BYPASS_CAPA);
+       it = iops->init(env, qqi->qqi_glb_obj, 0);
        if (IS_ERR(it)) {
                CWARN("%s: Initialize it for "DFID" failed. %ld\n",
                      qsd->qsd_svname, PFID(&qqi->qqi_fid), PTR_ERR(it));
index 4742384..972391f 100644 (file)
@@ -315,7 +315,7 @@ static int out_tx_attr_set_exec(const struct lu_env *env, struct thandle *th,
               PFID(lu_object_fid(&dt_obj->do_lu)));
 
        dt_write_lock(env, dt_obj, MOR_TGT_CHILD);
-       rc = dt_attr_set(env, dt_obj, &arg->u.attr_set.attr, th, NULL);
+       rc = dt_attr_set(env, dt_obj, &arg->u.attr_set.attr, th);
        dt_write_unlock(env, dt_obj);
 
        CDEBUG(D_INFO, "%s: insert attr_set reply %p index %d: rc = %d\n",
@@ -412,7 +412,7 @@ static int out_attr_get(struct tgt_session_info *tsi)
        }
 
        dt_read_lock(env, obj, MOR_TGT_CHILD);
-       rc = dt_attr_get(env, obj, la, NULL);
+       rc = dt_attr_get(env, obj, la);
        if (rc)
                GOTO(out_unlock, rc);
 
@@ -473,7 +473,7 @@ static int out_xattr_get(struct tgt_session_info *tsi)
                       cfs_size_round((unsigned long)update_result->our_data -
                                      (unsigned long)update_result);
        dt_read_lock(env, obj, MOR_TGT_CHILD);
-       rc = dt_xattr_get(env, obj, lbuf, name, NULL);
+       rc = dt_xattr_get(env, obj, lbuf, name);
        dt_read_unlock(env, obj);
        if (rc < 0) {
                lbuf->lb_len = 0;
@@ -522,7 +522,7 @@ static int out_index_lookup(struct tgt_session_info *tsi)
                GOTO(out_unlock, rc = -ENOTDIR);
 
        rc = dt_lookup(env, obj, (struct dt_rec *)&tti->tti_fid1,
-               (struct dt_key *)name, NULL);
+                      (struct dt_key *)name);
 
        if (rc < 0)
                GOTO(out_unlock, rc);
@@ -563,8 +563,7 @@ static int out_tx_xattr_set_exec(const struct lu_env *env,
 
        dt_write_lock(env, dt_obj, MOR_TGT_CHILD);
        rc = dt_xattr_set(env, dt_obj, &arg->u.xattr_set.buf,
-                         arg->u.xattr_set.name, arg->u.xattr_set.flags,
-                         th, NULL);
+                         arg->u.xattr_set.name, arg->u.xattr_set.flags, th);
        /**
         * Ignore errors if this is LINK EA
         **/
@@ -711,8 +710,7 @@ static int out_tx_xattr_del_exec(const struct lu_env *env, struct thandle *th,
                GOTO(out, rc = -ENOENT);
 
        dt_write_lock(env, dt_obj, MOR_TGT_CHILD);
-       rc = dt_xattr_del(env, dt_obj, arg->u.xattr_set.name,
-                         th, NULL);
+       rc = dt_xattr_del(env, dt_obj, arg->u.xattr_set.name, th);
        dt_write_unlock(env, dt_obj);
 out:
        CDEBUG(D_INFO, "%s: insert xattr del reply %p index %d: rc = %d\n",
@@ -942,7 +940,7 @@ static int out_obj_index_insert(const struct lu_env *env,
                return -ENOTDIR;
 
        dt_write_lock(env, dt_obj, MOR_TGT_CHILD);
-       rc = dt_insert(env, dt_obj, rec, key, th, NULL, 0);
+       rc = dt_insert(env, dt_obj, rec, key, th, 0);
        dt_write_unlock(env, dt_obj);
 
        return rc;
@@ -963,7 +961,7 @@ static int out_obj_index_delete(const struct lu_env *env,
                return -ENOTDIR;
 
        dt_write_lock(env, dt_obj, MOR_TGT_CHILD);
-       rc = dt_delete(env, dt_obj, key, th, NULL);
+       rc = dt_delete(env, dt_obj, key, th);
        dt_write_unlock(env, dt_obj);
 
        return rc;
index f0f1ed6..a94a4d8 100644 (file)
@@ -97,12 +97,7 @@ static int tgt_mdt_body_unpack(struct tgt_session_info *tsi, __u32 flags)
        if (!IS_ERR(obj)) {
                if ((flags & HABEO_CORPUS) && !lu_object_exists(obj)) {
                        lu_object_put(tsi->tsi_env, obj);
-                       /* for capability renew ENOENT will be handled in
-                        * mdt_renew_capa */
-                       if (body->mbo_valid & OBD_MD_FLOSSCAPA)
-                               rc = 0;
-                       else
-                               rc = -ENOENT;
+                       rc = -ENOENT;
                } else {
                        tsi->tsi_corpus = obj;
                        rc = 0;
@@ -242,7 +237,6 @@ static int tgt_ost_body_unpack(struct tgt_session_info *tsi, __u32 flags)
 {
        struct ost_body         *body;
        struct req_capsule      *pill = tsi->tsi_pill;
-       struct lustre_capa      *capa;
        struct lu_nodemap       *nodemap;
        int                      rc;
 
@@ -265,15 +259,6 @@ static int tgt_ost_body_unpack(struct tgt_session_info *tsi, __u32 flags)
                                        NODEMAP_CLIENT_TO_FS,
                                        body->oa.o_gid);
 
-       if (body->oa.o_valid & OBD_MD_FLOSSCAPA) {
-               capa = req_capsule_client_get(pill, &RMF_CAPA1);
-               if (capa == NULL) {
-                       CERROR("%s: OSSCAPA flag is set without capability\n",
-                              tgt_name(tsi->tsi_tgt));
-                       RETURN(-EFAULT);
-               }
-       }
-
        tsi->tsi_ost_body = body;
        tsi->tsi_fid = body->oa.o_oi.oi_fid;
 
@@ -732,9 +717,7 @@ EXPORT_SYMBOL(tgt_counter_incr);
 static inline void tgt_init_sec_none(struct obd_connect_data *reply)
 {
        reply->ocd_connect_flags &= ~(OBD_CONNECT_RMT_CLIENT |
-                                     OBD_CONNECT_RMT_CLIENT_FORCE |
-                                     OBD_CONNECT_MDS_CAPA |
-                                     OBD_CONNECT_OSS_CAPA);
+                                     OBD_CONNECT_RMT_CLIENT_FORCE);
 }
 
 static int tgt_init_sec_level(struct ptlrpc_request *req)
@@ -800,15 +783,7 @@ static int tgt_init_sec_level(struct ptlrpc_request *req)
                       "as remote by default.\n", client, tgt_name(tgt));
        }
 
-       if (remote) {
-               if (!tgt->lut_oss_capa) {
-                       CDEBUG(D_SEC,
-                              "client %s -> target %s is set as remote,"
-                              " but OSS capabilities are not enabled: %d.\n",
-                              client, tgt_name(tgt), tgt->lut_oss_capa);
-                       RETURN(-EACCES);
-               }
-       } else {
+       if (remote == 0) {
                if (!uid_valid(make_kuid(&init_user_ns, req->rq_auth_uid))) {
                        CDEBUG(D_SEC, "client %s -> target %s: user is not "
                               "authenticated!\n", client, tgt_name(tgt));
@@ -837,10 +812,8 @@ static int tgt_init_sec_level(struct ptlrpc_request *req)
                        break;
                reply->ocd_connect_flags &= ~(OBD_CONNECT_RMT_CLIENT |
                                              OBD_CONNECT_RMT_CLIENT_FORCE);
-               if (!tgt->lut_oss_capa)
-                       reply->ocd_connect_flags &= ~OBD_CONNECT_OSS_CAPA;
-               if (!tgt->lut_mds_capa)
-                       reply->ocd_connect_flags &= ~OBD_CONNECT_MDS_CAPA;
+               reply->ocd_connect_flags &= ~OBD_CONNECT_OSS_CAPA;
+               reply->ocd_connect_flags &= ~OBD_CONNECT_MDS_CAPA;
                break;
        default:
                RETURN(-EINVAL);
@@ -1746,7 +1719,7 @@ int tgt_brw_read(struct tgt_session_info *tsi)
 
        npages = PTLRPC_MAX_BRW_PAGES;
        rc = obd_preprw(tsi->tsi_env, OBD_BRW_READ, exp, &repbody->oa, 1,
-                       ioo, remote_nb, &npages, local_nb, NULL, BYPASS_CAPA);
+                       ioo, remote_nb, &npages, local_nb, NULL);
        if (rc != 0)
                GOTO(out_lock, rc);
 
@@ -2012,8 +1985,7 @@ int tgt_brw_write(struct tgt_session_info *tsi)
 
        npages = PTLRPC_MAX_BRW_PAGES;
        rc = obd_preprw(tsi->tsi_env, OBD_BRW_WRITE, exp, &repbody->oa,
-                       objcount, ioo, remote_nb, &npages, local_nb, NULL,
-                       BYPASS_CAPA);
+                       objcount, ioo, remote_nb, &npages, local_nb, NULL);
        if (rc < 0)
                GOTO(out_lock, rc);
 
index 2457993..6066d59 100644 (file)
@@ -314,9 +314,9 @@ int tgt_truncate_last_rcvd(const struct lu_env *env, struct lu_target *tgt,
        if (rc)
                GOTO(cleanup, rc);
 
-       rc = dt_punch(env, dt, size, OBD_OBJECT_EOF, th, BYPASS_CAPA);
+       rc = dt_punch(env, dt, size, OBD_OBJECT_EOF, th);
        if (rc == 0)
-               rc = dt_attr_set(env, dt, &attr, th, BYPASS_CAPA);
+               rc = dt_attr_set(env, dt, &attr, th);
 
 cleanup:
        dt_trans_stop(env, tgt->lut_bottom, th);
@@ -997,7 +997,7 @@ int tgt_server_data_init(const struct lu_env *env, struct lu_target *tgt)
        __u32                            index;
        int                              rc, type;
 
-       rc = dt_attr_get(env, tgt->lut_last_rcvd, &tti->tti_attr, BYPASS_CAPA);
+       rc = dt_attr_get(env, tgt->lut_last_rcvd, &tti->tti_attr);
        if (rc)
                RETURN(rc);
 
index a1ad974..d7791ca 100644 (file)
@@ -67,8 +67,6 @@ int tgt_init(const struct lu_env *env, struct lu_target *lut,
        /* sptlrcp variables init */
        rwlock_init(&lut->lut_sptlrpc_lock);
        sptlrpc_rule_set_init(&lut->lut_sptlrpc_rset);
-       lut->lut_mds_capa = 1;
-       lut->lut_oss_capa = 1;
 
        spin_lock_init(&lut->lut_flags_lock);
        lut->lut_sync_lock_cancel = NEVER_SYNC_ON_CANCEL;
index e071394..f407b69 100644 (file)
@@ -96,8 +96,6 @@ MDT=$(do_facet $SINGLEMDS lctl get_param -N "mdt.\*MDT0000" |
 do_facet $SINGLEMDS "mkdir -p $CONFDIR"
 IDENTITY_FLUSH=mdt.$MDT.identity_flush
 IDENTITY_UPCALL=mdt.$MDT.identity_upcall
-MDSCAPA=mdt.$MDT.capa
-CAPA_TIMEOUT=mdt.$MDT.capa_timeout
 MDSSECLEVEL=mdt.$MDT.sec_level
 
 # for CLIENT_TYPE
@@ -318,266 +316,6 @@ test_4() {
 }
 run_test 4 "set supplementary group ==============="
 
-mds_capability_timeout() {
-        [ $# -lt 1 ] && echo "Miss mds capability timeout value" && return 1
-
-        echo "Set mds capability timeout as $1 seconds"
-       do_facet $SINGLEMDS "lctl set_param -n $CAPA_TIMEOUT=$1"
-        return 0
-}
-
-mds_sec_level_switch() {
-        [ $# -lt 1 ] && echo "Miss mds sec level switch value" && return 1
-
-        case $1 in
-                0) echo "Disable capa for all clients";;
-                1) echo "Enable capa for remote client";;
-               3) echo "Enable capa for all clients";;
-                *) echo "Invalid mds sec level switch value" && return 2;;
-        esac
-
-       do_facet $SINGLEMDS "lctl set_param -n $MDSSECLEVEL=$1"
-        return 0
-}
-
-oss_sec_level_switch() {
-        [ $# -lt 1 ] && echo "Miss oss sec level switch value" && return 1
-
-        case $1 in
-                0) echo "Disable capa for all clients";;
-                1) echo "Enable capa for remote client";;
-               3) echo "Enable capa for all clients";;
-                *) echo "Invalid oss sec level switch value" && return 2;;
-        esac
-
-       for i in `seq $OSTCOUNT`; do
-               local j=`expr $i - 1`
-               local OST="`do_facet ost$i "lctl get_param -N obdfilter.\*OST\*$j/stats 2>/dev/null | cut -d"." -f2" || true`"
-                [ -z "$OST" ] && return 3
-               do_facet ost$i "lctl set_param -n obdfilter.$OST.sec_level=$1"
-       done
-        return 0
-}
-
-mds_capability_switch() {
-        [ $# -lt 1 ] && echo "Miss mds capability switch value" && return 1
-
-        case $1 in
-                0) echo "Turn off mds capability";;
-                3) echo "Turn on mds capability";;
-                *) echo "Invalid mds capability switch value" && return 2;;
-        esac
-
-       do_facet $SINGLEMDS "lctl set_param -n $MDSCAPA=$1"
-        return 0
-}
-
-oss_capability_switch() {
-        [ $# -lt 1 ] && echo "Miss oss capability switch value" && return 1
-
-        case $1 in
-                0) echo "Turn off oss capability";;
-                1) echo "Turn on oss capability";;
-                *) echo "Invalid oss capability switch value" && return 2;;
-        esac
-
-       for i in `seq $OSTCOUNT`; do
-               local j=`expr $i - 1`
-               local OST="`do_facet ost$i "lctl get_param -N obdfilter.\*OST\*$j/stats 2>/dev/null | cut -d"." -f2" || true`"
-                [ -z "$OST" ] && return 3
-               do_facet ost$i "lctl set_param -n obdfilter.$OST.capa=$1"
-       done
-        return 0
-}
-
-turn_mds_capa_on() {
-        mds_capability_switch 3 || return 1
-       mds_sec_level_switch 3  || return 2
-        return 0
-}
-
-turn_oss_capa_on() {
-        oss_capability_switch 1 || return 1
-       oss_sec_level_switch 3  || return 2
-        return 0
-}
-
-turn_capability_on() {
-        local capa_timeout=${1:-"1800"}
-
-        # To turn on fid capability for the system,
-        # there is a requirement that fid capability
-        # is turned on on all MDS/OSS servers before
-        # client mount.
-
-       turn_mds_capa_on || return 1
-       turn_oss_capa_on || return 2
-        mds_capability_timeout $capa_timeout || return 3
-        remount_client $MOUNT || return 4
-        return 0
-}
-
-turn_mds_capa_off() {
-       mds_sec_level_switch 0  || return 1
-        mds_capability_switch 0 || return 2
-        return 0
-}
-
-turn_oss_capa_off() {
-       oss_sec_level_switch 0  || return 1
-        oss_capability_switch 0 || return 2
-        return 0
-}
-
-turn_capability_off() {
-        # to turn off fid capability, you can just do
-        # it in a live system. But, please turn off
-        # capability of all OSS servers before MDS servers.
-
-       turn_oss_capa_off || return 1
-       turn_mds_capa_off || return 2
-        return 0
-}
-
-# We demonstrate that access to the objects in the filesystem are not
-# accessible without supplying secrets from the MDS by disabling a
-# proc variable on the mds so that it does not supply secrets. We then
-# try and access objects which result in failure.
-test_5() {
-        local file=$DIR/f5
-
-       [ $GSS_SUP = 0 ] && skip "without GSS support." && return
-       if ! remote_mds; then
-                skip "client should be separated from server."
-                return
-        fi
-
-       rm -f $file
-
-       turn_capability_off
-       if [ $? != 0 ]; then
-               error "turn_capability_off"
-               return 1
-       fi
-
-        turn_oss_capa_on
-       if [ $? != 0 ]; then
-               error "turn_oss_capa_on"
-               return 2
-       fi
-
-       if [ "$CLIENT_TYPE" = "remote" ]; then
-               remount_client $MOUNT && return 3
-               turn_oss_capa_off
-               return 0
-       else
-               remount_client $MOUNT || return 4
-       fi
-
-        # proc variable disabled -- access to the objects in the filesystem
-        # is not allowed
-        echo "Should get Write error here : (proc variable are disabled "\
-            "-- access to the objects in the filesystem is denied."
-       $WTL $file 30
-       if [ $? == 0 ]; then
-               error "Write worked well even though secrets not supplied."
-               return 5
-        fi
-
-        turn_capability_on
-       if [ $? != 0 ]; then
-               error "turn_capability_on"
-               return 6
-       fi
-
-        sleep 5
-
-        # proc variable enabled, secrets supplied -- write should work now
-        echo "Should not fail here : (proc variable enabled, secrets supplied "\
-            "-- write should work now)."
-       $WTL $file 30
-       if [ $? != 0 ]; then
-               error "Write failed even though secrets supplied."
-               return 7
-        fi
-
-       turn_capability_off
-       if [ $? != 0 ]; then
-               error "turn_capability_off"
-               return 8
-       fi
-       rm -f $file
-}
-run_test 5 "capa secrets ========================="
-
-# Expiry: A test program is performing I/O on a file. It has credential
-# with an expiry half a minute later. While the program is running the
-# credentials expire and no automatic extensions or renewals are
-# enabled. The program will demonstrate an I/O failure.
-test_6() {
-        local file=$DIR/f6
-
-       [ $GSS_SUP = 0 ] && skip "without GSS support." && return
-       if ! remote_mds; then
-                skip "client should be separated from server."
-                return
-        fi
-
-       turn_capability_off
-       if [ $? != 0 ]; then
-               error "turn_capability_off"
-               return 1
-       fi
-
-       rm -f $file
-
-        turn_capability_on 30
-       if [ $? != 0 ]; then
-               error "turn_capability_on 30"
-               return 2
-       fi
-
-        # Token expiry
-       $WTL $file 60
-       if [ $? != 0 ]; then
-               error "$WTL $file 60"
-               return 3
-       fi
-
-       # Reset MDS capability timeout
-       mds_capability_timeout 30
-       if [ $? != 0 ]; then
-               error "mds_capability_timeout 30"
-               return 4
-       fi
-
-       $WTL $file 60 &
-       local PID=$!
-       sleep 5
-
-        # To disable automatic renew, only need turn capa off on MDS.
-       turn_mds_capa_off
-       if [ $? != 0 ]; then
-               error "turn_mds_capa_off"
-               return 5
-       fi
-
-       echo "We expect I/O failure."
-        wait $PID
-       if [ $? == 0 ]; then
-               echo "no I/O failure got."
-               return 6
-       fi
-
-       turn_capability_off
-       if [ $? != 0 ]; then
-               error "turn_capability_off"
-               return 7
-       fi
-       rm -f $file
-}
-run_test 6 "capa expiry ========================="
-
 create_nodemaps() {
        local i
        local out