Whamcloud - gitweb
LU-5710 all: second batch of corrected typos and grammar errors
[fs/lustre-release.git] / lustre / include / lustre_export.h
index 27ea76f..022b4b6 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -67,6 +67,10 @@ struct tg_export_data {
        loff_t                  ted_lr_off;
        /** Client index in last_rcvd file */
        int                     ted_lr_idx;
+
+       /** nodemap this export is a member of */
+       struct lu_nodemap       *ted_nodemap;
+       struct hlist_node       ted_nodemap_member;
 };
 
 /**
@@ -75,14 +79,14 @@ struct tg_export_data {
 struct mdt_export_data {
        struct tg_export_data   med_ted;
        /** List of all files opened by client on this MDT */
-       cfs_list_t              med_open_head;
+       struct list_head        med_open_head;
        spinlock_t              med_open_lock; /* med_open_head, mfd_list */
        struct mutex            med_idmap_mutex;
        struct lustre_idmap_table *med_idmap;
 };
 
 struct ec_export_data { /* echo client */
-        cfs_list_t eced_locks;
+       struct list_head        eced_locks;
 };
 
 /* In-memory access to client data from OST struct */
@@ -90,9 +94,10 @@ struct ec_export_data { /* echo client */
 struct filter_export_data {
        struct tg_export_data   fed_ted;
        spinlock_t              fed_lock;       /**< protects fed_mod_list */
+       __u64                   fed_lastid_gen;
        long                    fed_dirty;    /* in bytes */
        long                    fed_grant;    /* in bytes */
-       cfs_list_t              fed_mod_list; /* files being modified */
+       struct list_head        fed_mod_list; /* files being modified */
        long                    fed_pending;  /* bytes just being written */
        /* count of SOFT_SYNC RPCs, which will be reset after
         * ofd_soft_sync_limit number of RPCs, and trigger a sync. */
@@ -103,7 +108,7 @@ struct filter_export_data {
 };
 
 struct mgs_export_data {
-       cfs_list_t              med_clients;    /* mgc fs client via this exp */
+       struct list_head        med_clients;    /* mgc fs client via this exp */
        spinlock_t              med_lock;       /* protect med_clients */
 };
 
@@ -112,27 +117,27 @@ struct mgs_export_data {
  * It tracks access patterns to this export on a per-client-NID basis
  */
 struct nid_stat {
-        lnet_nid_t               nid;
-        cfs_hlist_node_t         nid_hash;
-        cfs_list_t               nid_list;
-        struct obd_device       *nid_obd;
-        struct proc_dir_entry   *nid_proc;
-        struct lprocfs_stats    *nid_stats;
-        struct lprocfs_stats    *nid_ldlm_stats;
-        cfs_atomic_t             nid_exp_ref_count; /* for obd_nid_stats_hash
-                                                           exp_nid_stats */
+       lnet_nid_t               nid;
+       struct hlist_node        nid_hash;
+       struct list_head         nid_list;
+       struct obd_device       *nid_obd;
+       struct proc_dir_entry   *nid_proc;
+       struct lprocfs_stats    *nid_stats;
+       struct lprocfs_stats    *nid_ldlm_stats;
+       atomic_t                 nid_exp_ref_count; /* for obd_nid_stats_hash
+                                                      exp_nid_stats */
 };
 
 #define nidstat_getref(nidstat)                                                \
 do {                                                                           \
-        cfs_atomic_inc(&(nidstat)->nid_exp_ref_count);                         \
+       atomic_inc(&(nidstat)->nid_exp_ref_count);                         \
 } while(0)
 
 #define nidstat_putref(nidstat)                                                \
 do {                                                                           \
-        cfs_atomic_dec(&(nidstat)->nid_exp_ref_count);                         \
-        LASSERTF(cfs_atomic_read(&(nidstat)->nid_exp_ref_count) >= 0,          \
-                 "stat %p nid_exp_ref_count < 0\n", nidstat);                  \
+       atomic_dec(&(nidstat)->nid_exp_ref_count);                         \
+       LASSERTF(atomic_read(&(nidstat)->nid_exp_ref_count) >= 0,          \
+                "stat %p nid_exp_ref_count < 0\n", nidstat);                  \
 } while(0)
 
 enum obd_option {
@@ -149,43 +154,43 @@ enum obd_option {
  * attached to the same obd device.
  */
 struct obd_export {
-        /**
-         * Export handle, it's id is provided to client on connect
-         * Subsequent client RPCs contain this handle id to identify
-         * what export they are talking to.
-         */
-        struct portals_handle     exp_handle;
-        cfs_atomic_t              exp_refcount;
-        /**
-         * Set of counters below is to track where export references are
-         * kept. The exp_rpc_count is used for reconnect handling also,
-         * the cb_count and locks_count are for debug purposes only for now.
-         * The sum of them should be less than exp_refcount by 3
-         */
-        cfs_atomic_t              exp_rpc_count; /* RPC references */
-        cfs_atomic_t              exp_cb_count; /* Commit callback references */
+       /**
+        * Export handle, it's id is provided to client on connect
+        * Subsequent client RPCs contain this handle id to identify
+        * what export they are talking to.
+        */
+       struct portals_handle   exp_handle;
+       atomic_t                exp_refcount;
+       /**
+        * Set of counters below is to track where export references are
+        * kept. The exp_rpc_count is used for reconnect handling also,
+        * the cb_count and locks_count are for debug purposes only for now.
+        * The sum of them should be less than exp_refcount by 3
+        */
+       atomic_t                exp_rpc_count; /* RPC references */
+       atomic_t                exp_cb_count; /* Commit callback references */
        /** Number of queued replay requests to be processes */
-       cfs_atomic_t              exp_replay_count;
-        cfs_atomic_t              exp_locks_count; /** Lock references */
+       atomic_t                exp_replay_count;
+       atomic_t                exp_locks_count; /** Lock references */
 #if LUSTRE_TRACKS_LOCK_EXP_REFS
-        cfs_list_t                exp_locks_list;
-       spinlock_t                exp_locks_list_guard;
+       struct list_head        exp_locks_list;
+       spinlock_t              exp_locks_list_guard;
 #endif
         /** UUID of client connected to this export */
-        struct obd_uuid           exp_client_uuid;
+       struct obd_uuid         exp_client_uuid;
         /** To link all exports on an obd device */
-        cfs_list_t                exp_obd_chain;
-        cfs_hlist_node_t          exp_uuid_hash; /** uuid-export hash*/
-        cfs_hlist_node_t          exp_nid_hash; /** nid-export hash */
+       struct list_head        exp_obd_chain;
+       struct hlist_node       exp_uuid_hash;  /** uuid-export hash*/
+       struct hlist_node       exp_nid_hash;   /** nid-export hash */
         /**
          * All exports eligible for ping evictor are linked into a list
          * through this field in "most time since last request on this export"
          * order
          * protected by obd_dev_lock
          */
-        cfs_list_t                exp_obd_chain_timed;
-        /** Obd device of this export */
-        struct obd_device        *exp_obd;
+       struct list_head        exp_obd_chain_timed;
+       /** Obd device of this export */
+       struct obd_device      *exp_obd;
        /**
         * "reverse" import to send requests (e.g. from ldlm) back to client
         * exp_lock protect its change
@@ -194,24 +199,24 @@ struct obd_export {
         struct nid_stat          *exp_nid_stats;
         /** Active connetion */
         struct ptlrpc_connection *exp_connection;
-        /** Connection count value from last succesful reconnect rpc */
-        __u32                     exp_conn_cnt;
-        /** Hash list of all ldlm locks granted on this export */
-        cfs_hash_t               *exp_lock_hash;
-        /**
+       /** Connection count value from last successful reconnect rpc */
+       __u32                     exp_conn_cnt;
+       /** Hash list of all ldlm locks granted on this export */
+       cfs_hash_t               *exp_lock_hash;
+       /**
         * Hash list for Posix lock deadlock detection, added with
         * ldlm_lock::l_exp_flock_hash.
-         */
-       cfs_hash_t               *exp_flock_hash;
-        cfs_list_t                exp_outstanding_replies;
-        cfs_list_t                exp_uncommitted_replies;
-       spinlock_t                exp_uncommitted_replies_lock;
-        /** Last committed transno for this export */
-        __u64                     exp_last_committed;
-        /** When was last request received */
-        cfs_time_t                exp_last_request_time;
-        /** On replay all requests waiting for replay are linked here */
-        cfs_list_t                exp_req_replay_queue;
+        */
+       cfs_hash_t             *exp_flock_hash;
+       struct list_head        exp_outstanding_replies;
+       struct list_head        exp_uncommitted_replies;
+       spinlock_t              exp_uncommitted_replies_lock;
+       /** Last committed transno for this export */
+       __u64                   exp_last_committed;
+       /** When was last request received */
+       cfs_time_t              exp_last_request_time;
+       /** On replay all requests waiting for replay are linked here */
+       struct list_head        exp_req_replay_queue;
        /**
         * protects exp_flags, exp_outstanding_replies and the change
         * of exp_imp_reverse
@@ -232,6 +237,7 @@ struct obd_export {
                                   exp_req_replay_needed:1,
                                   exp_lock_replay_needed:1,
                                   exp_need_sync:1,
+                                 exp_keep_sync:1,
                                   exp_flvr_changed:1,
                                   exp_flvr_adapt:1,
                                   exp_libclient:1, /* liblustre client? */
@@ -245,13 +251,13 @@ struct obd_export {
         cfs_time_t                exp_flvr_expire[2];   /* seconds */
 
         /** protects exp_hp_rpcs */
-       spinlock_t                exp_rpc_lock;
-       cfs_list_t                exp_hp_rpcs;  /* (potential) HP RPCs */
-       cfs_list_t                exp_reg_rpcs;  /* RPC being handled */
+       spinlock_t              exp_rpc_lock;
+       struct list_head        exp_hp_rpcs;    /* (potential) HP RPCs */
+       struct list_head        exp_reg_rpcs;  /* RPC being handled */
 
-        /** blocking dlm lock list, protected by exp_bl_list_lock */
-        cfs_list_t                exp_bl_list;
-       spinlock_t                exp_bl_list_lock;
+       /** blocking dlm lock list, protected by exp_bl_list_lock */
+       struct list_head        exp_bl_list;
+       spinlock_t              exp_bl_list_lock;
 
         /** Target specific data */
         union {
@@ -262,7 +268,7 @@ struct obd_export {
                 struct mgs_export_data    eu_mgs_data;
         } u;
 
-       struct nodemap            *exp_nodemap;
+       struct adaptive_timeout    exp_bl_lock_at;
 };
 
 #define exp_target_data u.eu_target_data