Whamcloud - gitweb
LU-10467 ldlm: convert waiting in ldlm_completion_ast()
[fs/lustre-release.git] / lustre / include / lustre_dlm.h
index 08d9093..4f69be7 100644 (file)
@@ -333,6 +333,8 @@ struct ldlm_ns_bucket {
         * Which res in the bucket should we start with the reclaim.
         */
        int                         nsb_reclaim_start;
+       /* counter of entries in this bucket */
+       atomic_t                nsb_count;
 };
 
 enum {
@@ -384,6 +386,8 @@ struct ldlm_namespace {
 
        /** Resource hash table for namespace. */
        struct cfs_hash         *ns_rs_hash;
+       struct ldlm_ns_bucket   *ns_rs_buckets;
+       unsigned int            ns_bucket_bits;
 
        /** serialize */
        spinlock_t              ns_lock;
@@ -672,7 +676,6 @@ enum ldlm_cancel_flags {
        LCF_ASYNC       = 0x1, /* Cancel locks asynchronously. */
        LCF_LOCAL       = 0x2, /* Cancel locks locally, not notifing server */
        LCF_BL_AST      = 0x4, /* Cancel LDLM_FL_BL_AST locks in the same RPC */
-       LCF_CONVERT     = 0x8, /* Try to convert IBITS lock before cancel */
 };
 
 struct ldlm_flock {
@@ -1200,12 +1203,11 @@ struct ldlm_enqueue_info {
        void            *ei_namespace;  /** lock namespace **/
        u64             ei_inodebits;   /** lock inode bits **/
        unsigned int    ei_enq_slave:1; /** whether enqueue slave stripes */
+       unsigned int    ei_enq_slot:1;  /** whether acquire rpc slot */
 };
 
 #define ei_res_id      ei_cb_gl
 
-extern struct obd_ops ldlm_obd_ops;
-
 extern char *ldlm_lockname[];
 extern char *ldlm_typename[];
 extern const char *ldlm_it2str(enum ldlm_intent_flags it);
@@ -1639,7 +1641,6 @@ int ldlm_lock_change_resource(struct ldlm_namespace *, struct ldlm_lock *,
 } while (0)
 
 /* ldlm_request.c */
-int ldlm_expired_completion_wait(void *data);
 /** \defgroup ldlm_local_ast Default AST handlers for local locks
  * These AST handlers are typically used for server-side local locks and are
  * also used by client-side lock handlers to perform minimum level base
@@ -1691,7 +1692,9 @@ int ldlm_cli_enqueue_local(const struct lu_env *env,
                           void *data, __u32 lvb_len, enum lvb_type lvb_type,
                           const __u64 *client_cookie,
                           struct lustre_handle *lockh);
-int ldlm_cli_convert(struct ldlm_lock *lock, __u32 *flags);
+int ldlm_cli_convert_req(struct ldlm_lock *lock, __u32 *flags, __u64 new_bits);
+int ldlm_cli_convert(struct ldlm_lock *lock,
+                    enum ldlm_cancel_flags cancel_flags);
 int ldlm_cli_update_pool(struct ptlrpc_request *req);
 int ldlm_cli_cancel(const struct lustre_handle *lockh,
                    enum ldlm_cancel_flags cancel_flags);
@@ -1717,8 +1720,8 @@ int ldlm_cli_cancel_list(struct list_head *head, int count,
                         enum ldlm_cancel_flags flags);
 
 int ldlm_inodebits_drop(struct ldlm_lock *lock, __u64 to_drop);
-int ldlm_cli_dropbits(struct ldlm_lock *lock, __u64 drop_bits);
-int ldlm_cli_dropbits_list(struct list_head *converts, __u64 drop_bits);
+int ldlm_cli_inodebits_convert(struct ldlm_lock *lock,
+                              enum ldlm_cancel_flags cancel_flags);
 
 /** @} ldlm_cli_api */