From 20f16c787a341146c8c9ba3daa61d60820404ffd Mon Sep 17 00:00:00 2001 From: nikita Date: Sat, 18 Oct 2008 17:34:22 +0000 Subject: [PATCH] Replace RW_LOCK_UNLOCKED() with rwlock_init() as the former doesn't work with lockdep. b=16450 --- lustre/ChangeLog | 6 ++++++ lustre/lov/lov_pool.c | 2 +- lustre/mdt/mdt_handler.c | 2 +- lustre/obdfilter/filter.c | 2 +- lustre/ptlrpc/sec.c | 4 +++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 2c9431a..b7581af 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -1686,6 +1686,12 @@ Description: Add special type for ptlrpc_request interpret functions. Details : Add lu_env parameter to ->rq_interpreter call-back. NULL is passed there. Actual usage will be in CLIO. +Severity : normal +Bugzilla : 16450 +Description: Replace RW_LOCK_UNLOCKED() macro with rwlock_init(). +Details : Replace RW_LOCK_UNLOCKED() with rwlock_init() as the former + doesn't work with lockdep. + -------------------------------------------------------------------------------- 2007-08-10 Cluster File Systems, Inc. diff --git a/lustre/lov/lov_pool.c b/lustre/lov/lov_pool.c index fe55794..12115eb 100644 --- a/lustre/lov/lov_pool.c +++ b/lustre/lov/lov_pool.c @@ -280,7 +280,7 @@ int lov_ost_pool_init(struct ost_pool *op, unsigned int count) count = LOV_POOL_INIT_COUNT; op->op_array = NULL; op->op_count = 0; - op->op_rwlock = RW_LOCK_UNLOCKED; + rwlock_init(&op->op_rwlock); op->op_size = count; OBD_ALLOC(op->op_array, op->op_size * sizeof(op->op_array[0])); if (op->op_array == NULL) { diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 74b2f11..8e7406a 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -3938,7 +3938,7 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m, server_put_mount_2(dev, lmi->lmi_mnt); } - m->mdt_sptlrpc_lock = RW_LOCK_UNLOCKED; + rwlock_init(&m->mdt_sptlrpc_lock); sptlrpc_rule_set_init(&m->mdt_sptlrpc_rset); spin_lock_init(&m->mdt_ioepoch_lock); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 8d664db..8c7fb1c 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -2023,7 +2023,7 @@ int filter_common_setup(struct obd_device *obd, struct lustre_cfg* lcfg, CFS_INIT_LIST_HEAD(&filter->fo_llog_list); spin_lock_init(&filter->fo_llog_list_lock); - filter->fo_sptlrpc_lock = RW_LOCK_UNLOCKED; + rwlock_init(&filter->fo_sptlrpc_lock); sptlrpc_rule_set_init(&filter->fo_sptlrpc_rset); filter->fo_fl_oss_capa = 0; diff --git a/lustre/ptlrpc/sec.c b/lustre/ptlrpc/sec.c index d053bca..d29a21d 100644 --- a/lustre/ptlrpc/sec.c +++ b/lustre/ptlrpc/sec.c @@ -66,7 +66,7 @@ * policy registers * ***********************************************/ -static rwlock_t policy_lock = RW_LOCK_UNLOCKED; +static rwlock_t policy_lock; static struct ptlrpc_sec_policy *policies[SPTLRPC_POLICY_MAX] = { NULL, }; @@ -2307,6 +2307,8 @@ int __init sptlrpc_init(void) { int rc; + rwlock_init(&policy_lock); + rc = sptlrpc_gc_start_thread(); if (rc) goto out; -- 1.8.3.1