Whamcloud - gitweb
LU-2739 mdt: Deny non-DNE client to access remote directory
[fs/lustre-release.git] / lustre / mdt / mdt_internal.h
index 339fc1a..664940c 100644 (file)
@@ -119,17 +119,17 @@ struct mdt_device {
        struct obd_export         *mdt_bottom_exp;
         /** target device */
         struct lu_target           mdt_lut;
-        /*
-         * Options bit-fields.
-         */
-        struct {
-                signed int         mo_user_xattr :1,
-                                   mo_acl        :1,
-                                   mo_compat_resname:1,
-                                   mo_mds_capa   :1,
-                                   mo_oss_capa   :1,
-                                   mo_cos        :1;
-        } mdt_opts;
+       /*
+        * Options bit-fields.
+        */
+       struct {
+               unsigned int       mo_user_xattr:1,
+                                  mo_acl:1,
+                                  mo_compat_resname:1,
+                                  mo_mds_capa:1,
+                                  mo_oss_capa:1,
+                                  mo_cos:1;
+       } mdt_opts;
         /* mdt state flags */
         unsigned long              mdt_state;
         /* lock to protect IOepoch */
@@ -589,6 +589,11 @@ static inline int mdt_object_exists(const struct mdt_object *o)
         return lu_object_exists(&o->mot_obj.mo_lu);
 }
 
+static inline int mdt_object_remote(const struct mdt_object *o)
+{
+       return lu_object_remote(&o->mot_obj.mo_lu);
+}
+
 static inline const struct lu_fid *mdt_object_fid(const struct mdt_object *o)
 {
         return lu_object_fid(&o->mot_obj.mo_lu);
@@ -615,6 +620,13 @@ static inline void mdt_export_evict(struct obd_export *exp)
         class_export_put(exp);
 }
 
+/* Here we use LVB_TYPE to check dne client, because it is
+ * also landed on 2.4. */
+static inline int mdt_is_dne_client(struct obd_export *exp)
+{
+       return !!(exp_connect_flags(exp) & OBD_CONNECT_LVB_TYPE);
+}
+
 int mdt_get_disposition(struct ldlm_reply *rep, int flag);
 void mdt_set_disposition(struct mdt_thread_info *info,
                         struct ldlm_reply *rep, int flag);
@@ -793,6 +805,7 @@ extern struct mdt_opc_slice mdt_fld_handlers[];
 int mdt_quotacheck(struct mdt_thread_info *info);
 int mdt_quotactl(struct mdt_thread_info *info);
 int mdt_quota_dqacq(struct mdt_thread_info *info);
+int mdt_swap_layouts(struct mdt_thread_info *info);
 
 extern struct lprocfs_vars lprocfs_mds_module_vars[];
 extern struct lprocfs_vars lprocfs_mds_obd_vars[];
@@ -1006,7 +1019,7 @@ void mdt_stats_counter_init(struct lprocfs_stats *stats);
 void lprocfs_mdt_init_vars(struct lprocfs_static_vars *lvars);
 void lprocfs_mds_init_vars(struct lprocfs_static_vars *lvars);
 int mdt_procfs_init(struct mdt_device *mdt, const char *name);
-int mdt_procfs_fini(struct mdt_device *mdt);
+void mdt_procfs_fini(struct mdt_device *mdt);
 void mdt_rename_counter_tally(struct mdt_thread_info *info,
                              struct mdt_device *mdt,
                              struct ptlrpc_request *req,