Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / include / obd.h
index 81cd3d8..b42e2c3 100644 (file)
@@ -61,6 +61,7 @@
 
 #include <lustre/lustre_idl.h>
 #include <lu_object.h>
+#include <lu_ref.h>
 #include <lustre_lib.h>
 #include <lustre_export.h>
 #include <lustre_quota.h>
@@ -107,6 +108,12 @@ struct lov_oinfo {                 /* per-stripe data structure */
         struct osc_async_rc     loi_ar;
 };
 
+static inline void loi_kms_set(struct lov_oinfo *oinfo, __u64 kms)
+{
+        oinfo->loi_kms = kms;
+        oinfo->loi_kms_valid = 1;
+}
+
 static inline void loi_init(struct lov_oinfo *loi)
 {
         CFS_INIT_LIST_HEAD(&loi->loi_read_lop.lop_pending);
@@ -150,7 +157,7 @@ struct lov_stripe_md {
                 __u32 lw_stripe_size;      /* size of the stripe */
                 __u32 lw_pattern;          /* striping pattern (RAID0, RAID1) */
                 unsigned lw_stripe_count;  /* number of objects being striped over */
-                char  lw_pool_name[MAXPOOLNAME]; /* pool name */
+                char  lw_pool_name[LOV_MAXPOOLNAME]; /* pool name */
         } lsm_wire;
 
         struct lov_array_info *lsm_array; /*Only for joined file array info*/
@@ -356,6 +363,8 @@ struct filter_obd {
         obd_size             fo_tot_pending;
 
         obd_size             fo_readcache_max_filesize;
+        int                  fo_read_cache;
+        int                  fo_writethrough_cache;
 
         struct obd_import   *fo_mdc_imp;
         struct obd_uuid      fo_mdc_uuid;
@@ -501,7 +510,7 @@ struct client_obd {
         __u32                    cl_supp_cksum_types;
         /* checksum algorithm to be used */
         cksum_type_t             cl_cksum_type;
+
         /* also protected by the poorly named _loi_list_lock lock above */
         struct osc_async_rc      cl_ar;
 
@@ -701,14 +710,14 @@ struct lov_tgt_desc {
 #define pool_tgt(_p, _i)    _p->pool_lov->lov_tgts[_p->pool_obds.op_array[_i]]
 
 struct pool_desc {
-        char                    pool_name[MAXPOOLNAME + 1]; /* name of pool */
-        struct ost_pool         pool_obds;              /* pool members */
-        struct lov_qos_rr       pool_rr;                /* round robin qos */
-        struct hlist_node       pool_hash;              /* access by poolname */
-        struct list_head        pool_list;              /* serial access */
-        cfs_proc_dir_entry_t   *pool_proc_entry;        /* file in /proc */
-        struct lov_obd         *pool_lov;               /* lov obd to which this
-                                                           pool belong */
+        char                  pool_name[LOV_MAXPOOLNAME + 1]; /* name of pool */
+        struct ost_pool       pool_obds;              /* pool members */
+        struct lov_qos_rr     pool_rr;                /* round robin qos */
+        struct hlist_node     pool_hash;              /* access by poolname */
+        struct list_head      pool_list;              /* serial access */
+        cfs_proc_dir_entry_t *pool_proc_entry;        /* file in /proc */
+        struct lov_obd       *pool_lov;               /* lov obd to which this
+                                                         pool belong */
 };
 
 struct lov_obd {
@@ -742,10 +751,20 @@ struct lmv_tgt_desc {
         struct semaphore        ltd_fid_sem;
 };
 
+enum placement_policy {
+        PLACEMENT_CHAR_POLICY   = 0,
+        PLACEMENT_NID_POLICY    = 1,
+        PLACEMENT_INVAL_POLICY  = 2,
+        PLACEMENT_MAX_POLICY
+};
+
+typedef enum placement_policy placement_policy_t;
+
 struct lmv_obd {
         int                     refcount;
         struct lu_client_fld    lmv_fld;
         spinlock_t              lmv_lock;
+        placement_policy_t      lmv_placement;
         struct lmv_desc         desc;
         struct obd_uuid         cluuid;
         struct obd_export       *exp;
@@ -920,8 +939,6 @@ struct target_recovery_data {
         struct completion trd_finishing;
 };
 
-#define OBD_LLOG_GROUP  0
-
 enum filter_groups {
         FILTER_GROUP_LLOG = 1,
         FILTER_GROUP_ECHO,
@@ -936,6 +953,7 @@ struct obd_llog_group {
         spinlock_t         olg_lock;
         struct obd_export *olg_exp;
         int                olg_initializing;
+        struct semaphore   olg_cat_processing;
 };
 
 /* corresponds to one of the obd's */
@@ -1002,7 +1020,7 @@ struct obd_device {
         /* XXX encapsulate all this recovery data into one struct */
         svc_handler_t                    obd_recovery_handler;
         pid_t                            obd_processing_task;
-        
+
         int                              obd_max_recoverable_clients;
         int                              obd_connected_clients;
         int                              obd_recoverable_clients;
@@ -1018,7 +1036,7 @@ struct obd_device {
         time_t                           obd_recovery_end; /* seconds, for lprocfs_status */
         time_t                           obd_recovery_max_time; /* seconds, bz13079 */
         int                              obd_recovery_timeout;
-        
+
         /* new recovery stuff from CMD2 */
         struct target_recovery_data      obd_recovery_data;
         int                              obd_replayed_locks;
@@ -1055,12 +1073,18 @@ struct obd_device {
         atomic_t               obd_evict_inprogress;
         cfs_waitq_t            obd_evict_inprogress_waitq;
 
-        /** 
-         * Ldlm pool part. Save last calculated SLV and Limit. 
+        /**
+         * Ldlm pool part. Save last calculated SLV and Limit.
          */
         rwlock_t               obd_pool_lock;
         int                    obd_pool_limit;
         __u64                  obd_pool_slv;
+
+        /**
+         * A list of outstanding class_incref()'s against this obd. For
+         * debugging.
+         */
+        struct lu_ref          obd_reference;
 };
 
 #define OBD_OPT_FORCE           0x0001
@@ -1113,7 +1137,7 @@ static inline int it_to_lock_mode(struct lookup_intent *it)
                 return LCK_CW;
         else if (it->it_op & (IT_READDIR | IT_GETATTR | IT_OPEN | IT_LOOKUP))
                 return LCK_CR;
+
         LASSERTF(0, "Invalid it_op: %d\n", it->it_op);
         return -EINVAL;
 }
@@ -1209,7 +1233,8 @@ struct obd_ops {
         int (*o_reconnect)(const struct lu_env *env,
                            struct obd_export *exp, struct obd_device *src,
                            struct obd_uuid *cluuid,
-                           struct obd_connect_data *ocd);
+                           struct obd_connect_data *ocd,
+                           void *localdata);
         int (*o_disconnect)(struct obd_export *exp);
 
         /* Initialize/finalize fids infrastructure. */
@@ -1220,7 +1245,7 @@ struct obd_ops {
         int (*o_fid_alloc)(struct obd_export *exp, struct lu_fid *fid,
                            struct md_op_data *op_data);
 
-        /* 
+        /*
          * Object with @fid is getting deleted, we may want to do something
          * about this.
          */
@@ -1318,12 +1343,14 @@ struct obd_ops {
                          obd_id *startid, obd_gr group, void *data);
         int (*o_preprw)(int cmd, struct obd_export *exp, struct obdo *oa,
                         int objcount, struct obd_ioobj *obj,
-                        int niocount, struct niobuf_remote *remote,
-                        struct niobuf_local *local, struct obd_trans_info *oti,
+                        struct niobuf_remote *remote, int *nr_pages,
+                        struct niobuf_local *local,
+                        struct obd_trans_info *oti,
                         struct lustre_capa *capa);
         int (*o_commitrw)(int cmd, struct obd_export *exp, struct obdo *oa,
                           int objcount, struct obd_ioobj *obj,
-                          int niocount, struct niobuf_local *local,
+                          struct niobuf_remote *remote, int pages,
+                          struct niobuf_local *local,
                           struct obd_trans_info *oti, int rc);
         int (*o_enqueue)(struct obd_export *, struct obd_info *oinfo,
                          struct ldlm_enqueue_info *einfo,
@@ -1337,8 +1364,6 @@ struct obd_ops {
                         __u32 mode, struct lustre_handle *);
         int (*o_cancel_unused)(struct obd_export *, struct lov_stripe_md *,
                                int flags, void *opaque);
-        int (*o_join_lru)(struct obd_export *, struct lov_stripe_md *,
-                         int join);
         int (*o_init_export)(struct obd_export *exp);
         int (*o_destroy_export)(struct obd_export *exp);
         int (*o_extent_calc)(struct obd_export *, struct lov_stripe_md *,
@@ -1417,7 +1442,7 @@ enum {
 
 #define MAX_HASH_SIZE_32         0x7fffffffUL
 #define MAX_HASH_SIZE            0x7fffffffffffffffULL
-#define MAX_HASH_HIGHEST_BIT     0x1000000000000000
+#define MAX_HASH_HIGHEST_BIT     0x1000000000000000ULL
 
 struct lustre_md {
         struct mdt_body         *body;
@@ -1557,10 +1582,10 @@ struct lsm_operations {
                              struct lov_mds_md *lmm);
 };
 
-extern struct lsm_operations lsm_v1_ops;
-extern struct lsm_operations lsm_join_ops;
-extern struct lsm_operations lsm_v3_ops;
-static inline struct lsm_operations *lsm_op_find(int magic)
+extern const struct lsm_operations lsm_v1_ops;
+extern const struct lsm_operations lsm_join_ops;
+extern const struct lsm_operations lsm_v3_ops;
+static inline const struct lsm_operations *lsm_op_find(int magic)
 {
         switch(magic) {
         case LOV_MAGIC_V1: