f2fs: clean up coding style and redundancy
[cascardo/linux.git] / drivers / staging / lustre / lustre / include / obd.h
index 4264d97..2d926e0 100644 (file)
@@ -37,7 +37,7 @@
 #ifndef __OBD_H
 #define __OBD_H
 
-#include "linux/obd.h"
+#include <linux/spinlock.h>
 
 #define IOC_OSC_TYPE    'h'
 #define IOC_OSC_MIN_NR       20
@@ -54,6 +54,7 @@
 #include "lustre_export.h"
 #include "lustre_fid.h"
 #include "lustre_fld.h"
+#include "lustre_intent.h"
 
 #define MAX_OBD_DEVICES 8192
 
@@ -165,9 +166,6 @@ struct obd_info {
        obd_enqueue_update_f    oi_cb_up;
 };
 
-void lov_stripe_lock(struct lov_stripe_md *md);
-void lov_stripe_unlock(struct lov_stripe_md *md);
-
 struct obd_type {
        struct list_head typ_chain;
        struct obd_ops *typ_dt_ops;
@@ -293,14 +291,10 @@ struct client_obd {
         * blocking everywhere, but we don't want to slow down fast-path of
         * our main platform.)
         *
-        * Exact type of ->cl_loi_list_lock is defined in arch/obd.h together
-        * with client_obd_list_{un,}lock() and
-        * client_obd_list_lock_{init,done}() functions.
-        *
         * NB by Jinshan: though field names are still _loi_, but actually
         * osc_object{}s are in the list.
         */
-       struct client_obd_lock         cl_loi_list_lock;
+       spinlock_t                     cl_loi_list_lock;
        struct list_head               cl_loi_ready_list;
        struct list_head               cl_loi_hp_ready_list;
        struct list_head               cl_loi_write_list;
@@ -327,7 +321,8 @@ struct client_obd {
        atomic_t                 cl_lru_shrinkers;
        atomic_t                 cl_lru_in_list;
        struct list_head         cl_lru_list; /* lru page list */
-       struct client_obd_lock   cl_lru_list_lock; /* page list protector */
+       spinlock_t               cl_lru_list_lock; /* page list protector */
+       atomic_t                 cl_unstable_count;
 
        /* number of in flight destroy rpcs is limited to max_rpcs_in_flight */
        atomic_t             cl_destroy_in_flight;
@@ -364,6 +359,7 @@ struct client_obd {
 
        /* ptlrpc work for writeback in ptlrpcd context */
        void                *cl_writeback_work;
+       void                    *cl_lru_work;
        /* hash tables for osc_quota_info */
        struct cfs_hash       *cl_quota_hash[MAXQUOTAS];
 };
@@ -391,45 +387,9 @@ struct ost_pool {
        struct rw_semaphore op_rw_sem;     /* to protect ost_pool use */
 };
 
-/* Round-robin allocator data */
-struct lov_qos_rr {
-       __u32          lqr_start_idx;   /* start index of new inode */
-       __u32          lqr_offset_idx;  /* aliasing for start_idx  */
-       int              lqr_start_count; /* reseed counter */
-       struct ost_pool     lqr_pool;   /* round-robin optimized list */
-       unsigned long       lqr_dirty:1;     /* recalc round-robin list */
-};
-
 /* allow statfs data caching for 1 second */
 #define OBD_STATFS_CACHE_SECONDS 1
 
-struct lov_statfs_data {
-       struct obd_info   lsd_oi;
-       struct obd_statfs lsd_statfs;
-};
-
-/* Stripe placement optimization */
-struct lov_qos {
-       struct list_head    lq_oss_list; /* list of OSSs that targets use */
-       struct rw_semaphore lq_rw_sem;
-       __u32           lq_active_oss_count;
-       unsigned int    lq_prio_free;   /* priority for free space */
-       unsigned int    lq_threshold_rr;/* priority for rr */
-       struct lov_qos_rr   lq_rr;        /* round robin qos data */
-       unsigned long       lq_dirty:1,     /* recalc qos data */
-                           lq_same_space:1,/* the ost's all have approx.
-                                            * the same space avail
-                                            */
-                           lq_reset:1,     /* zero current penalties */
-                           lq_statfs_in_progress:1; /* statfs op in
-                                                       progress */
-       /* qos statfs data */
-       struct lov_statfs_data *lq_statfs_data;
-       wait_queue_head_t lq_statfs_waitq; /* waitqueue to notify statfs
-                                           * requests completion
-                                           */
-};
-
 struct lov_tgt_desc {
        struct list_head          ltd_kill;
        struct obd_uuid     ltd_uuid;
@@ -442,25 +402,6 @@ struct lov_tgt_desc {
                            ltd_reap:1;  /* should this target be deleted */
 };
 
-/* Pool metadata */
-#define pool_tgt_size(_p)   _p->pool_obds.op_size
-#define pool_tgt_count(_p)  _p->pool_obds.op_count
-#define pool_tgt_array(_p)  _p->pool_obds.op_array
-#define pool_tgt_rw_sem(_p) _p->pool_obds.op_rw_sem
-
-struct pool_desc {
-       char              pool_name[LOV_MAXPOOLNAME + 1]; /* name of pool */
-       struct ost_pool       pool_obds;              /* pool members */
-       atomic_t          pool_refcount;          /* pool ref. counter */
-       struct lov_qos_rr     pool_rr;          /* round robin qos */
-       struct hlist_node      pool_hash;             /* access by poolname */
-       struct list_head            pool_list;        /* serial access */
-       struct dentry           *pool_debugfs_entry;    /* file in debugfs */
-       struct obd_device    *pool_lobd;        /* obd of the lov/lod to which
-                                                * this pool belongs
-                                                */
-};
-
 struct lov_obd {
        struct lov_desc  desc;
        struct lov_tgt_desc   **lov_tgts;             /* sparse array */
@@ -468,8 +409,6 @@ struct lov_obd {
        struct mutex            lov_lock;
        struct obd_connect_data lov_ocd;
        atomic_t            lov_refcount;
-       __u32              lov_tgt_count;        /* how many OBD's */
-       __u32              lov_active_tgt_count;  /* how many active */
        __u32              lov_death_row;/* tgts scheduled to be deleted */
        __u32              lov_tgt_size;   /* size of tgts array */
        int                  lov_connects;
@@ -479,7 +418,7 @@ struct lov_obd {
        struct dentry           *lov_pool_debugfs_entry;
        enum lustre_sec_part    lov_sp_me;
 
-       /* Cached LRU pages from upper layer */
+       /* Cached LRU and unstable data from upper layer */
        void                   *lov_cache;
 
        struct rw_semaphore     lov_notify_lock;
@@ -511,7 +450,7 @@ struct lmv_obd {
        struct obd_uuid         cluuid;
        struct obd_export       *exp;
 
-       struct mutex            init_mutex;
+       struct mutex            lmv_init_mutex;
        int                     connected;
        int                     max_easize;
        int                     max_def_easize;