Lustre (mostly locking) unused code removal
cover Lustre (mostly locking) unused code removal
From: Oleg Drokin <[email protected]>
This continues the quest for killing unused code in the Lustre client.
Main focus in this set is on Lustre LDLM code - it kills both outright unused code and code that looks like it's used, but in fact also unused as various conditions that would lead to it would only happen on the server. Also LDLM is cleaned up to remove unneeded exported symbols and (almost) all locally used functions are now declared as static.
Also a few patches to llite/lov to remove some unused functions there.
Please consider.
Oleg Drokin (32):
staging/lustre/llite: Remove unused ll_get_default/max_cookiesize() staging/lustre: KEY_DEFAULT/MAX_COOKIESIZE key is unused, remove them staging/lustre: Remove ununused ll_ra_read_get() staging/lustre/llite: Remove unused ll_rmdir_entry() staging/lustre/lov: Remove unused lov_dump_lmm/pool() staging/lustre/lov: Remove unused lov_lsm_decref() staging/lustre/ldlm: Remove unused interval tree bits staging/lustre/ldlm: Remove unused ldlm_cancel_locks_for_exports() staging/lustre/ldlm: Remove ldlm_init/destroy_export() staging/lustre/ldlm: Remove unimplemented lock conversion traces. staging/lustre/ldlm: Get rid of lr_converting queue staging/lustre/ldlm: Remove unused ldlm_cli_enqueue_local() staging/lustre/ldlm: Remove unused ldlm_init/fini_flock_export staging/lustre/ldlm: Remove unused ldlm_enqueue_pack() staging/lustre/ldlm: Remove ldlm_errno2error() staging/lustre/ldlm: Remove ldlm_glimpse_ast() staging/lustre/ldlm: Remove ldlm_lock_fail_match() staging/lustre/ldlm: Remove ldlm_namespace_free() staging/lustre/ldlm: Remove unused ldlm_pool_get_clv() staging/lustre/ldlm: Remove unused ldlm_pool_set_slv() staging/lustre/ldlm: Remove ldlm_refresh/del_waiting_lock() staging/lustre/ldlm: Remove intent policies handler. staging/lustre/ldlm: Remove unused ldlm_reprocess_all*() staging/lustre/ldlm: Remove unused ldlm_resource_insert_lock_after() staging/lustre/ldlm: Remove unused ldlm_blocking_ast/_nocheck() staging/lustre: Remove ns_is_client()
staging/lustre: Remove ns_is_server()
staging/lustre/ldlm: Remove server side code from pool support. staging/lustre/ldlm: Remove unused exported symbols. staging/lustre/ldlm: Remove ldlm_namespace_inactive_list() staging/lustre/ldlm: Remove posix lock (flock) deadlock detection staging/lustre/ldlm: Make ldlm_add_ast_work_item() static
.../staging/lustre/lustre/include/interval_tree.h | 36 -- drivers/staging/lustre/lustre/include/lustre_dlm.h | 103 +---- drivers/staging/lustre/lustre/include/obd.h | 2 - drivers/staging/lustre/lustre/ldlm/interval_tree.c | 271 -------------- drivers/staging/lustre/lustre/ldlm/l_lock.c | 7 +- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 22 +- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 269 +------------ drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 36 +- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 36 -- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 380 ++----------------- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 122 +----- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 416 ++------------------- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 338 +---------------- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 181 +++------ .../staging/lustre/lustre/llite/llite_internal.h | 4 - drivers/staging/lustre/lustre/llite/llite_lib.c | 26 -- drivers/staging/lustre/lustre/llite/namei.c | 28 -- drivers/staging/lustre/lustre/llite/rw.c | 24 -- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 - .../staging/lustre/lustre/lov/lov_cl_internal.h | 3 - drivers/staging/lustre/lustre/lov/lov_internal.h | 2 - drivers/staging/lustre/lustre/lov/lov_object.c | 13 +- drivers/staging/lustre/lustre/lov/lov_pack.c | 20 - drivers/staging/lustre/lustre/lov/lov_pool.c | 22 -- drivers/staging/lustre/lustre/mdc/mdc_request.c | 20 - 25 files changed, 155 insertions(+), 2228 deletions(-)
Signature · 1 line
2.1.0
PATCH 1/32 staging/lustre/llite: Remove unused ll_get_default/max_cookiesize()
From: Oleg Drokin <[email protected]>
This was used for a function that's no longer important, but is no longer used anywhere.
--- .../staging/lustre/lustre/llite/llite_internal.h | 2 -- drivers/staging/lustre/lustre/llite/llite_lib.c | 26 ---------------------- 2 files changed, 28 deletions(-)
drivers/staging/lustre/lustre/llite/llite_internal.h +0 -2
@@ -789,8 +789,6 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,int ll_obd_statfs (struct inode *inode,void *arg);int ll_get_max_mdsize (struct ll_sb_info *sbi,int *max_mdsize);int ll_get_default_mdsize (struct ll_sb_info *sbi,int *default_mdsize); -int ll_get_max_cookiesize (struct ll_sb_info *sbi,int *max_cookiesize); -int ll_get_default_cookiesize (struct ll_sb_info *sbi,int *default_cookiesize);int ll_process_config (struct lustre_cfg *lcfg); struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data, struct inode *i1, struct inode *i2,
drivers/staging/lustre/lustre/llite/llite_lib.c +0 -26
@@ -604,32 +604,6 @@ int ll_get_default_mdsize(struct ll_sb_info *sbi, int *lmmsize)return rc; } -int ll_get_max_cookiesize (struct ll_sb_info *sbi,int *lmmsize) -{ -int size, rc; - - size =sizeof (int ); - rc =obd_get_info (NULL , sbi->ll_md_exp,sizeof (KEY_MAX_COOKIESIZE ), -KEY_MAX_COOKIESIZE , &size, lmmsize,NULL ); -if (rc) -CERROR ("Get max cookiesize error rc %d\n" , rc); - -return rc; -} - -int ll_get_default_cookiesize (struct ll_sb_info *sbi,int *lmmsize) -{ -int size, rc; - - size =sizeof (int ); - rc =obd_get_info (NULL , sbi->ll_md_exp,sizeof (KEY_DEFAULT_COOKIESIZE ), -KEY_DEFAULT_COOKIESIZE , &size, lmmsize,NULL ); -if (rc) -CERROR ("Get default cookiesize error rc %d\n" , rc); - -return rc; -} -static void client_common_put_super (struct super_block *sb) {struct ll_sb_info *sbi =ll_s2sbi (sb);
Signature · 1 line
2.1.0
PATCH 2/32 staging/lustre: KEY_DEFAULT/MAX_COOKIESIZE key is unused, remove them
In reply to [email protected]From: Oleg Drokin <[email protected]>
Also remove the lmv and mdc infrastructure to query these keys. In fact this whole "unlink cookies" thing becomes irrelevant with newer servers, but since we still retain 2.[123] servers commpatibility, we cannot completely remove all traces of it yet.
--- drivers/staging/lustre/lustre/include/obd.h | 2 -- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 -- drivers/staging/lustre/lustre/mdc/mdc_request.c | 20 -------------------- 3 files changed, 24 deletions(-)
drivers/staging/lustre/lustre/include/obd.h +0 -2
@@ -840,8 +840,6 @@ enum obd_cleanup_stage {#define KEY_LOV_IDX "lov_idx"#define KEY_MAX_EASIZE "max_easize"#define KEY_DEFAULT_EASIZE "default_easize" -#define KEY_MAX_COOKIESIZE "max_cookiesize" -#define KEY_DEFAULT_COOKIESIZE "default_cookiesize"#define KEY_MDS_CONN "mds_conn"#define KEY_MGSSEC "mgssec"#define KEY_NEXT_ID "next_id"
drivers/staging/lustre/lustre/lmv/lmv_obd.c +0 -2
@@ -2322,8 +2322,6 @@ static int lmv_get_info(const struct lu_env *env, struct obd_export *exp,return -EINVAL ; }else if (KEY_IS (KEY_MAX_EASIZE ) ||KEY_IS (KEY_DEFAULT_EASIZE ) || -KEY_IS (KEY_MAX_COOKIESIZE ) || -KEY_IS (KEY_DEFAULT_COOKIESIZE ) ||KEY_IS (KEY_CONN_DATA )) { rc =lmv_check_connect (obd);if (rc)
drivers/staging/lustre/lustre/mdc/mdc_request.c +0 -20
@@ -2124,26 +2124,6 @@ static int mdc_get_info(const struct lu_env *env, struct obd_export *exp, default_easize = val; *default_easize = exp->exp_obd->u.cli.cl_default_mds_easize;return 0 ; - }else if (KEY_IS (KEY_MAX_COOKIESIZE )) { -int mdsize, *max_cookiesize; - -if (*vallen !=sizeof (int )) -return -EINVAL ; - mdsize = *(int *)val; -if (mdsize > exp->exp_obd->u.cli.cl_max_mds_cookiesize) - exp->exp_obd->u.cli.cl_max_mds_cookiesize = mdsize; - max_cookiesize = val; - *max_cookiesize = exp->exp_obd->u.cli.cl_max_mds_cookiesize; -return 0 ; - }else if (KEY_IS (KEY_DEFAULT_COOKIESIZE )) { -int *default_cookiesize; - -if (*vallen !=sizeof (int )) -return -EINVAL ; - default_cookiesize = val; - *default_cookiesize = - exp->exp_obd->u.cli.cl_default_mds_cookiesize; -return 0 ; }else if (KEY_IS (KEY_CONN_DATA )) {struct obd_import *imp =class_exp2cliimp (exp);struct obd_connect_data *data = val;
Signature · 1 line
2.1.0
PATCH 3/32 staging/lustre: Remove ununused ll_ra_read_get()
In reply to [email protected]From: Oleg Drokin <[email protected]>
Also ll_ra_read_get_locked that was only used by it.
--- .../staging/lustre/lustre/llite/llite_internal.h | 1 - drivers/staging/lustre/lustre/llite/rw.c | 24 ---------------------- 2 files changed, 25 deletions(-)
drivers/staging/lustre/lustre/llite/llite_internal.h +0 -1
@@ -657,7 +657,6 @@ static inline int ll_need_32bit_api(struct ll_sb_info *sbi)void ll_ra_read_in (struct file *f,struct ll_ra_read *rar);void ll_ra_read_ex (struct file *f,struct ll_ra_read *rar); -struct ll_ra_read *ll_ra_read_get (struct file *f);/* llite/lproc_llite.c */ int ldebugfs_register_mountpoint(struct dentry *parent,
drivers/staging/lustre/lustre/llite/rw.c +0 -24
@@ -417,30 +417,6 @@ void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar)spin_unlock (&ras->ras_lock); } -static struct ll_ra_read *ll_ra_read_get_locked (struct ll_readahead_state *ras) -{ -struct ll_ra_read *scan; - -list_for_each_entry (scan, &ras->ras_read_beads, lrr_linkage) { -if (scan->lrr_reader == current) -return scan; - } -return NULL ; -} - -struct ll_ra_read *ll_ra_read_get (struct file *f) -{ -struct ll_readahead_state *ras; -struct ll_ra_read *bead; - - ras =ll_ras_get (f); - -spin_lock (&ras->ras_lock); - bead =ll_ra_read_get_locked (ras); -spin_unlock (&ras->ras_lock); -return bead; -} -static int cl_read_ahead_page (const struct lu_env *env,struct cl_io *io,struct cl_page_list *queue,struct cl_page *page,struct page *vmpage)
Signature · 1 line
2.1.0
PATCH 4/32 staging/lustre/llite: Remove unused ll_rmdir_entry()
In reply to [email protected]From: Oleg Drokin <[email protected]>
The ioctl for this function was removed, but the function was forgotten, so kill it now.
--- .../staging/lustre/lustre/llite/llite_internal.h | 1 - drivers/staging/lustre/lustre/llite/namei.c | 28 ---------------------- 2 files changed, 29 deletions(-)
drivers/staging/lustre/lustre/llite/llite_internal.h +0 -1
@@ -687,7 +687,6 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,int ll_md_blocking_ast (struct ldlm_lock *,struct ldlm_lock_desc *,void *data,int flag);struct dentry *ll_splice_alias (struct inode *inode,struct dentry *de); -int ll_rmdir_entry (struct inode *dir,char *name,int namelen);/* llite/rw.c */ int ll_prepare_write (struct file *,struct page *,unsigned from,unsigned to);
drivers/staging/lustre/lustre/llite/namei.c +0 -28
@@ -870,34 +870,6 @@ static inline void ll_get_child_fid(struct dentry *child, struct lu_fid *fid) *fid = *ll_inode2fid (d_inode (child)); } -/** -* Remove dir entry -**/ -int ll_rmdir_entry (struct inode *dir,char *name,int namelen) -{ -struct ptlrpc_request *request =NULL ; -struct md_op_data *op_data; -int rc; - -CDEBUG (D_VFSTRACE ,"VFS Op:name=%.*s,dir=%lu/%u(%p)\n" , - namelen, name, dir->i_ino, dir->i_generation, dir); - - op_data =ll_prep_md_op_data (NULL , dir,NULL , name,strlen (name), -S_IFDIR ,LUSTRE_OPC_ANY ,NULL ); -if (IS_ERR (op_data)) -return PTR_ERR (op_data); - op_data->op_cli_flags |=CLI_RM_ENTRY ; - rc =md_unlink (ll_i2sbi (dir)->ll_md_exp, op_data, &request); -ll_finish_md_op_data (op_data); -if (rc ==0 ) { -ll_update_times (request, dir); -ll_stats_ops_tally (ll_i2sbi (dir),LPROC_LL_RMDIR ,1 ); - } - -ptlrpc_req_finished (request); -return rc; -} -int ll_objects_destroy (struct ptlrpc_request *request,struct inode *dir) {struct mdt_body *body;
Signature · 1 line
2.1.0
PATCH 5/32 staging/lustre/lov: Remove unused lov_dump_lmm/pool()
In reply to [email protected]From: Oleg Drokin <[email protected]>
These generic switch functions appear to be unused as all the individual ones are called directly.
--- drivers/staging/lustre/lustre/lov/lov_internal.h | 2 -- drivers/staging/lustre/lustre/lov/lov_pack.c | 20 -------------------- drivers/staging/lustre/lustre/lov/lov_pool.c | 22 ---------------------- 3 files changed, 44 deletions(-)
drivers/staging/lustre/lustre/lov/lov_internal.h +0 -2
@@ -220,7 +220,6 @@ int lov_free_memmd(struct lov_stripe_md **lsmp);void lov_dump_lmm_v1 (int level,struct lov_mds_md_v1 *lmm);void lov_dump_lmm_v3 (int level,struct lov_mds_md_v3 *lmm);void lov_dump_lmm_common (int level,void *lmmp); -void lov_dump_lmm (int level,void *lmm);/* lov_ea.c */ struct lov_stripe_md *lsm_alloc_plain (__u16 stripe_count,int *size);
@@ -248,7 +247,6 @@ int lov_pool_new(struct obd_device *obd, char *poolname);int lov_pool_del (struct obd_device *obd,char *poolname);int lov_pool_add (struct obd_device *obd,char *poolname,char *ostname);int lov_pool_remove (struct obd_device *obd,char *poolname,char *ostname); -void lov_dump_pool (int level,struct pool_desc *pool);struct pool_desc *lov_find_pool (struct lov_obd *lov,char *poolname);int lov_check_index_in_pool (__u32 idx,struct pool_desc *pool);void lov_pool_putref (struct pool_desc *pool);
drivers/staging/lustre/lustre/lov/lov_pack.c +0 -20
@@ -100,26 +100,6 @@ void lov_dump_lmm_v3(int level, struct lov_mds_md_v3 *lmm) le16_to_cpu(lmm->lmm_stripe_count)); } -void lov_dump_lmm (int level,void *lmm) -{ -int magic; - - magic =le32_to_cpu (((struct lov_mds_md *)lmm)->lmm_magic); -switch (magic) { -case LOV_MAGIC_V1 : -lov_dump_lmm_v1 (level, (struct lov_mds_md_v1 *)lmm); -break ; -case LOV_MAGIC_V3 : -lov_dump_lmm_v3 (level, (struct lov_mds_md_v3 *)lmm); -break ; -default : -CDEBUG (level,"unrecognized lmm_magic %x, assuming %x\n" , - magic,LOV_MAGIC_V1 ); -lov_dump_lmm_common (level, lmm); -break ; - } -} -/* Pack LOV object metadata for disk storage. It is packed in LE byte * order and is opaque to the networking layer. *
drivers/staging/lustre/lustre/lov/lov_pool.c +0 -22
@@ -294,28 +294,6 @@ static struct file_operations pool_proc_operations = { .release = seq_release, }; -void lov_dump_pool (int level,struct pool_desc *pool) -{ -int i; - -lov_pool_getref (pool); - -CDEBUG (level,"pool " LOV_POOLNAMEF " has %d members\n" , - pool->pool_name, pool->pool_obds.op_count); -down_read (&pool_tgt_rw_sem (pool)); - -for (i =0 ; i <pool_tgt_count (pool) ; i++) { -if (!pool_tgt (pool, i) || !(pool_tgt (pool, i))->ltd_exp) -continue ; -CDEBUG (level,"pool " LOV_POOLNAMEF "[%d] = %s\n" , - pool->pool_name, i, -obd_uuid2str (&((pool_tgt (pool, i))->ltd_uuid))); - } - -up_read (&pool_tgt_rw_sem (pool)); -lov_pool_putref (pool); -} -#define LOV_POOL_INIT_COUNT 2int lov_ost_pool_init (struct ost_pool *op,unsigned int count) {
Signature · 1 line
2.1.0
PATCH 6/32 staging/lustre/lov: Remove unused lov_lsm_decref()
In reply to [email protected]From: Oleg Drokin <[email protected]>
Also lov_lsm_addref is only used in the file it is defined, so make it static
--- drivers/staging/lustre/lustre/lov/lov_cl_internal.h | 3 --- drivers/staging/lustre/lustre/lov/lov_object.c | 13 +------------ 2 files changed, 1 insertion(+), 15 deletions(-)
drivers/staging/lustre/lustre/lov/lov_cl_internal.h +0 -3
@@ -637,9 +637,6 @@ struct lov_io_sub *lov_page_subio(const struct lu_env *env,struct lov_io *lio, const struct cl_page_slice *slice); -void lov_lsm_decref (struct lov_object *lov,struct lov_stripe_md *lsm); -struct lov_stripe_md *lov_lsm_addref (struct lov_object *lov); -#define lov_foreach_target (lov, var) \ for (var = 0; var < lov_targets_nr(lov); ++var)
drivers/staging/lustre/lustre/lov/lov_object.c +1 -12
@@ -909,7 +909,7 @@ struct lu_object *lov_object_alloc(const struct lu_env *env,return obj; } -struct lov_stripe_md *lov_lsm_addref (struct lov_object *lov) +static struct lov_stripe_md *lov_lsm_addref (struct lov_object *lov) {struct lov_stripe_md *lsm =NULL ;
@@ -924,17 +924,6 @@ struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov)return lsm; } -void lov_lsm_decref (struct lov_object *lov,struct lov_stripe_md *lsm) -{ -if (lsm ==NULL ) -return ; - -CDEBUG (D_INODE ,"lsm %p decref %d by %p.\n" , - lsm,atomic_read (&lsm->lsm_refc), current); - -lov_free_memmd (&lsm); -} -struct lov_stripe_md *lov_lsm_get (struct cl_object *clobj) {struct lu_object *luobj;
Signature · 1 line
2.1.0
PATCH 7/32 staging/lustre/ldlm: Remove unused interval tree bits
In reply to [email protected]From: Oleg Drokin <[email protected]>
On client side interval-tree code operations are pretty basic, so get rid of the code that is only used on the server to figure out how much to extend the locks and such.
--- .../staging/lustre/lustre/include/interval_tree.h | 36 --- drivers/staging/lustre/lustre/ldlm/interval_tree.c | 271 --------------------- 2 files changed, 307 deletions(-)
drivers/staging/lustre/lustre/include/interval_tree.h +0 -36
@@ -67,11 +67,6 @@ static inline int interval_is_intree(struct interval_node *node)return node->in_intree ==1 ; } -static inline __u64 interval_low (struct interval_node *node) -{ -return node->in_extent.start; -} -static inline __u64 interval_high (struct interval_node *node) {return node->in_extent.end;
@@ -86,39 +81,8 @@ static inline void interval_set(struct interval_node *node, node->in_max_high = end; } -/* Rules to write an interval callback. -* - the callback returns INTERVAL_ITER_STOP when it thinks the iteration -* should be stopped. It will then cause the iteration function to return -* immediately with return value INTERVAL_ITER_STOP. -* - callbacks for interval_iterate and interval_iterate_reverse: Every -* nodes in the tree will be set to @node before the callback being called -* - callback for interval_search: Only overlapped node will be set to @node -* before the callback being called. -*/ -typedef enum interval_iter (*interval_callback_t )(struct interval_node *node, -void *args); -struct interval_node *interval_insert (struct interval_node *node,struct interval_node **root);void interval_erase (struct interval_node *node,struct interval_node **root); -/* Search the extents in the tree and call @func for each overlapped -* extents. */ -enum interval_iter interval_search (struct interval_node *root, -struct interval_node_extent *ex, -interval_callback_t func,void *data); - -/* Iterate every node in the tree - by reverse order or regular order. */ -enum interval_iter interval_iterate (struct interval_node *root, -interval_callback_t func,void *data); -enum interval_iter interval_iterate_reverse (struct interval_node *root, -interval_callback_t func,void *data); - -void interval_expand (struct interval_node *root, -struct interval_node_extent *ext, -struct interval_node_extent *limiter); -int interval_is_overlapped (struct interval_node *root, -struct interval_node_extent *ex); -struct interval_node *interval_find (struct interval_node *root, -struct interval_node_extent *ex);#endif
drivers/staging/lustre/lustre/ldlm/interval_tree.c +0 -271
298 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 8/32 staging/lustre/ldlm: Remove unused ldlm_cancel_locks_for_exports()
In reply to [email protected]From: Oleg Drokin <[email protected]>
This is only used on the server in case a client gets disconnected.
--- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 - drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 50 ---------------------- 2 files changed, 52 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +0 -2
@@ -164,8 +164,6 @@ void ldlm_lock_add_to_lru(struct ldlm_lock *lock);void ldlm_lock_touch_in_lru (struct ldlm_lock *lock);void ldlm_lock_destroy_nolock (struct ldlm_lock *lock); -void ldlm_cancel_locks_for_export (struct obd_export *export); -/* ldlm_lockd.c */ int ldlm_bl_to_thread_lock (struct ldlm_namespace *ns,struct ldlm_lock_desc *ld,struct ldlm_lock *lock);
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +0 -50
56 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 9/32 staging/lustre/ldlm: Remove ldlm_init/destroy_export()
In reply to [email protected]From: Oleg Drokin <[email protected]>
These functions are used on the server-only, so get rid of them. Also get rid of ldlm export hash operations and the struct.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 - drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 105 --------------------- 2 files changed, 107 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -2
@@ -1114,8 +1114,6 @@ int ldlm_del_waiting_lock(struct ldlm_lock *lock);int ldlm_refresh_waiting_lock (struct ldlm_lock *lock,int timeout);int ldlm_get_ref (void );void ldlm_put_ref (void ); -int ldlm_init_export (struct obd_export *exp); -void ldlm_destroy_export (struct obd_export *exp);struct ldlm_lock *ldlm_request_lock (struct ptlrpc_request *req);/* ldlm_lock.c */
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +0 -105
111 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 10/32 staging/lustre/ldlm: Remove unimplemented lock conversion traces.
In reply to [email protected]From: Oleg Drokin <[email protected]>
Lock conversion is not really implemented, so let's stop pretending here.
This removes ldlm_lock_convert, ldlm_cli_lock_convert and ldlm_lock_downgrade.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 4 - drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 119 --------------------- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 101 ----------------- 3 files changed, 224 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -4
@@ -1228,9 +1228,6 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags, struct lustre_handle *, int unref);ldlm_mode_t ldlm_revalidate_lock_handle (struct lustre_handle *lockh,__u64 *bits); -struct ldlm_resource *ldlm_lock_convert (struct ldlm_lock *lock,int new_mode, -__u32 *flags); -void ldlm_lock_downgrade (struct ldlm_lock *lock,int new_mode);void ldlm_lock_cancel (struct ldlm_lock *lock);void ldlm_reprocess_all (struct ldlm_resource *res);void ldlm_reprocess_all_ns (struct ldlm_namespace *ns);
@@ -1332,7 +1329,6 @@ int ldlm_cli_enqueue_local(struct ldlm_namespace *ns, struct lustre_handle *lockh);int ldlm_server_ast (struct lustre_handle *lockh,struct ldlm_lock_desc *new,void *data,__u32 data_len); -int ldlm_cli_convert (struct lustre_handle *,int new_mode,__u32 *flags);int ldlm_cli_update_pool (struct ptlrpc_request *req);int ldlm_cli_cancel (struct lustre_handle *lockh,ldlm_cancel_flags_t cancel_flags);
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +0 -119
125 lines not on this page · raw message
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +0 -101
107 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 11/32 staging/lustre/ldlm: Get rid of lr_converting queue
In reply to [email protected]From: Oleg Drokin <[email protected]>
Now that we removed all the lock conversion functions, also get rid of the converson queue since nothing could ever get there anyway.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 -- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 10 +--------- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 9 --------- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 12 ------------ 4 files changed, 1 insertion(+), 32 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -2
@@ -883,8 +883,6 @@ struct ldlm_resource {* @{ */ /** List of locks in granted state */ struct list_head lr_granted; -/** List of locks waiting to change their granted mode (converted) */ -struct list_head lr_converting;/** * List of locks that could not be granted due to conflicts and * that are waiting for conflicts to go away */
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +1 -9
@@ -1260,12 +1260,6 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags, rc =0 ; goto out; } - lock =search_queue (&res->lr_converting, &mode, policy, old_lock, - flags, unref); -if (lock !=NULL ) { - rc =1 ; - goto out; - } lock =search_queue (&res->lr_waiting, &mode, policy, old_lock, flags, unref);if (lock !=NULL ) {
@@ -1634,9 +1628,7 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns,* FIXME (bug 268): Detect obvious lies by checking compatibility in * granted/converting queues. */ if (local) { -if (*flags &LDLM_FL_BLOCK_CONV ) -ldlm_resource_add_lock (res, &res->lr_converting, lock); -else if (*flags & (LDLM_FL_BLOCK_WAIT |LDLM_FL_BLOCK_GRANTED )) +if (*flags & (LDLM_FL_BLOCK_WAIT |LDLM_FL_BLOCK_GRANTED ))ldlm_resource_add_lock (res, &res->lr_waiting, lock);else ldlm_grant_lock (lock,NULL );
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +0 -9
@@ -1878,15 +1878,6 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter, } } -list_for_each_safe (tmp, next, &res->lr_converting) { - lock = list_entry(tmp, struct ldlm_lock, l_res_link); - -if (iter (lock, closure) ==LDLM_ITER_STOP ) { - rc =LDLM_ITER_STOP ; - goto out; - } - } -list_for_each_safe (tmp, next, &res->lr_waiting) { lock = list_entry(tmp, struct ldlm_lock, l_res_link);
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +0 -12
@@ -792,7 +792,6 @@ static int ldlm_resource_clean(struct cfs_hash *hs, struct cfs_hash_bd *bd,__u64 flags = *(__u64 *)arg;cleanup_resource (res, &res->lr_granted, flags); -cleanup_resource (res, &res->lr_converting, flags);cleanup_resource (res, &res->lr_waiting, flags);return 0 ;
@@ -1059,7 +1058,6 @@ static struct ldlm_resource *ldlm_resource_new(void)return NULL ;INIT_LIST_HEAD (&res->lr_granted); -INIT_LIST_HEAD (&res->lr_converting);INIT_LIST_HEAD (&res->lr_waiting);/* Initialize interval trees for each lock mode. */
@@ -1224,11 +1222,6 @@ static void __ldlm_resource_putref_final(struct cfs_hash_bd *bd,LBUG (); } -if (!list_empty (&res->lr_converting)) { -ldlm_resource_dump (D_ERROR , res); -LBUG (); - } -if (!list_empty (&res->lr_waiting)) {ldlm_resource_dump (D_ERROR , res);LBUG ();
@@ -1451,11 +1444,6 @@ void ldlm_resource_dump(int level, struct ldlm_resource *res) } } } -if (!list_empty (&res->lr_converting)) { -CDEBUG (level,"Converting locks:\n" ); -list_for_each_entry (lock, &res->lr_converting, l_res_link) -LDLM_DEBUG_LIMIT (level, lock,"###" ); - }if (!list_empty (&res->lr_waiting)) {CDEBUG (level,"Waiting locks:\n" );list_for_each_entry (lock, &res->lr_waiting, l_res_link)
Signature · 1 line
2.1.0
PATCH 12/32 staging/lustre/ldlm: Remove unused ldlm_cli_enqueue_local()
In reply to [email protected]From: Oleg Drokin <[email protected]>
This is only used on the server.
Also while we are at it, remove unused prototypes for ldlm_server_ast and ldlm_handle_enqueue0() that are not defined anywhere
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 15 ----- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 68 ---------------------- 2 files changed, 83 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -15
@@ -1308,25 +1308,10 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct list_head *cancels, int count);struct ptlrpc_request *ldlm_enqueue_pack (struct obd_export *exp,int lvb_len); -int ldlm_handle_enqueue0 (struct ldlm_namespace *ns,struct ptlrpc_request *req, -const struct ldlm_request *dlm_req, -const struct ldlm_callback_suite *cbs);int ldlm_cli_enqueue_fini (struct obd_export *exp,struct ptlrpc_request *req,ldlm_type_t type,__u8 with_policy,ldlm_mode_t mode,__u64 *flags,void *lvb,__u32 lvb_len,struct lustre_handle *lockh,int rc); -int ldlm_cli_enqueue_local (struct ldlm_namespace *ns, -const struct ldlm_res_id *res_id, -ldlm_type_t type,ldlm_policy_data_t *policy, -ldlm_mode_t mode,__u64 *flags, -ldlm_blocking_callback blocking, -ldlm_completion_callback completion, -ldlm_glimpse_callback glimpse, -void *data,__u32 lvb_len,enum lvb_type lvb_type, -const __u64 *client_cookie, -struct lustre_handle *lockh); -int ldlm_server_ast (struct lustre_handle *lockh,struct ldlm_lock_desc *new, -void *data,__u32 data_len);int ldlm_cli_update_pool (struct ptlrpc_request *req);int ldlm_cli_cancel (struct lustre_handle *lockh,ldlm_cancel_flags_t cancel_flags);
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +0 -68
74 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 13/32 staging/lustre/ldlm: Remove unused ldlm_init/fini_flock_export
In reply to [email protected]From: Oleg Drokin <[email protected]>
And all supporting export infrastructure. There's no use for it all on client.
--- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 102 --------------------- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 - 2 files changed, 104 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +0 -102
@@ -755,105 +755,3 @@ void ldlm_flock_policy_local_to_wire(const ldlm_policy_data_t *lpolicy, wpolicy->l_flock.lfw_pid = lpolicy->l_flock.pid; wpolicy->l_flock.lfw_owner = lpolicy->l_flock.owner; } - -/* -* Export handle<->flock hash operations. -*/ -static unsigned -ldlm_export_flock_hash (struct cfs_hash *hs,const void *key,unsigned mask) -{ -return cfs_hash_u64_hash (*(__u64 *)key, mask); -} - -static void * -ldlm_export_flock_key (struct hlist_node *hnode) -{ -struct ldlm_lock *lock; - - lock = hlist_entry(hnode, struct ldlm_lock, l_exp_flock_hash); -return &lock->l_policy_data.l_flock.owner; -} - -static int -ldlm_export_flock_keycmp (const void *key,struct hlist_node *hnode) -{ -return !memcmp (ldlm_export_flock_key (hnode), key,sizeof (__u64)); -} - -static void * -ldlm_export_flock_object (struct hlist_node *hnode) -{ - return hlist_entry(hnode, struct ldlm_lock, l_exp_flock_hash); -} - -static void -ldlm_export_flock_get (struct cfs_hash *hs,struct hlist_node *hnode) -{ -struct ldlm_lock *lock; -struct ldlm_flock *flock; - - lock = hlist_entry(hnode, struct ldlm_lock, l_exp_flock_hash); -LDLM_LOCK_GET (lock); - - flock = &lock->l_policy_data.l_flock; -LASSERT (flock->blocking_export !=NULL ); -class_export_get (flock->blocking_export); - flock->blocking_refs++; -} - -static void -ldlm_export_flock_put (struct cfs_hash *hs,struct hlist_node *hnode) -{ -struct ldlm_lock *lock; -struct ldlm_flock *flock; - - lock = hlist_entry(hnode, struct ldlm_lock, l_exp_flock_hash); -LDLM_LOCK_RELEASE (lock); - - flock = &lock->l_policy_data.l_flock; -LASSERT (flock->blocking_export !=NULL ); -class_export_put (flock->blocking_export); -if (--flock->blocking_refs ==0 ) { - flock->blocking_owner =0 ; - flock->blocking_export =NULL ; - } -} - -static cfs_hash_ops_t ldlm_export_flock_ops = { - .hs_hash = ldlm_export_flock_hash, - .hs_key = ldlm_export_flock_key, - .hs_keycmp = ldlm_export_flock_keycmp, - .hs_object = ldlm_export_flock_object, - .hs_get = ldlm_export_flock_get, - .hs_put = ldlm_export_flock_put, - .hs_put_locked = ldlm_export_flock_put, -}; - -int ldlm_init_flock_export (struct obd_export *exp) -{ -if (strcmp (exp->exp_obd->obd_type->typ_name,LUSTRE_MDT_NAME ) !=0 ) -return 0 ; - - exp->exp_flock_hash = -cfs_hash_create (obd_uuid2str (&exp->exp_client_uuid), -HASH_EXP_LOCK_CUR_BITS , -HASH_EXP_LOCK_MAX_BITS , -HASH_EXP_LOCK_BKT_BITS ,0 , -CFS_HASH_MIN_THETA ,CFS_HASH_MAX_THETA , - &ldlm_export_flock_ops, -CFS_HASH_DEFAULT |CFS_HASH_NBLK_CHANGE ); -if (!exp->exp_flock_hash) -return -ENOMEM ; - -return 0 ; -} -EXPORT_SYMBOL (ldlm_init_flock_export); - -void ldlm_destroy_flock_export (struct obd_export *exp) -{ -if (exp->exp_flock_hash) { -cfs_hash_putref (exp->exp_flock_hash); - exp->exp_flock_hash =NULL ; - } -} -EXPORT_SYMBOL (ldlm_destroy_flock_export);
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +0 -2
@@ -188,8 +188,6 @@ void ldlm_extent_unlink_lock(struct ldlm_lock *lock);int ldlm_process_flock_lock (struct ldlm_lock *req,__u64 *flags,int first_enq,ldlm_error_t *err,struct list_head *work_list); -int ldlm_init_flock_export (struct obd_export *exp); -void ldlm_destroy_flock_export (struct obd_export *exp);/* l_lock.c */ void l_check_ns_lock (struct ldlm_namespace *ns);
Signature · 1 line
2.1.0
PATCH 14/32 staging/lustre/ldlm: Remove unused ldlm_enqueue_pack()
In reply to [email protected]From: Oleg Drokin <[email protected]>
Not used anywhere
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 21 --------------------- 2 files changed, 22 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -1
@@ -1307,7 +1307,6 @@ int ldlm_prep_elc_req(struct obd_export *exp, int version, int opc, int canceloff, struct list_head *cancels, int count); -struct ptlrpc_request *ldlm_enqueue_pack (struct obd_export *exp,int lvb_len); int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req, ldlm_type_t type, __u8 with_policy, ldlm_mode_t mode, __u64 *flags, void *lvb, __u32 lvb_len,
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +0 -21
@@ -742,27 +742,6 @@ int ldlm_prep_enqueue_req(struct obd_export *exp, struct ptlrpc_request *req, }EXPORT_SYMBOL (ldlm_prep_enqueue_req); -struct ptlrpc_request *ldlm_enqueue_pack (struct obd_export *exp,int lvb_len) -{ -struct ptlrpc_request *req; -int rc; - - req =ptlrpc_request_alloc (class_exp2cliimp (exp), &RQF_LDLM_ENQUEUE ); -if (req ==NULL ) -return ERR_PTR (-ENOMEM ); - - rc =ldlm_prep_enqueue_req (exp, req,NULL ,0 ); -if (rc) { -ptlrpc_request_free (req); -return ERR_PTR (rc); - } - -req_capsule_set_size (&req->rq_pill, &RMF_DLM_LVB ,RCL_SERVER , lvb_len); -ptlrpc_request_set_replen (req); -return req; -} -EXPORT_SYMBOL (ldlm_enqueue_pack); -/** * Client-side lock enqueue. *
Signature · 1 line
2.1.0
PATCH 15/32 staging/lustre/ldlm: Remove ldlm_errno2error()
In reply to [email protected]From: Oleg Drokin <[email protected]>
This particular incarnation is only used on the server.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 3 +- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 36 ---------------------- 2 files changed, 1 insertion(+), 38 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +1 -2
@@ -1161,8 +1161,7 @@ static inline int ldlm_res_lvbo_update(struct ldlm_resource *res, }int ldlm_error2errno (ldlm_error_t error); -ldlm_error_t ldlm_errno2error (int err_no);/* don't call it `errno': this -* confuses user-space. */ +#if LUSTRE_TRACKS_LOCK_EXP_REFS void ldlm_dump_export_locks (struct obd_export *exp);#endif
drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +0 -36
@@ -814,42 +814,6 @@ int ldlm_error2errno(ldlm_error_t error) }EXPORT_SYMBOL (ldlm_error2errno); -/** -* Dual to ldlm_error2errno(): maps errno values back to ldlm_error_t. -*/ -ldlm_error_t ldlm_errno2error (int err_no) -{ -int error; - -switch (err_no) { -case 0 : - error =ELDLM_OK ; -break ; -case -ESTALE : - error =ELDLM_LOCK_CHANGED ; -break ; -case -ENAVAIL : - error =ELDLM_LOCK_ABORTED ; -break ; -case -ESRCH : - error =ELDLM_LOCK_REPLACED ; -break ; -case -ENOENT : - error =ELDLM_NO_LOCK_DATA ; -break ; -case -EEXIST : - error =ELDLM_NAMESPACE_EXISTS ; -break ; -case -EBADF : - error =ELDLM_BAD_NAMESPACE ; -break ; -default : - error = err_no; - } -return error; -} -EXPORT_SYMBOL (ldlm_errno2error); -#if LUSTRE_TRACKS_LOCK_EXP_REFS void ldlm_dump_export_locks (struct obd_export *exp) {
Signature · 1 line
2.1.0
PATCH 16/32 staging/lustre/ldlm: Remove ldlm_glimpse_ast()
In reply to [email protected]From: Oleg Drokin <[email protected]>
Only used on the server.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 28 ---------------------- 2 files changed, 29 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -1
@@ -1282,7 +1282,6 @@ int ldlm_expired_completion_wait(void *data);int ldlm_blocking_ast_nocheck (struct ldlm_lock *lock);int ldlm_blocking_ast (struct ldlm_lock *lock,struct ldlm_lock_desc *desc,void *data,int flag); -int ldlm_glimpse_ast (struct ldlm_lock *lock,void *reqp);int ldlm_completion_ast_async (struct ldlm_lock *lock,__u64 flags,void *data);int ldlm_completion_ast (struct ldlm_lock *lock,__u64 flags,void *data);/** @} ldlm_local_ast */
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +0 -28
@@ -358,34 +358,6 @@ int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, }EXPORT_SYMBOL (ldlm_blocking_ast); -/** -* ->l_glimpse_ast() for DLM extent locks acquired on the server-side. See -* comment in filter_intent_policy() on why you may need this. -*/ -int ldlm_glimpse_ast (struct ldlm_lock *lock,void *reqp) -{ -/* -* Returning -ELDLM_NO_LOCK_DATA actually works, but the reason for -* that is rather subtle: with OST-side locking, it may so happen that -* _all_ extent locks are held by the OST. If client wants to obtain -* current file size it calls ll{,u}_glimpse_size(), and (as locks are -* on the server), dummy glimpse callback fires and does -* nothing. Client still receives correct file size due to the -* following fragment in filter_intent_policy(): -* -* rc = l->l_glimpse_ast(l, NULL); // this will update the LVB -* if (rc != 0 && res->lr_namespace->ns_lvbo && -* res->lr_namespace->ns_lvbo->lvbo_update) { -* res->lr_namespace->ns_lvbo->lvbo_update(res, NULL, 0, 1); -* } -* -* that is, after glimpse_ast() fails, filter_lvbo_update() runs, and -* returns correct file size to the client. -*/ -return -ELDLM_NO_LOCK_DATA ; -} -EXPORT_SYMBOL (ldlm_glimpse_ast); -static void failed_lock_cleanup (struct ldlm_namespace *ns,struct ldlm_lock *lock,int mode) {
Signature · 1 line
2.1.0
PATCH 17/32 staging/lustre/ldlm: Remove ldlm_lock_fail_match()
In reply to [email protected]From: Oleg Drokin <[email protected]>
It's not used anywhere.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 8 -------- 2 files changed, 9 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -1
@@ -1216,7 +1216,6 @@ int ldlm_lock_addref_try(struct lustre_handle *lockh, __u32 mode);void ldlm_lock_decref (struct lustre_handle *lockh,__u32 mode);void ldlm_lock_decref_and_cancel (struct lustre_handle *lockh,__u32 mode);void ldlm_lock_fail_match_locked (struct ldlm_lock *lock); -void ldlm_lock_fail_match (struct ldlm_lock *lock);void ldlm_lock_allow_match (struct ldlm_lock *lock);void ldlm_lock_allow_match_locked (struct ldlm_lock *lock); ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +0 -8
@@ -1158,14 +1158,6 @@ void ldlm_lock_fail_match_locked(struct ldlm_lock *lock) }EXPORT_SYMBOL (ldlm_lock_fail_match_locked); -void ldlm_lock_fail_match (struct ldlm_lock *lock) -{ -lock_res_and_lock (lock); -ldlm_lock_fail_match_locked (lock); -unlock_res_and_lock (lock); -} -EXPORT_SYMBOL (ldlm_lock_fail_match); -/** * Mark lock as "matchable" by OST. *
Signature · 1 line
2.1.0
PATCH 18/32 staging/lustre/ldlm: Remove ldlm_namespace_free()
In reply to [email protected]From: Oleg Drokin <[email protected]>
It was directly used only on the server. Client side part was split into smaller chunks to avoid deadlocks.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 -- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 27 ---------------------- 2 files changed, 29 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -2
@@ -1236,8 +1236,6 @@ ldlm_namespace_new(struct obd_device *obd, char *name, ldlm_side_t client, ldlm_appetite_t apt, ldlm_ns_type_t ns_type);int ldlm_namespace_cleanup (struct ldlm_namespace *ns,__u64 flags); -void ldlm_namespace_free (struct ldlm_namespace *ns, -struct obd_import *imp,int force);void ldlm_namespace_register (struct ldlm_namespace *ns,ldlm_side_t client);void ldlm_namespace_unregister (struct ldlm_namespace *ns,ldlm_side_t client);void ldlm_namespace_get (struct ldlm_namespace *ns);
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +0 -27
@@ -948,33 +948,6 @@ void ldlm_namespace_free_post(struct ldlm_namespace *ns)ldlm_put_ref (); } -/** -* Cleanup the resource, and free namespace. -* bug 12864: -* Deadlock issue: -* proc1: destroy import -* class_disconnect_export(grab cl_sem) -> -* -> ldlm_namespace_free -> -* -> ldebugfs_remove(grab _lprocfs_lock). -* proc2: read proc info -* lprocfs_fops_read(grab _lprocfs_lock) -> -* -> osc_rd_active, etc(grab cl_sem). -* -* So that I have to split the ldlm_namespace_free into two parts - the first -* part ldlm_namespace_free_prior is used to cleanup the resource which is -* being used; the 2nd part ldlm_namespace_free_post is used to unregister the -* lprocfs entries, and then free memory. It will be called w/o cli->cl_sem -* held. -*/ -void ldlm_namespace_free (struct ldlm_namespace *ns, -struct obd_import *imp, -int force) -{ -ldlm_namespace_free_prior (ns, imp, force); -ldlm_namespace_free_post (ns); -} -EXPORT_SYMBOL (ldlm_namespace_free); -void ldlm_namespace_get (struct ldlm_namespace *ns) {atomic_inc (&ns->ns_bref);
Signature · 1 line
2.1.0
PATCH 19/32 staging/lustre/ldlm: Remove unused ldlm_pool_get_clv()
In reply to [email protected]From: Oleg Drokin <[email protected]>
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 16 ---------------- 2 files changed, 17 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -1
@@ -1401,7 +1401,6 @@ int ldlm_pool_setup(struct ldlm_pool *pl, int limit);int ldlm_pool_recalc (struct ldlm_pool *pl);__u32 ldlm_pool_get_lvf (struct ldlm_pool *pl);__u64 ldlm_pool_get_slv (struct ldlm_pool *pl); -__u64 ldlm_pool_get_clv (struct ldlm_pool *pl);__u32 ldlm_pool_get_limit (struct ldlm_pool *pl);void ldlm_pool_set_slv (struct ldlm_pool *pl,__u64 slv);void ldlm_pool_set_clv (struct ldlm_pool *pl,__u64 clv);
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +0 -16
@@ -1023,22 +1023,6 @@ void ldlm_pool_set_slv(struct ldlm_pool *pl, __u64 slv)EXPORT_SYMBOL (ldlm_pool_set_slv);/** -* Returns current \a pl CLV. -* -* \pre ->pl_lock is not locked. -*/ -__u64 ldlm_pool_get_clv (struct ldlm_pool *pl) -{ -__u64 slv; - -spin_lock (&pl->pl_lock); - slv = pl->pl_client_lock_volume; -spin_unlock (&pl->pl_lock); -return slv; -} -EXPORT_SYMBOL (ldlm_pool_get_clv); - -/** * Sets passed \a clv to \a pl. * * \pre ->pl_lock is not locked.
Signature · 1 line
2.1.0
PATCH 20/32 staging/lustre/ldlm: Remove unused ldlm_pool_set_slv()
In reply to [email protected]From: Oleg Drokin <[email protected]>
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 13 ------------- 2 files changed, 14 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -1
@@ -1402,7 +1402,6 @@ int ldlm_pool_recalc(struct ldlm_pool *pl);__u32 ldlm_pool_get_lvf (struct ldlm_pool *pl);__u64 ldlm_pool_get_slv (struct ldlm_pool *pl);__u32 ldlm_pool_get_limit (struct ldlm_pool *pl); -void ldlm_pool_set_slv (struct ldlm_pool *pl,__u64 slv);void ldlm_pool_set_clv (struct ldlm_pool *pl,__u64 clv);void ldlm_pool_set_limit (struct ldlm_pool *pl,__u32 limit);void ldlm_pool_add (struct ldlm_pool *pl,struct ldlm_lock *lock);
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +0 -13
@@ -1010,19 +1010,6 @@ __u64 ldlm_pool_get_slv(struct ldlm_pool *pl)EXPORT_SYMBOL (ldlm_pool_get_slv);/** -* Sets passed \a slv to \a pl. -* -* \pre ->pl_lock is not locked. -*/ -void ldlm_pool_set_slv (struct ldlm_pool *pl,__u64 slv) -{ -spin_lock (&pl->pl_lock); - pl->pl_server_lock_volume = slv; -spin_unlock (&pl->pl_lock); -} -EXPORT_SYMBOL (ldlm_pool_set_slv); - -/** * Sets passed \a clv to \a pl. * * \pre ->pl_lock is not locked.
Signature · 1 line
2.1.0
PATCH 21/32 staging/lustre/ldlm: Remove ldlm_refresh/del_waiting_lock()
In reply to [email protected]From: Oleg Drokin <[email protected]>
Nothing adds locks into waiting list on the client, so no point in retaining those.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 -- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 8 -------- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 13 ------------- 3 files changed, 23 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -2
@@ -1108,8 +1108,6 @@ struct ldlm_callback_suite { };/* ldlm_lockd.c */ -int ldlm_del_waiting_lock (struct ldlm_lock *lock); -int ldlm_refresh_waiting_lock (struct ldlm_lock *lock,int timeout);int ldlm_get_ref (void );void ldlm_put_ref (void );struct ldlm_lock *ldlm_request_lock (struct ptlrpc_request *req);
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +0 -8
@@ -1947,17 +1947,9 @@ void ldlm_lock_cancel(struct ldlm_lock *lock)LBUG (); } -if (lock->l_flags &LDLM_FL_WAITED ) -ldlm_del_waiting_lock (lock); -/* Releases cancel callback. */ ldlm_cancel_callback (lock); -/* Yes, second time, just in case it was added again while we were -* running with no res lock in ldlm_cancel_callback */ -if (lock->l_flags &LDLM_FL_WAITED ) -ldlm_del_waiting_lock (lock); -ldlm_resource_unlink_lock (lock);ldlm_lock_destroy_nolock (lock);
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +0 -13
@@ -111,19 +111,6 @@ struct ldlm_bl_work_item {int blwi_mem_pressure; }; - -int ldlm_del_waiting_lock (struct ldlm_lock *lock) -{ -return 0 ; -} - -int ldlm_refresh_waiting_lock (struct ldlm_lock *lock,int timeout) -{ -return 0 ; -} - - -/** * Callback handler for receiving incoming blocking ASTs. *
Signature · 1 line
2.1.0
PATCH 22/32 staging/lustre/ldlm: Remove intent policies handler.
In reply to [email protected]From: Oleg Drokin <[email protected]>
This includes ldlm_register_intent(), ns_policy field in the namespace and all of it's users, as this could only happen on the server.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 8 -- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 85 ++++------------------ 2 files changed, 13 insertions(+), 80 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -8
@@ -271,10 +271,6 @@ struct ldlm_pool {struct completion pl_kobj_unregister; }; -typedef int (*ldlm_res_policy )(struct ldlm_namespace *,struct ldlm_lock **, -void *req_cookie,ldlm_mode_t mode,__u64 flags, -void *data); -typedef int (*ldlm_cancel_for_recovery )(struct ldlm_lock *lock);/**
@@ -427,9 +423,6 @@ struct ldlm_namespace {*/ unsigned long 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
@@ -1113,7 +1106,6 @@ void ldlm_put_ref(void);struct ldlm_lock *ldlm_request_lock (struct ptlrpc_request *req);/* ldlm_lock.c */ -void ldlm_register_intent (struct ldlm_namespace *ns,ldlm_res_policy arg);void ldlm_lock2handle (const struct ldlm_lock *lock,struct lustre_handle *lockh);struct ldlm_lock *__ldlm_handle2lock (const struct lustre_handle *,__u64 flags);
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +13 -72
130 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 23/32 staging/lustre/ldlm: Remove unused ldlm_reprocess_all*()
In reply to [email protected]From: Oleg Drokin <[email protected]>
They are only used on the server.
Also remove helper functions and cleanup callsites.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 - drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 1 - drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 48 ---------------------- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 4 -- 4 files changed, 55 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -2
@@ -1215,8 +1215,6 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,ldlm_mode_t ldlm_revalidate_lock_handle (struct lustre_handle *lockh,__u64 *bits);void ldlm_lock_cancel (struct ldlm_lock *lock); -void ldlm_reprocess_all (struct ldlm_resource *res); -void ldlm_reprocess_all_ns (struct ldlm_namespace *ns);void ldlm_lock_dump_handle (int level,struct lustre_handle *);void ldlm_unlink_lock_skiplist (struct ldlm_lock *req);
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +0 -1
@@ -523,7 +523,6 @@ reprocess:/* At this point we're granting the lock request. */ req->l_granted_mode = req->l_req_mode; -/* Add req to the granted queue before calling ldlm_reprocess_all(). */ if (!added) {list_del_init (&req->l_res_link);/* insert new lock before ownlocks in list. */
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +0 -48
54 lines not on this page · raw message
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +0 -4
@@ -188,7 +188,6 @@ int ldlm_completion_ast_async(struct ldlm_lock *lock, __u64 flags, void *data) }LDLM_DEBUG (lock,"client-side enqueue returned a blocked lock, going forward" ); -ldlm_reprocess_all (lock->l_resource);return 0 ; }EXPORT_SYMBOL (ldlm_completion_ast_async);
@@ -892,9 +891,6 @@ static __u64 ldlm_cli_cancel_local(struct ldlm_lock *lock)LDLM_ERROR (lock,"Trying to cancel local lock" );LBUG (); } -LDLM_DEBUG (lock,"server-side local cancel" ); -ldlm_lock_cancel (lock); -ldlm_reprocess_all (lock->l_resource); }return rc;
Signature · 1 line
2.1.0
PATCH 24/32 staging/lustre/ldlm: Remove unused ldlm_resource_insert_lock_after()
In reply to [email protected]From: Oleg Drokin <[email protected]>
It was only used on the server.
--- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 -- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 26 ---------------------- 2 files changed, 28 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +0 -2
@@ -116,8 +116,6 @@ int ldlm_get_enq_timeout(struct ldlm_lock *lock);/* ldlm_resource.c */ int ldlm_resource_putref_locked (struct ldlm_resource *res); -void ldlm_resource_insert_lock_after (struct ldlm_lock *original, -struct ldlm_lock *new);void ldlm_namespace_free_prior (struct ldlm_namespace *ns,struct obd_import *imp,int force);void ldlm_namespace_free_post (struct ldlm_namespace *ns);
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +0 -26
@@ -1281,32 +1281,6 @@ void ldlm_resource_add_lock(struct ldlm_resource *res, struct list_head *head,list_add_tail (&lock->l_res_link, head); } -/** -* Insert a lock into resource after specified lock. -* -* Obtain resource description from the lock we are inserting after. -*/ -void ldlm_resource_insert_lock_after (struct ldlm_lock *original, -struct ldlm_lock *new) -{ -struct ldlm_resource *res = original->l_resource; - -check_res_locked (res); - -ldlm_resource_dump (D_INFO , res); -LDLM_DEBUG (new,"About to insert this lock after %p:\n" , original); - -if (new->l_flags &LDLM_FL_DESTROYED ) { -CDEBUG (D_OTHER ,"Lock destroyed, not adding to resource\n" ); - goto out; - } - -LASSERT (list_empty (&new->l_res_link)); - -list_add (&new->l_res_link, &original->l_res_link); - out:; -} -void ldlm_resource_unlink_lock (struct ldlm_lock *lock) {int type = lock->l_resource->lr_type;
Signature · 1 line
2.1.0
PATCH 25/32 staging/lustre/ldlm: Remove unused ldlm_blocking_ast/_nocheck()
In reply to [email protected]From: Oleg Drokin <[email protected]>
All users are gone, and they were used on the server anyway.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 3 - drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 70 ---------------------- 2 files changed, 73 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -3
@@ -1264,9 +1264,6 @@ int ldlm_expired_completion_wait(void *data);* also used by client-side lock handlers to perform minimum level base * processing. * @{ */ -int ldlm_blocking_ast_nocheck (struct ldlm_lock *lock); -int ldlm_blocking_ast (struct ldlm_lock *lock,struct ldlm_lock_desc *desc, -void *data,int flag);int ldlm_completion_ast_async (struct ldlm_lock *lock,__u64 flags,void *data);int ldlm_completion_ast (struct ldlm_lock *lock,__u64 flags,void *data);/** @} ldlm_local_ast */
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +0 -70
76 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 26/32 staging/lustre: Remove ns_is_client()
In reply to [email protected]From: Oleg Drokin <[email protected]>
Since staging tree code is just the client, ns_is_client is always true, so change all callers as such and drop all the dead code for when it's false.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 13 ---------- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 28 +++------------------ drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 5 +--- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 9 +++---- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 29 ++++++++-------------- 5 files changed, 17 insertions(+), 67 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -13
@@ -465,19 +465,6 @@ struct ldlm_namespace { };/** -* Returns 1 if namespace \a ns is a client namespace. -*/ -static inline int ns_is_client (struct ldlm_namespace *ns) -{ -LASSERT (ns !=NULL ); -LASSERT (!(ns->ns_client & ~(LDLM_NAMESPACE_CLIENT | -LDLM_NAMESPACE_SERVER ))); -LASSERT (ns->ns_client ==LDLM_NAMESPACE_CLIENT || - ns->ns_client ==LDLM_NAMESPACE_SERVER ); -return ns->ns_client ==LDLM_NAMESPACE_CLIENT ; -} - -/** * Returns 1 if namespace \a ns is a server namespace. */ static inline int ns_is_server (struct ldlm_namespace *ns)
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +3 -25
@@ -63,9 +63,6 @@#include <linux/list.h> #include "ldlm_internal.h" -int ldlm_flock_blocking_ast (struct ldlm_lock *lock,struct ldlm_lock_desc *desc, -void *data,int flag); -/** * list_for_remaining_safe - iterate over the remaining entries in a list * and safeguard against removal of a list entry.
@@ -254,7 +251,6 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,struct ldlm_lock *new = req;struct ldlm_lock *new2 =NULL ;ldlm_mode_t mode = req->l_req_mode; -int local =ns_is_client (ns);int added = (mode ==LCK_NL );int overlaps =0 ;int splitted =0 ;
@@ -269,14 +265,9 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, *err =ELDLM_OK ; -if (local) { -/* No blocking ASTs are sent to the clients for -* Posix file & record locks */ - req->l_blocking_ast =NULL ; - }else { -/* Called on the server for lock cancels. */ - req->l_blocking_ast = ldlm_flock_blocking_ast; - } +/* No blocking ASTs are sent to the clients for +* Posix file & record locks */ + req->l_blocking_ast =NULL ; reprocess:if ((*flags ==LDLM_FL_WAIT_NOREPROC ) || (mode ==LCK_NL )) {
@@ -708,19 +699,6 @@ granted: }EXPORT_SYMBOL (ldlm_flock_completion_ast); -int ldlm_flock_blocking_ast (struct ldlm_lock *lock,struct ldlm_lock_desc *desc, -void *data,int flag) -{ -LASSERT (lock); -LASSERT (flag ==LDLM_CB_CANCELING ); - -/* take lock off the deadlock detection hash list. */ -lock_res_and_lock (lock); -ldlm_flock_blocking_unlink (lock); -unlock_res_and_lock (lock); -return 0 ; -} -void ldlm_flock_policy_wire18_to_local (const ldlm_wire_policy_data_t *wpolicy,ldlm_policy_data_t *lpolicy) {
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +1 -4
@@ -480,8 +480,6 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,struct ldlm_resource *newres;int type; -LASSERT (ns_is_client (ns)); -lock_res_and_lock (lock);if (memcmp (new_resid, &lock->l_resource->lr_name,sizeof (lock->l_resource->lr_name)) ==0 ) {
@@ -816,8 +814,7 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode)if ((lock->l_flags &LDLM_FL_ATOMIC_CB ) ||ldlm_bl_to_thread_lock (ns,NULL , lock) !=0 )ldlm_handle_bl_callback (ns,NULL , lock); - }else if (ns_is_client (ns) && - !lock->l_readers && !lock->l_writers && + }else if (!lock->l_readers && !lock->l_writers && !(lock->l_flags &LDLM_FL_NO_LRU ) && !(lock->l_flags &LDLM_FL_BL_AST )) {
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +3 -6
@@ -266,8 +266,7 @@ noreproc:spin_unlock (&imp->imp_lock); } -if (ns_is_client (ldlm_lock_to_ns (lock)) && -OBD_FAIL_CHECK_RESET (OBD_FAIL_LDLM_INTR_CP_AST , +if (OBD_FAIL_CHECK_RESET (OBD_FAIL_LDLM_INTR_CP_AST ,OBD_FAIL_LDLM_CP_BL_RACE |OBD_FAIL_ONCE )) { lock->l_flags |=LDLM_FL_FAIL_LOC ; rc = -EINTR ;
@@ -817,10 +816,8 @@ static __u64 ldlm_cli_cancel_local(struct ldlm_lock *lock) }ldlm_lock_cancel (lock); }else { -if (ns_is_client (ldlm_lock_to_ns (lock))) { -LDLM_ERROR (lock,"Trying to cancel local lock" ); -LBUG (); - } +LDLM_ERROR (lock,"Trying to cancel local lock" ); +LBUG (); }return rc;
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +10 -19
@@ -718,11 +718,12 @@ static void cleanup_resource(struct ldlm_resource *res, struct list_head *q, __u64 flags) {struct list_head *tmp; -int rc =0 , client =ns_is_client (ldlm_res_to_ns (res)); +int rc =0 ;bool local_only = !!(flags &LDLM_FL_LOCAL_ONLY ); do { struct ldlm_lock *lock = NULL; + struct lustre_handle lockh; /* First, we look for non-cleaned-yet lock * all cleaned locks are marked by CLEANED flag. */
@@ -767,20 +768,11 @@ static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,continue ; } -if (client) { -struct lustre_handle lockh; - -unlock_res (res); -ldlm_lock2handle (lock, &lockh); - rc =ldlm_cli_cancel (&lockh,LCF_ASYNC ); -if (rc) -CERROR ("ldlm_cli_cancel: %d\n" , rc); - }else { -ldlm_resource_unlink_lock (lock); -unlock_res (res); -LDLM_DEBUG (lock,"Freeing a lock still held by a client node" ); -ldlm_lock_destroy (lock); - } +unlock_res (res); +ldlm_lock2handle (lock, &lockh); + rc =ldlm_cli_cancel (&lockh,LCF_ASYNC ); +if (rc) +CERROR ("ldlm_cli_cancel: %d\n" , rc);LDLM_LOCK_RELEASE (lock); }while (1 ); }
@@ -1165,7 +1157,7 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent,* namespace. If so, and this is a client namespace, we need to move * the namespace into the active namespaces list to be patrolled by * the ldlm_poold. */ -if (ns_is_client (ns) && ns_refcount ==1 ) { +if (ns_refcount ==1 ) {mutex_lock (ldlm_namespace_lock (LDLM_NAMESPACE_CLIENT ));ldlm_namespace_move_to_active_locked (ns,LDLM_NAMESPACE_CLIENT );mutex_unlock (ldlm_namespace_lock (LDLM_NAMESPACE_CLIENT ));
@@ -1346,9 +1338,8 @@ void ldlm_namespace_dump(int level, struct ldlm_namespace *ns)if (!((libcfs_debug |D_ERROR ) & level))return ; -CDEBUG (level,"--- Namespace: %s (rc: %d, side: %s)\n" , -ldlm_ns_name (ns),atomic_read (&ns->ns_bref), -ns_is_client (ns) ?"client" :"server" ); +CDEBUG (level,"--- Namespace: %s (rc: %d, side: client)\n" , +ldlm_ns_name (ns),atomic_read (&ns->ns_bref));if (time_before (cfs_time_current (), ns->ns_next_dump))return ;
Signature · 1 line
2.1.0
PATCH 27/32 staging/lustre: Remove ns_is_server()
In reply to [email protected]From: Oleg Drokin <[email protected]>
Since the code we have is Lustre-client only, this function always returns 0, so drop it and amend all the callsites to drop dead code.
One of the places also sets LDLM_FL_NS_SRV to indicate a lock is in a server namespace. This too cannot happen in this code, so drop all such checks as well.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 13 ------------- drivers/staging/lustre/lustre/ldlm/l_lock.c | 7 ++----- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 14 -------------- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 16 ++-------------- 4 files changed, 4 insertions(+), 46 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -13
@@ -465,19 +465,6 @@ struct ldlm_namespace { };/** -* Returns 1 if namespace \a ns is a server namespace. -*/ -static inline int ns_is_server (struct ldlm_namespace *ns) -{ -LASSERT (ns !=NULL ); -LASSERT (!(ns->ns_client & ~(LDLM_NAMESPACE_CLIENT | -LDLM_NAMESPACE_SERVER ))); -LASSERT (ns->ns_client ==LDLM_NAMESPACE_CLIENT || - ns->ns_client ==LDLM_NAMESPACE_SERVER ); -return ns->ns_client ==LDLM_NAMESPACE_SERVER ; -} - -/** * Returns 1 if namespace \a ns supports early lock cancel (ELC). */ static inline int ns_connect_cancelset (struct ldlm_namespace *ns)
drivers/staging/lustre/lustre/ldlm/l_lock.c +2 -5
@@ -50,9 +50,7 @@*/ struct ldlm_resource *lock_res_and_lock (struct ldlm_lock *lock) { -/* on server-side resource of lock doesn't change */ -if ((lock->l_flags &LDLM_FL_NS_SRV ) ==0 ) -spin_lock (&lock->l_lock); +spin_lock (&lock->l_lock);lock_res (lock->l_resource);
@@ -70,7 +68,6 @@ void unlock_res_and_lock(struct ldlm_lock *lock) lock->l_flags &= ~LDLM_FL_RES_LOCKED ;unlock_res (lock->l_resource); -if ((lock->l_flags &LDLM_FL_NS_SRV ) ==0 ) -spin_unlock (&lock->l_lock); +spin_unlock (&lock->l_lock); }EXPORT_SYMBOL (unlock_res_and_lock);
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +0 -14
@@ -237,11 +237,6 @@ int ldlm_lock_remove_from_lru(struct ldlm_lock *lock)struct ldlm_namespace *ns =ldlm_lock_to_ns (lock);int rc; -if (lock->l_flags &LDLM_FL_NS_SRV ) { -LASSERT (list_empty (&lock->l_lru)); -return 0 ; - } -spin_lock (&ns->ns_lock); rc =ldlm_lock_remove_from_lru_nolock (lock);spin_unlock (&ns->ns_lock);
@@ -286,11 +281,6 @@ void ldlm_lock_touch_in_lru(struct ldlm_lock *lock) {struct ldlm_namespace *ns =ldlm_lock_to_ns (lock); -if (lock->l_flags &LDLM_FL_NS_SRV ) { -LASSERT (list_empty (&lock->l_lru)); -return ; - } -spin_lock (&ns->ns_lock);if (!list_empty (&lock->l_lru)) {ldlm_lock_remove_from_lru_nolock (lock);
@@ -799,8 +789,6 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode) (lock->l_flags & LDLM_FL_CBPENDING)) {/* If we received a blocked AST and this was the last reference, * run the callback. */ -if ((lock->l_flags &LDLM_FL_NS_SRV ) && lock->l_export) -CERROR ("FL_CBPENDING set on non-local lock--just a warning\n" );LDLM_DEBUG (lock,"final decref done on cbpending lock" );
@@ -1486,8 +1474,6 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns, lock->l_req_mode = mode; lock->l_ast_data = data; lock->l_pid =current_pid (); -if (ns_is_server (ns)) - lock->l_flags |=LDLM_FL_NS_SRV ;if (cbs) { lock->l_blocking_ast = cbs->lcs_blocking; lock->l_completion_ast = cbs->lcs_completion;
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +2 -14
@@ -656,8 +656,8 @@ EXPORT_SYMBOL(ldlm_pool_setup);static int lprocfs_pool_state_seq_show (struct seq_file *m,void *unused) { -int granted, grant_rate, cancel_rate, grant_step; -int grant_speed, grant_plan, lvf; +int granted, grant_rate, cancel_rate; +int grant_speed, lvf;struct ldlm_pool *pl = m->private;__u64 slv, clv;__u32 limit;
@@ -666,13 +666,11 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused) slv = pl->pl_server_lock_volume; clv = pl->pl_client_lock_volume; limit =ldlm_pool_get_limit (pl); - grant_plan = pl->pl_grant_plan; granted =atomic_read (&pl->pl_granted); grant_rate =atomic_read (&pl->pl_grant_rate); cancel_rate =atomic_read (&pl->pl_cancel_rate); grant_speed = grant_rate - cancel_rate; lvf =atomic_read (&pl->pl_lock_volume_factor); - grant_step =ldlm_pool_t2gsp (pl->pl_recalc_period);spin_unlock (&pl->pl_lock); seq_printf(m, "LDLM pool state (%s):\n"
@@ -681,11 +679,6 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)" LVF: %d\n" , pl->pl_name, slv, clv, lvf); -if (ns_is_server (ldlm_pl2ns (pl))) { -seq_printf (m," GSP: %d%%\n" -" GP: %d\n" , - grant_step, grant_plan); - } seq_printf(m, " GR: %d\n CR: %d\n GS: %d\n" " G: %d\n L: %d\n", grant_rate, cancel_rate, grant_speed,
@@ -966,8 +959,6 @@ void ldlm_pool_add(struct ldlm_pool *pl, struct ldlm_lock *lock)* enqueue/cancel rpc. Also we do not want to run out of stack * with too long call paths. */ -if (ns_is_server (ldlm_pl2ns (pl))) -ldlm_pool_recalc (pl); }EXPORT_SYMBOL (ldlm_pool_add);
@@ -987,9 +978,6 @@ void ldlm_pool_del(struct ldlm_pool *pl, struct ldlm_lock *lock)atomic_inc (&pl->pl_cancel_rate);lprocfs_counter_incr (pl->pl_stats,LDLM_POOL_CANCEL_STAT ); - -if (ns_is_server (ldlm_pl2ns (pl))) -ldlm_pool_recalc (pl); }EXPORT_SYMBOL (ldlm_pool_del);
Signature · 1 line
2.1.0
PATCH 28/32 staging/lustre/ldlm: Remove server side code from pool support.
In reply to [email protected]From: Oleg Drokin <[email protected]>
Server-side scanning is not really used in the client code, so it's ok to drop it.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 3 - drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 348 +-------------------- 2 files changed, 13 insertions(+), 338 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -3
@@ -213,7 +213,6 @@ struct ldlm_pool_ops {/** Cancel at least \a nr locks from pool \a pl */ int (*po_shrink)(struct ldlm_pool *pl,int nr,gfp_t gfp_mask); -int (*po_setup)(struct ldlm_pool *pl,int limit); };/** One second for pools thread check interval. Each pool has own period. */
@@ -1347,7 +1346,6 @@ void unlock_res_and_lock(struct ldlm_lock *lock);* There are not used outside of ldlm. * @{ */ -int ldlm_pools_recalc (ldlm_side_t client);int ldlm_pools_init (void );void ldlm_pools_fini (void );
@@ -1356,7 +1354,6 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,int ldlm_pool_shrink (struct ldlm_pool *pl,int nr,gfp_t gfp_mask);void ldlm_pool_fini (struct ldlm_pool *pl); -int ldlm_pool_setup (struct ldlm_pool *pl,int limit);int ldlm_pool_recalc (struct ldlm_pool *pl);__u32 ldlm_pool_get_lvf (struct ldlm_pool *pl);__u64 ldlm_pool_get_slv (struct ldlm_pool *pl);
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +13 -335
434 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 29/32 staging/lustre/ldlm: Remove unused exported symbols.
In reply to [email protected]From: Oleg Drokin <[email protected]>
This rather large patch prunes all unused EXPORT_SYMBOLS and marks functions only used locally as static lustre ldlm module.
The only two remaining nonstatic functions that should be static now are:ldlm_cancel_lru_localldlm_resource_putref_locked
But some bigger code shuffling around is needed to achieve that, so it's left for a future patch.
--- drivers/staging/lustre/lustre/include/lustre_dlm.h | 26 ------- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 22 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 6 +- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 21 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 30 ++++---- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 4 +- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 43 +++++------- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 28 ++++---- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 82 +++++++++++----------- 9 files changed, 111 insertions(+), 151 deletions(-)
drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -26
@@ -60,9 +60,6 @@struct obd_ops ;struct obd_device ; -extern struct kset *ldlm_ns_kset; -extern struct kset *ldlm_svc_kset; -#define OBD_LDLM_DEVICENAME "ldlm"#define LDLM_DEFAULT_LRU_SIZE (100 * num_online_cpus())
@@ -561,9 +558,6 @@ typedef union {struct ldlm_inodebits l_inodebits; } ldlm_policy_data_t; -void ldlm_convert_policy_to_wire (ldlm_type_t type, -const ldlm_policy_data_t *lpolicy, -ldlm_wire_policy_data_t *wpolicy);void ldlm_convert_policy_to_local (struct obd_export *exp,ldlm_type_t type,const ldlm_wire_policy_data_t *wpolicy,ldlm_policy_data_t *lpolicy);
@@ -980,7 +974,6 @@ struct ldlm_enqueue_info {extern struct obd_ops ldlm_obd_ops;extern char *ldlm_lockname[]; -extern char *ldlm_typename[];char *ldlm_it2str (int it);/**
@@ -1051,10 +1044,6 @@ typedef int (*ldlm_res_iterator_t)(struct ldlm_resource *, void *);* LDLM provides for a way to iterate through every lock on a resource or * namespace or every resource in a namespace. * @{ */ -int ldlm_resource_foreach (struct ldlm_resource *res,ldlm_iterator_t iter, -void *closure); -void ldlm_namespace_foreach (struct ldlm_namespace *ns,ldlm_iterator_t iter, -void *closure);int ldlm_resource_iterate (struct ldlm_namespace *,const struct ldlm_res_id *,ldlm_iterator_t iter,void *data);/** @} ldlm_iterator */
@@ -1172,7 +1161,6 @@ do { \struct ldlm_lock *ldlm_lock_get (struct ldlm_lock *lock);void ldlm_lock_put (struct ldlm_lock *lock); -void ldlm_lock_destroy (struct ldlm_lock *lock);void ldlm_lock2desc (struct ldlm_lock *lock,struct ldlm_lock_desc *desc);void ldlm_lock_addref (struct lustre_handle *lockh,__u32 mode);int ldlm_lock_addref_try (struct lustre_handle *lockh,__u32 mode);
@@ -1197,8 +1185,6 @@ ldlm_namespace_new(struct obd_device *obd, char *name, ldlm_side_t client, ldlm_appetite_t apt, ldlm_ns_type_t ns_type);int ldlm_namespace_cleanup (struct ldlm_namespace *ns,__u64 flags); -void ldlm_namespace_register (struct ldlm_namespace *ns,ldlm_side_t client); -void ldlm_namespace_unregister (struct ldlm_namespace *ns,ldlm_side_t client);void ldlm_namespace_get (struct ldlm_namespace *ns);void ldlm_namespace_put (struct ldlm_namespace *ns);int ldlm_debugfs_setup (void );
@@ -1209,7 +1195,6 @@ struct ldlm_resource *ldlm_resource_get(struct ldlm_namespace *ns,struct ldlm_resource *parent, const struct ldlm_res_id *, ldlm_type_t type, int create); -struct ldlm_resource *ldlm_resource_getref (struct ldlm_resource *res);int ldlm_resource_putref (struct ldlm_resource *res); void ldlm_resource_add_lock(struct ldlm_resource *res, struct list_head *head,
@@ -1231,7 +1216,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
@@ -1275,8 +1259,6 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,ldlm_mode_t mode, ldlm_cancel_flags_t flags, void *opaque); -int ldlm_cli_cancel_req (struct obd_export *exp,struct list_head *head, -int count,ldlm_cancel_flags_t flags); int ldlm_cancel_resource_local(struct ldlm_resource *res, struct list_head *cancels, ldlm_policy_data_t *policy,
@@ -1351,15 +1333,7 @@ void ldlm_pools_fini(void);int ldlm_pool_init (struct ldlm_pool *pl,struct ldlm_namespace *ns,int idx,ldlm_side_t client); -int ldlm_pool_shrink (struct ldlm_pool *pl,int nr, -gfp_t gfp_mask);void ldlm_pool_fini (struct ldlm_pool *pl); -int ldlm_pool_recalc (struct ldlm_pool *pl); -__u32 ldlm_pool_get_lvf (struct ldlm_pool *pl); -__u64 ldlm_pool_get_slv (struct ldlm_pool *pl); -__u32 ldlm_pool_get_limit (struct ldlm_pool *pl); -void ldlm_pool_set_clv (struct ldlm_pool *pl,__u64 clv); -void ldlm_pool_set_limit (struct ldlm_pool *pl,__u32 limit);void ldlm_pool_add (struct ldlm_pool *pl,struct ldlm_lock *lock);void ldlm_pool_del (struct ldlm_pool *pl,struct ldlm_lock *lock);/** @} */
drivers/staging/lustre/lustre/ldlm/ldlm_extent.c +11 -11
@@ -97,6 +97,17 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)EXPORT_SYMBOL (ldlm_extent_shift_kms);struct kmem_cache *ldlm_interval_slab; + +/* interval tree, for LDLM_EXTENT. */ +static void ldlm_interval_attach (struct ldlm_interval *n,struct ldlm_lock *l) +{ +LASSERT (!l->l_tree_node); +LASSERT (l->l_resource->lr_type ==LDLM_EXTENT ); + +list_add_tail (&l->l_sl_policy, &n->li_group); + l->l_tree_node = n; +} +struct ldlm_interval *ldlm_interval_alloc (struct ldlm_lock *lock) {struct ldlm_interval *node;
@@ -120,17 +131,6 @@ void ldlm_interval_free(struct ldlm_interval *node) } } -/* interval tree, for LDLM_EXTENT. */ -void ldlm_interval_attach (struct ldlm_interval *n, -struct ldlm_lock *l) -{ -LASSERT (l->l_tree_node ==NULL ); -LASSERT (l->l_resource->lr_type ==LDLM_EXTENT ); - -list_add_tail (&l->l_sl_policy, &n->li_group); - l->l_tree_node = n; -} -struct ldlm_interval *ldlm_interval_detach (struct ldlm_lock *l) {struct ldlm_interval *n = l->l_tree_node;
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +3 -3
@@ -239,9 +239,9 @@ static void ldlm_flock_cancel_on_deadlock(struct ldlm_lock *lock,* - blocking ASTs have not been sent yet, so list of conflicting locks * would be collected and ASTs sent. */ -int -ldlm_process_flock_lock (struct ldlm_lock *req,__u64 *flags,int first_enq, -ldlm_error_t *err,struct list_head *work_list) +static int ldlm_process_flock_lock (struct ldlm_lock *req,__u64 *flags, +int first_enq,ldlm_error_t *err, +struct list_head *work_list) {struct ldlm_resource *res = req->l_resource;struct ldlm_namespace *ns =ldlm_res_to_ns (res);
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +8 -13
@@ -109,10 +109,9 @@ enum {int ldlm_cancel_lru (struct ldlm_namespace *ns,int nr,ldlm_cancel_flags_t sync,int flags);int ldlm_cancel_lru_local (struct ldlm_namespace *ns, -struct list_head *cancels,int count,int max, -ldlm_cancel_flags_t cancel_flags,int flags); +struct list_head *cancels,int count,int max, +ldlm_cancel_flags_t cancel_flags,int flags);extern int ldlm_enqueue_min; -int ldlm_get_enq_timeout (struct ldlm_lock *lock);/* ldlm_resource.c */ int ldlm_resource_putref_locked (struct ldlm_resource *res);
@@ -154,12 +153,8 @@ void ldlm_add_ast_work_item(struct ldlm_lock *lock, struct ldlm_lock *new, struct list_head *work_list);int ldlm_run_ast_work (struct ldlm_namespace *ns,struct list_head *rpc_list,enum ldlm_desc_ast_t ast_type); -int ldlm_work_gl_ast_lock (struct ptlrpc_request_set *rqset,void *opaq);int ldlm_lock_remove_from_lru (struct ldlm_lock *lock);int ldlm_lock_remove_from_lru_nolock (struct ldlm_lock *lock); -void ldlm_lock_add_to_lru_nolock (struct ldlm_lock *lock); -void ldlm_lock_add_to_lru (struct ldlm_lock *lock); -void ldlm_lock_touch_in_lru (struct ldlm_lock *lock);void ldlm_lock_destroy_nolock (struct ldlm_lock *lock);/* ldlm_lockd.c */
@@ -174,6 +169,7 @@ void ldlm_handle_bl_callback(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld, struct ldlm_lock *lock);extern struct kmem_cache *ldlm_resource_slab; +extern struct kset *ldlm_ns_kset;/* ldlm_lockd.c & ldlm_lock.c */ extern struct kmem_cache *ldlm_lock_slab;
@@ -182,11 +178,6 @@ extern struct kmem_cache *ldlm_lock_slab;void ldlm_extent_add_lock (struct ldlm_resource *res,struct ldlm_lock *lock);void ldlm_extent_unlink_lock (struct ldlm_lock *lock); -/* ldlm_flock.c */ -int ldlm_process_flock_lock (struct ldlm_lock *req,__u64 *flags, -int first_enq,ldlm_error_t *err, -struct list_head *work_list); -/* l_lock.c */ void l_check_ns_lock (struct ldlm_namespace *ns);void l_check_no_ns_lock (struct ldlm_namespace *ns);
@@ -201,9 +192,13 @@ struct ldlm_state {struct ldlm_bl_pool *ldlm_bl_pool; }; +/* ldlm_pool.c */ +__u64 ldlm_pool_get_slv (struct ldlm_pool *pl); +void ldlm_pool_set_clv (struct ldlm_pool *pl,__u64 clv); +__u32 ldlm_pool_get_lvf (struct ldlm_pool *pl); +/* interval tree, for LDLM_EXTENT. */ extern struct kmem_cache *ldlm_interval_slab;/* slab cache for ldlm_interval */ -void ldlm_interval_attach (struct ldlm_interval *n,struct ldlm_lock *l);struct ldlm_interval *ldlm_interval_detach (struct ldlm_lock *l);struct ldlm_interval *ldlm_interval_alloc (struct ldlm_lock *lock);void ldlm_interval_free (struct ldlm_interval *node);
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +15 -15
@@ -60,13 +60,12 @@ char *ldlm_lockname[] = { };EXPORT_SYMBOL (ldlm_lockname); -char *ldlm_typename[] = { +static char *ldlm_typename[] = { [LDLM_PLAIN ] ="PLN" , [LDLM_EXTENT ] ="EXT" , [LDLM_FLOCK ] ="FLK" , [LDLM_IBITS ] ="IBT" , }; -EXPORT_SYMBOL (ldlm_typename);static ldlm_policy_wire_to_local_t ldlm_policy_wire18_to_local[] = { [LDLM_PLAIN -LDLM_MIN_TYPE ] = ldlm_plain_policy_wire_to_local,
@@ -92,9 +91,9 @@ static ldlm_policy_local_to_wire_t ldlm_policy_local_to_wire[] = {/** * Converts lock policy from local format to on the wire lock_desc format */ -void ldlm_convert_policy_to_wire (ldlm_type_t type, -const ldlm_policy_data_t *lpolicy, -ldlm_wire_policy_data_t *wpolicy) +static void ldlm_convert_policy_to_wire (ldlm_type_t type, +const ldlm_policy_data_t *lpolicy, +ldlm_wire_policy_data_t *wpolicy) {ldlm_policy_local_to_wire_t convert;
@@ -246,7 +245,7 @@ int ldlm_lock_remove_from_lru(struct ldlm_lock *lock)/** * Adds LDLM lock \a lock to namespace LRU. Assumes LRU is already locked. */ -void ldlm_lock_add_to_lru_nolock (struct ldlm_lock *lock) +static void ldlm_lock_add_to_lru_nolock (struct ldlm_lock *lock) {struct ldlm_namespace *ns =ldlm_lock_to_ns (lock);
@@ -264,7 +263,7 @@ void ldlm_lock_add_to_lru_nolock(struct ldlm_lock *lock)* Adds LDLM lock \a lock to namespace LRU. Obtains necessary LRU locks * first. */ -void ldlm_lock_add_to_lru (struct ldlm_lock *lock) +static void ldlm_lock_add_to_lru (struct ldlm_lock *lock) {struct ldlm_namespace *ns =ldlm_lock_to_ns (lock);
@@ -277,7 +276,7 @@ void ldlm_lock_add_to_lru(struct ldlm_lock *lock)* Moves LDLM lock \a lock that is already in namespace LRU to the tail of * the LRU. Performs necessary LRU locking */ -void ldlm_lock_touch_in_lru (struct ldlm_lock *lock) +static void ldlm_lock_touch_in_lru (struct ldlm_lock *lock) {struct ldlm_namespace *ns =ldlm_lock_to_ns (lock);
@@ -308,7 +307,7 @@ void ldlm_lock_touch_in_lru(struct ldlm_lock *lock)* ldlm_lock_destroy, you can never drop your final references on this lock. * Because it's not in the hash table anymore. -phil */ -int ldlm_lock_destroy_internal (struct ldlm_lock *lock) +static int ldlm_lock_destroy_internal (struct ldlm_lock *lock) {if (lock->l_readers || lock->l_writers) {LDLM_ERROR (lock,"lock still has references" );
@@ -355,7 +354,7 @@ int ldlm_lock_destroy_internal(struct ldlm_lock *lock)/** * Destroys a LDLM lock \a lock. Performs necessary locking first. */ -void ldlm_lock_destroy (struct ldlm_lock *lock) +static void ldlm_lock_destroy (struct ldlm_lock *lock) {int first;
@@ -397,7 +396,7 @@ static void lock_handle_free(void *lock, int size)OBD_SLAB_FREE (lock, ldlm_lock_slab, size); } -struct portals_handle_ops lock_handle_ops = { +static struct portals_handle_ops lock_handle_ops = { .hop_addref = lock_handle_addref, .hop_free = lock_handle_free, };
@@ -606,8 +605,8 @@ EXPORT_SYMBOL(ldlm_lock2desc);* * Only add if we have not sent a blocking AST to the lock yet. */ -void ldlm_add_bl_work_item (struct ldlm_lock *lock,struct ldlm_lock *new, -struct list_head *work_list) +static void ldlm_add_bl_work_item (struct ldlm_lock *lock,struct ldlm_lock *new, +struct list_head *work_list) {if ((lock->l_flags &LDLM_FL_AST_SENT ) ==0 ) {LDLM_DEBUG (lock,"lock incompatible; sending blocking AST." );
@@ -627,7 +626,8 @@ void ldlm_add_bl_work_item(struct ldlm_lock *lock, struct ldlm_lock *new,/** * Add a lock to list of just granted locks to send completion AST to. */ -void ldlm_add_cp_work_item (struct ldlm_lock *lock,struct list_head *work_list) +static void ldlm_add_cp_work_item (struct ldlm_lock *lock, +struct list_head *work_list) {if ((lock->l_flags &LDLM_FL_CP_REQD ) ==0 ) { lock->l_flags |=LDLM_FL_CP_REQD ;
@@ -1673,7 +1673,7 @@ ldlm_work_revoke_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)/** * Process a call to glimpse AST callback for a lock in ast_work list */ -int ldlm_work_gl_ast_lock (struct ptlrpc_request_set *rqset,void *opaq) +static int ldlm_work_gl_ast_lock (struct ptlrpc_request_set *rqset,void *opaq) {struct ldlm_cb_set_arg *arg = opaq;struct ldlm_glimpse_work *gl_work;
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +2 -2
@@ -58,9 +58,9 @@ MODULE_PARM_DESC(ldlm_cpts, "CPU partitions ldlm threads should run on");static struct mutex ldlm_ref_mutex;static int ldlm_refcount; -struct kobject *ldlm_kobj; +static struct kobject *ldlm_kobj;struct kset *ldlm_ns_kset; -struct kset *ldlm_svc_kset; +static struct kset *ldlm_svc_kset;struct ldlm_cb_async_args {struct ldlm_cb_set_arg *ca_set_arg;
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +18 -25
85 lines not on this page · raw message
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +12 -16
@@ -87,7 +87,7 @@ struct ldlm_async_args {struct lustre_handle lock_handle; }; -int ldlm_expired_completion_wait (void *data) +static int ldlm_expired_completion_wait (void *data) {struct lock_wait_data *lwd = data;struct ldlm_lock *lock = lwd->lwd_lock;
@@ -126,11 +126,10 @@ int ldlm_expired_completion_wait(void *data)return 0 ; } -EXPORT_SYMBOL (ldlm_expired_completion_wait);/* We use the same basis for both server side and client side functions from a single node. */ -int ldlm_get_enq_timeout (struct ldlm_lock *lock) +static int ldlm_get_enq_timeout (struct ldlm_lock *lock) {int timeout =at_get (ldlm_lock_to_ns_at (lock));
@@ -142,7 +141,6 @@ int ldlm_get_enq_timeout(struct ldlm_lock *lock) timeout =min_t (int, at_max, timeout + (timeout >>1 ));/* 150% */ return max (timeout, ldlm_enqueue_min); } -EXPORT_SYMBOL (ldlm_get_enq_timeout);/** * Helper function for ldlm_completion_ast(), updating timings when lock is
@@ -861,8 +859,9 @@ static void ldlm_cancel_pack(struct ptlrpc_request *req,/** * Prepare and send a batched cancel RPC. It will include \a count lock * handles of locks given in \a cancels list. */ -int ldlm_cli_cancel_req (struct obd_export *exp,struct list_head *cancels, -int count,ldlm_cancel_flags_t flags) +static int ldlm_cli_cancel_req (struct obd_export *exp, +struct list_head *cancels, +int count,ldlm_cancel_flags_t flags) {struct ptlrpc_request *req =NULL ;struct obd_import *imp;
@@ -944,7 +943,6 @@ int ldlm_cli_cancel_req(struct obd_export *exp, struct list_head *cancels, out:return sent ? sent : rc; } -EXPORT_SYMBOL (ldlm_cli_cancel_req);static inline struct ldlm_pool *ldlm_imp2pl (struct obd_import *imp) {
@@ -1425,9 +1423,9 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns,return added; } -int ldlm_cancel_lru_local (struct ldlm_namespace *ns,struct list_head *cancels, -int count,int max,ldlm_cancel_flags_t cancel_flags, -int flags) +int ldlm_cancel_lru_local (struct ldlm_namespace *ns, +struct list_head *cancels,int count,int max, +ldlm_cancel_flags_t cancel_flags,int flags) {int added;
@@ -1664,8 +1662,8 @@ EXPORT_SYMBOL(ldlm_cli_cancel_unused);/* Lock iterators. */ -int ldlm_resource_foreach (struct ldlm_resource *res,ldlm_iterator_t iter, -void *closure) +static int ldlm_resource_foreach (struct ldlm_resource *res, +ldlm_iterator_t iter,void *closure) {struct list_head *tmp, *next;struct ldlm_lock *lock;
@@ -1696,7 +1694,6 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter,unlock_res (res);return rc; } -EXPORT_SYMBOL (ldlm_resource_foreach);struct iter_helper_data {ldlm_iterator_t iter;
@@ -1720,8 +1717,8 @@ static int ldlm_res_iter_helper(struct cfs_hash *hs, struct cfs_hash_bd *bd,LDLM_ITER_STOP ; } -void ldlm_namespace_foreach (struct ldlm_namespace *ns, -ldlm_iterator_t iter,void *closure) +static void ldlm_namespace_foreach (struct ldlm_namespace *ns, +ldlm_iterator_t iter,void *closure) {struct iter_helper_data helper = {
@@ -1733,7 +1730,6 @@ void ldlm_namespace_foreach(struct ldlm_namespace *ns, ldlm_res_iter_helper, &helper); } -EXPORT_SYMBOL (ldlm_namespace_foreach);/* non-blocking function to manipulate a lock whose cb_data is being put away. * return 0: find no resource
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +42 -40
153 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 30/32 staging/lustre/ldlm: Remove ldlm_namespace_inactive_list()
In reply to [email protected]From: Oleg Drokin <[email protected]>
Since there are no server namespaces, just replace it with ldlm_cli_inactive_namespace_list pointer.
Also make ldlm_cli_inactive_namespace_list static as it's only used in ldlm_resource.c
--- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 7 ------- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 7 +++---- 2 files changed, 3 insertions(+), 11 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +0 -7
@@ -42,7 +42,6 @@ extern struct mutex ldlm_srv_namespace_lock;extern struct list_head ldlm_srv_namespace_list;extern struct mutex ldlm_cli_namespace_lock;extern struct list_head ldlm_cli_active_namespace_list; -extern struct list_head ldlm_cli_inactive_namespace_list;static inline int ldlm_namespace_nr_read (ldlm_side_t client) {
@@ -72,12 +71,6 @@ static inline struct list_head *ldlm_namespace_list(ldlm_side_t client) &ldlm_srv_namespace_list : &ldlm_cli_active_namespace_list; } -static inline struct list_head *ldlm_namespace_inactive_list (ldlm_side_t client) -{ -return client ==LDLM_NAMESPACE_SERVER ? - &ldlm_srv_namespace_list : &ldlm_cli_inactive_namespace_list; -} -static inline struct mutex *ldlm_namespace_lock (ldlm_side_t client) { return client == LDLM_NAMESPACE_SERVER ?
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +3 -4
@@ -59,7 +59,7 @@ struct mutex ldlm_cli_namespace_lock;* inactive list */ LIST_HEAD (ldlm_cli_active_namespace_list);/* Client namespaces that don't have any locks in them */ -LIST_HEAD (ldlm_cli_inactive_namespace_list); +static LIST_HEAD (ldlm_cli_inactive_namespace_list);static struct dentry *ldlm_debugfs_dir;static struct dentry *ldlm_ns_debugfs_dir;
@@ -609,7 +609,7 @@ static void ldlm_namespace_register(struct ldlm_namespace *ns, {mutex_lock (ldlm_namespace_lock (client));LASSERT (list_empty (&ns->ns_list_chain)); -list_add (&ns->ns_list_chain,ldlm_namespace_inactive_list (client)); +list_add (&ns->ns_list_chain, &ldlm_cli_inactive_namespace_list);ldlm_namespace_nr_inc (client);mutex_unlock (ldlm_namespace_lock (client)); }
@@ -1011,8 +1011,7 @@ void ldlm_namespace_move_to_inactive_locked(struct ldlm_namespace *ns, {LASSERT (!list_empty (&ns->ns_list_chain));LASSERT (mutex_is_locked (ldlm_namespace_lock (client))); -list_move_tail (&ns->ns_list_chain, -ldlm_namespace_inactive_list (client)); +list_move_tail (&ns->ns_list_chain, &ldlm_cli_inactive_namespace_list); }/** Should be called with ldlm_namespace_lock(client) taken. */
Signature · 1 line
2.1.0
PATCH 31/32 staging/lustre/ldlm: Remove posix lock (flock) deadlock detection
In reply to [email protected]From: Oleg Drokin <[email protected]>
This is server-side code that cannot work on the client (vfs would do this check on the local node).
--- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 132 ------------------------ 1 file changed, 132 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +0 -132
@@ -91,40 +91,6 @@ ldlm_flocks_overlap(struct ldlm_lock *lock, struct ldlm_lock *new) lock->l_policy_data.l_flock.start)); } -static inline void ldlm_flock_blocking_link (struct ldlm_lock *req, -struct ldlm_lock *lock) -{ -/* For server only */ -if (req->l_export ==NULL ) -return ; - -LASSERT (hlist_unhashed (&req->l_exp_flock_hash)); - - req->l_policy_data.l_flock.blocking_owner = - lock->l_policy_data.l_flock.owner; - req->l_policy_data.l_flock.blocking_export = - lock->l_export; - req->l_policy_data.l_flock.blocking_refs =0 ; - -cfs_hash_add (req->l_export->exp_flock_hash, - &req->l_policy_data.l_flock.owner, - &req->l_exp_flock_hash); -} - -static inline void ldlm_flock_blocking_unlink (struct ldlm_lock *req) -{ -/* For server only */ -if (req->l_export ==NULL ) -return ; - -check_res_locked (req->l_resource); -if (req->l_export->exp_flock_hash !=NULL && - !hlist_unhashed (&req->l_exp_flock_hash)) -cfs_hash_del (req->l_export->exp_flock_hash, - &req->l_policy_data.l_flock.owner, - &req->l_exp_flock_hash); -} -static inline void ldlm_flock_destroy (struct ldlm_lock *lock,ldlm_mode_t mode,__u64 flags) {
@@ -149,79 +115,6 @@ ldlm_flock_destroy(struct ldlm_lock *lock, ldlm_mode_t mode, __u64 flags) }/** -* POSIX locks deadlock detection code. -* -* Given a new lock \a req and an existing lock \a bl_lock it conflicts -* with, we need to iterate through all blocked POSIX locks for this -* export and see if there is a deadlock condition arising. (i.e. when -* one client holds a lock on something and want a lock on something -* else and at the same time another client has the opposite situation). -*/ -static int -ldlm_flock_deadlock (struct ldlm_lock *req,struct ldlm_lock *bl_lock) -{ -struct obd_export *req_exp = req->l_export; -struct obd_export *bl_exp = bl_lock->l_export; -__u64 req_owner = req->l_policy_data.l_flock.owner; -__u64 bl_owner = bl_lock->l_policy_data.l_flock.owner; - -/* For server only */ -if (req_exp ==NULL ) -return 0 ; - -class_export_get (bl_exp); -while (1 ) { -struct obd_export *bl_exp_new; -struct ldlm_lock *lock =NULL ; -struct ldlm_flock *flock; - -if (bl_exp->exp_flock_hash !=NULL ) - lock =cfs_hash_lookup (bl_exp->exp_flock_hash, - &bl_owner); -if (lock ==NULL ) -break ; - -LASSERT (req != lock); - flock = &lock->l_policy_data.l_flock; -LASSERT (flock->owner == bl_owner); - bl_owner = flock->blocking_owner; - bl_exp_new =class_export_get (flock->blocking_export); -class_export_put (bl_exp); - -cfs_hash_put (bl_exp->exp_flock_hash, &lock->l_exp_flock_hash); - bl_exp = bl_exp_new; - -if (bl_owner == req_owner && bl_exp == req_exp) { -class_export_put (bl_exp); -return 1 ; - } - } -class_export_put (bl_exp); - -return 0 ; -} - -static void ldlm_flock_cancel_on_deadlock (struct ldlm_lock *lock, -struct list_head *work_list) -{ -CDEBUG (D_INFO ,"reprocess deadlock req=%p\n" , lock); - -if ((exp_connect_flags (lock->l_export) & -OBD_CONNECT_FLOCK_DEAD ) ==0 ) { -CERROR ( -"deadlock found, but client doesn't support flock canceliation\n" ); - }else { -LASSERT (lock->l_completion_ast); -LASSERT ((lock->l_flags &LDLM_FL_AST_SENT ) ==0 ); - lock->l_flags |=LDLM_FL_AST_SENT |LDLM_FL_CANCEL_ON_BLOCK | -LDLM_FL_FLOCK_DEADLOCK ; -ldlm_flock_blocking_unlink (lock); -ldlm_resource_unlink_lock (lock); -ldlm_add_ast_work_item (lock,NULL , work_list); - } -} - -/** * Process a granting attempt for flock lock. * Must be called under ns lock held. *
@@ -307,11 +200,6 @@ reprocess:if (!first_enq) { reprocess_failed =1 ; -if (ldlm_flock_deadlock (req, lock)) { -ldlm_flock_cancel_on_deadlock (req, - work_list); -return LDLM_ITER_CONTINUE ; - }continue ; }
@@ -334,17 +222,6 @@ reprocess:return LDLM_ITER_STOP ; } -/* add lock to blocking list before deadlock -* check to prevent race */ -ldlm_flock_blocking_link (req, lock); - -if (ldlm_flock_deadlock (req, lock)) { -ldlm_flock_blocking_unlink (req); -ldlm_flock_destroy (req, mode, *flags); - *err = -EDEADLK ; -return LDLM_ITER_STOP ; - } -ldlm_resource_add_lock (res, &res->lr_waiting, req); *flags |=LDLM_FL_BLOCK_GRANTED ;return LDLM_ITER_STOP ;
@@ -360,10 +237,6 @@ reprocess:return LDLM_ITER_STOP ; } -/* In case we had slept on this lock request take it off of the -* deadlock detection hash list. */ -ldlm_flock_blocking_unlink (req); -/* Scan the locks owned by this process that overlap this request. * We may have to merge or split existing locks. */
@@ -551,9 +424,7 @@ ldlm_flock_interrupted_wait(void *data) lock = ((struct ldlm_flock_wait_data *)data)->fwd_lock; -/* take lock off the deadlock detection hash list. */ lock_res_and_lock (lock); -ldlm_flock_blocking_unlink (lock);/* client side - set flag to prevent lock from being put on LRU list */ lock->l_flags |=LDLM_FL_CBPENDING ;
@@ -660,9 +531,6 @@ granted:lock_res_and_lock (lock); -/* take lock off the deadlock detection hash list. */ -ldlm_flock_blocking_unlink (lock); -/* ldlm_lock_enqueue() has already placed lock on the granted list. */ list_del_init (&lock->l_res_link);
Signature · 1 line
2.1.0
PATCH 32/32 staging/lustre/ldlm: Make ldlm_add_ast_work_item() static
In reply to [email protected]From: Oleg Drokin <[email protected]>
Now that ldlm_flock code no longer uses it.
--- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 -- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +0 -2
@@ -142,8 +142,6 @@ void ldlm_lock_addref_internal(struct ldlm_lock *, __u32 mode);void ldlm_lock_addref_internal_nolock (struct ldlm_lock *,__u32 mode);void ldlm_lock_decref_internal (struct ldlm_lock *,__u32 mode);void ldlm_lock_decref_internal_nolock (struct ldlm_lock *,__u32 mode); -void ldlm_add_ast_work_item (struct ldlm_lock *lock,struct ldlm_lock *new, -struct list_head *work_list);int ldlm_run_ast_work (struct ldlm_namespace *ns,struct list_head *rpc_list,enum ldlm_desc_ast_t ast_type);int ldlm_lock_remove_from_lru (struct ldlm_lock *lock);
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +3 -2
@@ -644,8 +644,9 @@ static void ldlm_add_cp_work_item(struct ldlm_lock *lock,* adding function. * Must be called with lr_lock held. */ -void ldlm_add_ast_work_item (struct ldlm_lock *lock,struct ldlm_lock *new, -struct list_head *work_list) +static void ldlm_add_ast_work_item (struct ldlm_lock *lock, +struct ldlm_lock *new, +struct list_head *work_list) {check_res_locked (lock->l_resource);if (new)
Signature · 1 line
2.1.0