[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200725085642.98356-1-miaoqinglang@huawei.com>
Date: Sat, 25 Jul 2020 16:56:42 +0800
From: Qinglang Miao <miaoqinglang@...wei.com>
To: "J. Bruce Fields" <bfields@...ldses.org>,
Chuck Lever <chuck.lever@...cle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: <linux-nfs@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] nfsd: use DEFINE_SPINLOCK() for spinlock
nfsd_drc_lock can be initialized automatically with
DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init().
Signed-off-by: Qinglang Miao <miaoqinglang@...wei.com>
---
fs/nfsd/nfssvc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index b603dfcdd..20f0a27fe 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -88,7 +88,7 @@ DEFINE_MUTEX(nfsd_mutex);
* version 4.1 DRC caches.
* nfsd_drc_pages_used tracks the current version 4.1 DRC memory usage.
*/
-spinlock_t nfsd_drc_lock;
+DEFINE_SPINLOCK(nfsd_drc_lock);
unsigned long nfsd_drc_max_mem;
unsigned long nfsd_drc_mem_used;
@@ -568,7 +568,6 @@ static void set_max_drc(void)
nfsd_drc_max_mem = (nr_free_buffer_pages()
>> NFSD_DRC_SIZE_SHIFT) * PAGE_SIZE;
nfsd_drc_mem_used = 0;
- spin_lock_init(&nfsd_drc_lock);
dprintk("%s nfsd_drc_max_mem %lu \n", __func__, nfsd_drc_max_mem);
}
--
2.25.1
Powered by blists - more mailing lists