Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-506 kernel: FC15 - reiserfs remove & cleanup
[fs/lustre-release.git]
/
lustre
/
ldlm
/
ldlm_pool.c
diff --git
a/lustre/ldlm/ldlm_pool.c
b/lustre/ldlm/ldlm_pool.c
index
2749a76
..
9536dbd
100644
(file)
--- a/
lustre/ldlm/ldlm_pool.c
+++ b/
lustre/ldlm/ldlm_pool.c
@@
-28,6
+28,9
@@
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011 Whamcloud, Inc.
+ *
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*/
/*
* This file is part of Lustre, http://www.lustre.org/
@@
-1151,16
+1154,18
@@
static int ldlm_pools_shrink(ldlm_side_t client, int nr,
return cached;
}
return cached;
}
-static int ldlm_pools_srv_shrink(SHRINKER_FIRST_ARG int nr_to_scan,
- unsigned int gfp_mask)
+static int ldlm_pools_srv_shrink(SHRINKER_ARGS(sc, nr_to_scan, gfp_mask))
{
{
- return ldlm_pools_shrink(LDLM_NAMESPACE_SERVER, nr_to_scan, gfp_mask);
+ return ldlm_pools_shrink(LDLM_NAMESPACE_SERVER,
+ shrink_param(sc, nr_to_scan),
+ shrink_param(sc, gfp_mask));
}
}
-static int ldlm_pools_cli_shrink(SHRINKER_FIRST_ARG int nr_to_scan,
- unsigned int gfp_mask)
+static int ldlm_pools_cli_shrink(SHRINKER_ARGS(sc, nr_to_scan, gfp_mask))
{
{
- return ldlm_pools_shrink(LDLM_NAMESPACE_CLIENT, nr_to_scan, gfp_mask);
+ return ldlm_pools_shrink(LDLM_NAMESPACE_CLIENT,
+ shrink_param(sc, nr_to_scan),
+ shrink_param(sc, gfp_mask));
}
void ldlm_pools_recalc(ldlm_side_t client)
}
void ldlm_pools_recalc(ldlm_side_t client)
@@
-1264,9
+1269,9
@@
void ldlm_pools_recalc(ldlm_side_t client)
cfs_spin_lock(&ns->ns_lock);
/*
* skip ns which is being freed, and we don't want to increase
cfs_spin_lock(&ns->ns_lock);
/*
* skip ns which is being freed, and we don't want to increase
- * its refcount again, not even temporarily. bz21519.
+ * its refcount again, not even temporarily. bz21519
& LU-499
.
*/
*/
- if (
cfs_atomic_read(&ns->ns_bref) == 0
) {
+ if (
ns->ns_stopping
) {
skip = 1;
} else {
skip = 0;
skip = 1;
} else {
skip = 0;
@@
-1295,7
+1300,7
@@
static int ldlm_pools_thread_main(void *arg)
ENTRY;
cfs_daemonize(t_name);
ENTRY;
cfs_daemonize(t_name);
- thread
->t_flags = SVC_RUNNING
;
+ thread
_set_flags(thread, SVC_RUNNING)
;
cfs_waitq_signal(&thread->t_ctl_waitq);
CDEBUG(D_DLMTRACE, "%s: pool thread starting, process %d\n",
cfs_waitq_signal(&thread->t_ctl_waitq);
CDEBUG(D_DLMTRACE, "%s: pool thread starting, process %d\n",
@@
-1316,19
+1321,18
@@
static int ldlm_pools_thread_main(void *arg)
*/
lwi = LWI_TIMEOUT(cfs_time_seconds(LDLM_POOLS_THREAD_PERIOD),
NULL, NULL);
*/
lwi = LWI_TIMEOUT(cfs_time_seconds(LDLM_POOLS_THREAD_PERIOD),
NULL, NULL);
- l_wait_event(thread->t_ctl_waitq, (thread->t_flags &
- (SVC_STOPPING|SVC_EVENT)),
+ l_wait_event(thread->t_ctl_waitq,
+ thread_is_stopping(thread) ||
+ thread_is_event(thread),
&lwi);
&lwi);
- if (thread->t_flags & SVC_STOPPING) {
- thread->t_flags &= ~SVC_STOPPING;
+ if (thread_test_and_clear_flags(thread, SVC_STOPPING))
break;
break;
- } else if (thread->t_flags & SVC_EVENT) {
- thread->t_flags &= ~SVC_EVENT;
- }
+ else
+ thread_test_and_clear_flags(thread, SVC_EVENT);
}
}
- thread
->t_flags = SVC_STOPPED
;
+ thread
_set_flags(thread, SVC_STOPPED)
;
cfs_waitq_signal(&thread->t_ctl_waitq);
CDEBUG(D_DLMTRACE, "%s: pool thread exiting, process %d\n",
cfs_waitq_signal(&thread->t_ctl_waitq);
CDEBUG(D_DLMTRACE, "%s: pool thread exiting, process %d\n",
@@
-1367,7
+1371,7
@@
static int ldlm_pools_thread_start(void)
RETURN(rc);
}
l_wait_event(ldlm_pools_thread->t_ctl_waitq,
RETURN(rc);
}
l_wait_event(ldlm_pools_thread->t_ctl_waitq,
-
(ldlm_pools_thread->t_flags & SVC_RUNNING
), &lwi);
+
thread_is_running(ldlm_pools_thread
), &lwi);
RETURN(0);
}
RETURN(0);
}
@@
-1380,7
+1384,7
@@
static void ldlm_pools_thread_stop(void)
return;
}
return;
}
-
ldlm_pools_thread->t_flags = SVC_STOPPING
;
+
thread_set_flags(ldlm_pools_thread, SVC_STOPPING)
;
cfs_waitq_signal(&ldlm_pools_thread->t_ctl_waitq);
/*
cfs_waitq_signal(&ldlm_pools_thread->t_ctl_waitq);
/*