- /**
- * big refcount (by bucket)
- */
- cfs_atomic_t ns_bref;
-
- /**
- * Namespce connect flags supported by server (may be changed via proc,
- * lru resize may be disabled/enabled).
- */
- __u64 ns_connect_flags;
-
- /**
- * Client side orig connect flags supported by server.
- */
- __u64 ns_orig_connect_flags;
-
- /**
- * Position in global namespace list.
- */
- cfs_list_t ns_list_chain;
-
- /**
- * All root resources in namespace.
- */
- cfs_list_t ns_unused_list;
- int ns_nr_unused;
-
- unsigned int ns_max_unused;
- unsigned int ns_max_age;
- unsigned int ns_timeouts;
- /**
- * Seconds.
- */
- unsigned int ns_ctime_age_limit;
-
- /**
- * Next debug dump, jiffies.
- */
- cfs_time_t ns_next_dump;
-
- ldlm_res_policy ns_policy;
- struct ldlm_valblock_ops *ns_lvbo;
- void *ns_lvbp;
- cfs_waitq_t ns_waitq;
- struct ldlm_pool ns_pool;
- ldlm_appetite_t ns_appetite;
-
- /**
- * If more than \a ns_contended_locks found, the resource is considered
- * to be contended.
- */
- unsigned ns_contended_locks;
-
- /**
- * The resource remembers contended state during \a ns_contention_time,
- * in seconds.
- */
- unsigned ns_contention_time;
-
- /**
- * Limit size of nolock requests, in bytes.
- */
- unsigned ns_max_nolock_size;
-
- /**
- * Limit of parallel AST RPC count.
- */
- unsigned ns_max_parallel_ast;
-
- /* callback to cancel locks before replaying it during recovery */
- ldlm_cancel_for_recovery ns_cancel_for_recovery;
- /**
- * ldlm lock stats
- */
- struct lprocfs_stats *ns_stats;
-
- unsigned ns_stopping:1; /* namespace cleanup */
+ /** big refcount (by bucket) */
+ atomic_t ns_bref;
+
+ /**
+ * Namespace connect flags supported by server (may be changed via
+ * /proc, LRU resize may be disabled/enabled).
+ */
+ __u64 ns_connect_flags;
+
+ /** Client side original connect flags supported by server. */
+ __u64 ns_orig_connect_flags;
+
+ /* namespace debugfs dir entry */
+ struct dentry *ns_debugfs_entry;
+
+ /**
+ * Position in global namespace list linking all namespaces on
+ * the node.
+ */
+ struct list_head ns_list_chain;
+
+ /**
+ * List of unused locks for this namespace. This list is also called
+ * LRU lock list.
+ * Unused locks are locks with zero reader/writer reference counts.
+ * This list is only used on clients for lock caching purposes.
+ * When we want to release some locks voluntarily or if server wants
+ * us to release some locks due to e.g. memory pressure, we take locks
+ * to release from the head of this list.
+ * Locks are linked via l_lru field in \see struct ldlm_lock.
+ */
+ struct list_head ns_unused_list;
+ /** Number of locks in the LRU list above */
+ int ns_nr_unused;
+ struct list_head *ns_last_pos;
+
+ /**
+ * Maximum number of locks permitted in the LRU. If 0, means locks
+ * are managed by pools and there is no preset limit, rather it is all
+ * controlled by available memory on this client and on server.
+ */
+ unsigned int ns_max_unused;
+
+ /** Maximum allowed age (last used time) for locks in the LRU */
+ ktime_t ns_max_age;
+
+ /**
+ * Server only: number of times we evicted clients due to lack of reply
+ * to ASTs.
+ */
+ unsigned int ns_timeouts;
+ /**
+ * Number of seconds since the file change time after which the
+ * MDT will return an UPDATE lock along with a LOOKUP lock.
+ * This allows the client to start caching negative dentries
+ * for a directory and may save an RPC for a later stat.
+ */
+ time64_t ns_ctime_age_limit;
+ /**
+ * Number of seconds since the lock was last used. The client may
+ * cancel the lock limited by this age and flush related data if
+ * any other client shows interest in it doing glimpse request.
+ * This allows to cache stat data locally for such files early.
+ */
+ time64_t ns_dirty_age_limit;
+ /**
+ * Used to rate-limit ldlm_namespace_dump calls.
+ * \see ldlm_namespace_dump. Increased by 10 seconds every time
+ * it is called.
+ */
+ time64_t ns_next_dump;
+
+ /** "policy" function that does actual lock conflict determination */
+ ldlm_res_policy ns_policy;
+
+ /**
+ * LVB operations for this namespace.
+ * \see struct ldlm_valblock_ops
+ */
+ struct ldlm_valblock_ops *ns_lvbo;
+
+ /**
+ * Used by filter code to store pointer to OBD of the service.
+ * Should be dropped in favor of \a ns_obd
+ */
+ void *ns_lvbp;
+
+ /**
+ * Wait queue used by __ldlm_namespace_free. Gets woken up every time
+ * a resource is removed.
+ */
+ wait_queue_head_t ns_waitq;
+ /** LDLM pool structure for this namespace */
+ struct ldlm_pool ns_pool;
+ /** Definition of how eagerly unused locks will be released from LRU */
+ enum ldlm_appetite ns_appetite;
+
+ /**
+ * If more than \a ns_contended_locks are found, the resource is
+ * considered to be contended. Lock enqueues might specify that no
+ * contended locks should be granted
+ */
+ unsigned ns_contended_locks;
+
+ /**
+ * The resources in this namespace remember contended state during
+ * \a ns_contention_time, in seconds.
+ */
+ time64_t ns_contention_time;
+
+ /**
+ * Limit size of contended extent locks, in bytes.
+ * If extended lock is requested for more then this many bytes and
+ * caller instructs us not to grant contended locks, we would disregard
+ * such a request.
+ */
+ unsigned ns_max_nolock_size;
+
+ /** Limit of parallel AST RPC count. */
+ unsigned ns_max_parallel_ast;
+
+ /**
+ * Callback to check if a lock is good to be canceled by ELC or
+ * during recovery.
+ */
+ ldlm_cancel_cbt ns_cancel;
+
+ /** LDLM lock stats */
+ struct lprocfs_stats *ns_stats;
+
+ /**
+ * Flag to indicate namespace is being freed. Used to determine if
+ * recalculation of LDLM pool statistics should be skipped.
+ */
+ unsigned ns_stopping:1;
+
+ /**
+ * Which bucket should we start with the lock reclaim.
+ */
+ int ns_reclaim_start;
+
+ struct kobject ns_kobj; /* sysfs object */
+ struct completion ns_kobj_unregister;