/*
* 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/
cfs_spin_unlock(&ns->ns_lock);
if (nr) {
- canceled = ldlm_cancel_lru(ns, nr, LDLM_SYNC,
+ canceled = ldlm_cancel_lru(ns, nr, LDLM_ASYNC,
LDLM_CANCEL_SHRINK);
}
#ifdef __KERNEL__
return cached;
}
-static int KERN_SHRINKER(ldlm_pools_srv_shrink)
+static int ldlm_pools_srv_shrink(SHRINKER_FIRST_ARG int nr_to_scan,
+ unsigned int gfp_mask)
{
return ldlm_pools_shrink(LDLM_NAMESPACE_SERVER, nr_to_scan, gfp_mask);
}
-static int KERN_SHRINKER(ldlm_pools_cli_shrink)
+static int ldlm_pools_cli_shrink(SHRINKER_FIRST_ARG int nr_to_scan,
+ unsigned int gfp_mask)
{
return ldlm_pools_shrink(LDLM_NAMESPACE_CLIENT, nr_to_scan, gfp_mask);
}
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;
* CLONE_VM and CLONE_FILES just avoid a needless copy, because we
* just drop the VM and FILES in cfs_daemonize() right away.
*/
- rc = cfs_kernel_thread(ldlm_pools_thread_main, ldlm_pools_thread,
- CLONE_VM | CLONE_FILES);
+ rc = cfs_create_thread(ldlm_pools_thread_main, ldlm_pools_thread,
+ CFS_DAEMON_FLAGS);
if (rc < 0) {
CERROR("Can't start pool thread, error %d\n",
rc);