*/
unsigned int ns_max_unused;
- /** Maximum allowed age (last used time) for locks in the LRU */
+ /** Maximum allowed age (last used time) for locks in the LRU. Set in
+ * seconds from userspace, but stored in ns to avoid repeat conversions.
+ */
ktime_t ns_max_age;
/**
*/
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.
+ * 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;
+ timeout_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.
+ * Number of (nano)seconds since the lock was last used. The client
+ * may cancel the lock older than this age and flush related data if
+ * another client shows interest in this lock by doing glimpse request.
+ * This allows to cache stat data locally for such files early. Set in
+ * seconds from userspace, but stored in ns to avoid repeat conversions.
*/
- time64_t ns_dirty_age_limit;
+ ktime_t ns_dirty_age_limit;
/**
* Used to rate-limit ldlm_namespace_dump calls.
* \see ldlm_namespace_dump. Increased by 10 seconds every time
* The resources in this namespace remember contended state during
* \a ns_contention_time, in seconds.
*/
- time64_t ns_contention_time;
+ timeout_t ns_contention_time;
/**
* Limit size of contended extent locks, in bytes.
*/
struct portals_handle l_handle;
/**
+ * Internal spinlock protects l_resource. We should hold this lock
+ * first before taking res_lock.
+ */
+ spinlock_t l_lock;
+ /**
* Pointer to actual resource this lock is in.
- * ldlm_lock_change_resource() can change this on the client.
- * When this is possible, rcu must be used to stablise
- * the resource while we lock and check it hasn't been changed.
+ * ldlm_lock_change_resource() can change this.
*/
- struct ldlm_resource __rcu *l_resource;
+ struct ldlm_resource *l_resource;
/**
* List item for client side LRU list.
* Protected by ns_lock in struct ldlm_namespace.
* under this lock.
* \see ost_rw_prolong_locks
*/
- time64_t l_callback_timeout;
+ time64_t l_callback_timestamp;
/** Local PID of process which created this lock. */
__u32 l_pid;
struct ldlm_res_id lpa_resid;
struct ldlm_extent lpa_extent;
enum ldlm_mode lpa_mode;
- time64_t lpa_timeout;
+ timeout_t lpa_timeout;
int lpa_locks_cnt;
int lpa_blocks_cnt;
};
/** @} ldlm_handlers */
void ldlm_revoke_export_locks(struct obd_export *exp);
-time64_t ldlm_bl_timeout(struct ldlm_lock *lock);
+timeout_t ldlm_bl_timeout(struct ldlm_lock *lock);
#endif
int ldlm_del_waiting_lock(struct ldlm_lock *lock);
-int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, time64_t timeout);
+int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, timeout_t timeout);
int ldlm_get_ref(void);
void ldlm_put_ref(void);
int ldlm_init_export(struct obd_export *exp);
/** @} ldlm_cli_api */
+extern unsigned int ldlm_enqueue_min;
+
/* mds/handler.c */
/* This has to be here because recursive inclusion sucks. */
int intent_disposition(struct ldlm_reply *rep, int flag);