Whamcloud - gitweb
LU-3756 mdt: Change HSM policy display
[fs/lustre-release.git] / lustre / mdt / mdt_internal.h
index 3eb82ae..7db09e8 100644 (file)
@@ -84,10 +84,12 @@ struct mdt_file_data {
        struct mdt_object    *mfd_object; /* point to opened object */
 };
 
-#define CDT_NONBLOCKING_RESTORE                0x0000000000000001ULL
-#define CDT_NORETRY_ACTION             0x0000000000000002ULL
-#define CDT_POLICY_MASK                        CDT_NONBLOCKING_RESTORE | \
-                                       CDT_NORETRY_ACTION
+#define CDT_NONBLOCKING_RESTORE                (1ULL << 0)
+#define CDT_NORETRY_ACTION             (1ULL << 1)
+#define CDT_POLICY_LAST                        CDT_NORETRY_ACTION
+#define CDT_POLICY_SHIFT_COUNT         2
+#define CDT_POLICY_ALL                 (CDT_NONBLOCKING_RESTORE | \
+                                       CDT_NORETRY_ACTION)
 
 /* when adding a new policy, do not forget to update
  * lustre/mdt/mdt_coordinator.c::hsm_policy_names[]
@@ -125,15 +127,17 @@ struct coordinator {
        cfs_time_t               cdt_loop_period;   /**< llog scan period */
        cfs_time_t               cdt_delay;         /**< request grace delay */
        cfs_time_t               cdt_timeout;       /**< request timeout */
+       __u32                    cdt_archive_id;    /** archive id used when
+                                                    * none are specified */
        __u64                    cdt_max_request;   /**< max count of started
                                                     * requests */
        atomic_t                 cdt_request_count; /**< current count of
                                                     * started requests */
-       cfs_list_t               cdt_requests;      /**< list of started
+       struct list_head         cdt_requests;      /**< list of started
                                                     * requests */
-       cfs_list_t               cdt_agents;        /**< list of register
+       struct list_head         cdt_agents;        /**< list of register
                                                     * agents */
-       cfs_list_t               cdt_restore_hdl;   /**< list of restore lock
+       struct list_head         cdt_restore_hdl;   /**< list of restore lock
                                                     * handles */
 };
 
@@ -253,8 +257,6 @@ struct mdt_object {
        struct rw_semaphore     mot_open_sem;
        atomic_t                mot_lease_count;
        atomic_t                mot_open_count;
-       /* A lock to protect EA data from racing setxattr and getxattrall */
-       struct rw_semaphore     mot_xattr_sem;
 };
 
 enum mdt_object_flags {
@@ -577,7 +579,7 @@ struct cdt_req_progress {
 
 struct cdt_agent_req {
        cfs_list_t               car_request_list; /**< to chain all the req. */
-       cfs_atomic_t             car_refcount;     /**< reference counter */
+       atomic_t                 car_refcount;     /**< reference counter */
        __u64                    car_compound_id;  /**< compound id */
        __u64                    car_flags;        /**< request original flags */
        struct obd_uuid          car_uuid;         /**< agent doing the req. */
@@ -597,10 +599,10 @@ struct hsm_agent {
        __u32           *ha_archive_id;         /**< archive id */
        int              ha_archive_cnt;        /**< number of archive entries
                                                 *   0 means any archive */
-       cfs_atomic_t     ha_requests;           /**< current request count */
-       cfs_atomic_t     ha_success;            /**< number of successful
+       atomic_t         ha_requests;           /**< current request count */
+       atomic_t         ha_success;            /**< number of successful
                                                 * actions */
-       cfs_atomic_t     ha_failure;            /**< number of failed actions */
+       atomic_t         ha_failure;            /**< number of failed actions */
 };
 
 struct cdt_restore_handle {