Whamcloud - gitweb
LU-14291 lustre: further cleanup of acl code.
[fs/lustre-release.git] / lustre / mdt / mdt_internal.h
index 8e22408..bdecb34 100644 (file)
@@ -56,7 +56,6 @@
 #include <lustre_req_layout.h>
 #include <lustre_sec.h>
 #include <lustre_idmap.h>
-#include <lustre_eacl.h>
 #include <lustre_quota.h>
 #include <lustre_linkea.h>
 #include <lustre_lmv.h>
@@ -197,6 +196,7 @@ struct coordinator {
 enum {
        NO_DOM_LOCK_ON_OPEN = 0,
        TRYLOCK_DOM_ON_OPEN = 1,
+       /* not used anymore, left here for compatibility */
        ALWAYS_DOM_LOCK_ON_OPEN = 2,
        NUM_DOM_LOCK_ON_OPEN_MODES
 };
@@ -292,7 +292,9 @@ struct mdt_device {
                                   mdt_skip_lfsck:1,
                                   mdt_readonly:1,
                                   /* dir restripe migrate dirent only */
-                                  mdt_dir_restripe_nsonly:1;
+                                  mdt_dir_restripe_nsonly:1,
+                                  /* subdirectory mount of remote dir */
+                                  mdt_enable_remote_subdir_mount:1;
 
                                   /* user with gid can create remote/striped
                                    * dir, and set default dir stripe */
@@ -371,6 +373,7 @@ struct mdt_lock_handle {
        /* Regular lock */
        struct lustre_handle    mlh_reg_lh;
        enum ldlm_mode          mlh_reg_mode;
+       __u64                   mlh_gid;
 
        /* Pdirops lock */
        struct lustre_handle    mlh_pdo_lh;
@@ -571,14 +574,10 @@ static inline struct mdt_thread_info *mdt_th_info(const struct lu_env *env)
 }
 
 struct cdt_req_progress {
-       struct mutex             crp_lock;      /**< protect tree */
-       struct interval_node    *crp_root;      /**< tree to track extent
+       spinlock_t               crp_lock;      /**< protect tree */
+       struct interval_tree_root crp_root;     /**< tree to track extent
                                                 *   moved */
-       struct interval_node    **crp_node;     /**< buffer for tree nodes
-                                                *   vector of fixed size
-                                                *   vectors */
-       int                      crp_cnt;       /**< # of used nodes */
-       int                      crp_max;       /**< # of allocated nodes */
+       __u64                    crp_total;
 };
 
 struct cdt_agent_req {
@@ -745,7 +744,7 @@ static inline bool mdt_lmm_comp_overstriping(struct lov_mds_md *lmm)
 
        comp_v1 = (struct lov_comp_md_v1 *)lmm;
 
-       for (i = 1; i < le16_to_cpu(comp_v1->lcm_entry_count); i++) {
+       for (i = 0; i < le16_to_cpu(comp_v1->lcm_entry_count); i++) {
                off = le32_to_cpu(comp_v1->lcm_entries[i].lcme_offset);
                v1 = (struct lov_mds_md *)((char *)comp_v1 + off);
 
@@ -780,6 +779,7 @@ void mdt_lock_pdo_init(struct mdt_lock_handle *lh, enum ldlm_mode lock_mode,
                       const struct lu_name *lname);
 
 void mdt_lock_reg_init(struct mdt_lock_handle *lh, enum ldlm_mode lm);
+void mdt_lh_reg_init(struct mdt_lock_handle *lh, struct ldlm_lock *lock);
 
 int mdt_lock_setup(struct mdt_thread_info *info, struct mdt_object *mo,
                   struct mdt_lock_handle *lh);
@@ -1080,7 +1080,6 @@ struct cdt_agent_req *mdt_cdt_alloc_request(__u32 archive_id, __u64 flags,
 void mdt_cdt_free_request(struct cdt_agent_req *car);
 int mdt_cdt_add_request(struct coordinator *cdt, struct cdt_agent_req *new_car);
 struct cdt_agent_req *mdt_cdt_find_request(struct coordinator *cdt, u64 cookie);
-void mdt_cdt_get_work_done(struct cdt_agent_req *car, __u64 *done_sz);
 void mdt_cdt_get_request(struct cdt_agent_req *car);
 void mdt_cdt_put_request(struct cdt_agent_req *car);
 struct cdt_agent_req *mdt_cdt_update_request(struct coordinator *cdt,
@@ -1411,7 +1410,7 @@ static inline bool mdt_is_rootadmin(struct mdt_thread_info *info)
 
        uc = mdt_ucred(info);
        is_admin = (uc->uc_uid == 0 && uc->uc_gid == 0 &&
-                   md_capable(uc, CFS_CAP_SYS_ADMIN));
+                   md_capable(uc, CAP_SYS_ADMIN));
 
        mdt_exit_ucred(info);