X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Finclude%2Flustre_dlm.h;h=480bced559f338552984d641a98bdc237deb0841;hp=a2b9b9ddd12feab97531c472a740ae16571ed9e7;hb=ae0d69437e35961c257f076da6dcc1842a55456d;hpb=2c7a41a5c5958d36fa839ea91f3e63375cbd90fc diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h index a2b9b9d..480bced 100644 --- a/lustre/include/lustre_dlm.h +++ b/lustre/include/lustre_dlm.h @@ -568,6 +568,15 @@ typedef int (*ldlm_completion_callback)(struct ldlm_lock *lock, int flags, typedef int (*ldlm_glimpse_callback)(struct ldlm_lock *lock, void *data); typedef unsigned long (*ldlm_weigh_callback)(struct ldlm_lock *lock); +struct ldlm_glimpse_work { + struct ldlm_lock *gl_lock; /* lock to glimpse */ + cfs_list_t gl_list; /* linkage to other gl work structs */ + __u32 gl_flags;/* see LDLM_GL_WORK_* below */ +}; + +/* the ldlm_glimpse_work is allocated on the stack and should not be freed */ +#define LDLM_GL_WORK_NOFREE 0x1 + /* Interval node data for each LDLM_EXTENT lock */ struct ldlm_interval { struct interval_node li_node; /* node for tree mgmt */ @@ -585,7 +594,7 @@ struct ldlm_interval_tree { struct interval_node *lit_root; /* actually ldlm_interval */ }; -#define LUSTRE_TRACKS_LOCK_EXP_REFS (1) +#define LUSTRE_TRACKS_LOCK_EXP_REFS (0) /* Cancel flag. */ typedef enum { @@ -733,6 +742,22 @@ struct ldlm_lock { * Protected by lock and resource locks. */ l_destroyed:1, + /* + * it's set in lock_res_and_lock() and unset in unlock_res_and_lock(). + * + * NB: compare with check_res_locked(), check this bit is cheaper, + * also, spin_is_locked() is deprecated for kernel code, one reason is + * because it works only for SMP so user needs add extra macros like + * LASSERT_SPIN_LOCKED for uniprocessor kernels. + */ + l_res_locked:1, + /* + * it's set once we call ldlm_add_waiting_lock_res_locked() + * to start the lock-timeout timer and it will never be reset. + * + * Protected by lock_res_and_lock(). + */ + l_waited:1, /** * flag whether this is a server namespace lock. */ @@ -978,6 +1003,7 @@ int ldlm_server_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *, void *data, int flag); int ldlm_server_completion_ast(struct ldlm_lock *lock, int flags, void *data); int ldlm_server_glimpse_ast(struct ldlm_lock *lock, void *data); +int ldlm_glimpse_locks(struct ldlm_resource *res, cfs_list_t *gl_work_list); int ldlm_handle_enqueue(struct ptlrpc_request *req, ldlm_completion_callback, ldlm_blocking_callback, ldlm_glimpse_callback); int ldlm_handle_enqueue0(struct ldlm_namespace *ns, struct ptlrpc_request *req,