mirror of https://gitee.com/openkylin/linux.git
NFSD: Use DEFINE_SPINLOCK() for spinlock
spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Guobin Huang <huangguobin4@huawei.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
dee9f6ade3
commit
b73ac6808b
|
@ -84,7 +84,7 @@ DEFINE_MUTEX(nfsd_mutex);
|
||||||
* version 4.1 DRC caches.
|
* version 4.1 DRC caches.
|
||||||
* nfsd_drc_pages_used tracks the current version 4.1 DRC memory usage.
|
* 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_max_mem;
|
||||||
unsigned long nfsd_drc_mem_used;
|
unsigned long nfsd_drc_mem_used;
|
||||||
|
|
||||||
|
@ -563,7 +563,6 @@ static void set_max_drc(void)
|
||||||
nfsd_drc_max_mem = (nr_free_buffer_pages()
|
nfsd_drc_max_mem = (nr_free_buffer_pages()
|
||||||
>> NFSD_DRC_SIZE_SHIFT) * PAGE_SIZE;
|
>> NFSD_DRC_SIZE_SHIFT) * PAGE_SIZE;
|
||||||
nfsd_drc_mem_used = 0;
|
nfsd_drc_mem_used = 0;
|
||||||
spin_lock_init(&nfsd_drc_lock);
|
|
||||||
dprintk("%s nfsd_drc_max_mem %lu \n", __func__, nfsd_drc_max_mem);
|
dprintk("%s nfsd_drc_max_mem %lu \n", __func__, nfsd_drc_max_mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue