Whamcloud - gitweb
LU-13131 osc: Do not wait for grants for too long
[fs/lustre-release.git] / lustre / include / lustre_dlm.h
index 4f69be7..a1bda70 100644 (file)
@@ -435,7 +435,9 @@ struct ldlm_namespace {
         */
        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;
 
        /**
@@ -444,19 +446,20 @@ struct ldlm_namespace {
         */
        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
@@ -500,7 +503,7 @@ struct ldlm_namespace {
         * 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.
@@ -910,7 +913,7 @@ struct ldlm_lock {
         * 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;
@@ -1346,7 +1349,7 @@ struct ldlm_prolong_args {
        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;
 };
@@ -1392,10 +1395,10 @@ int ldlm_request_cancel(struct ptlrpc_request *req,
 /** @} 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);
@@ -1725,6 +1728,8 @@ int ldlm_cli_inodebits_convert(struct ldlm_lock *lock,
 
 /** @} 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);