linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: drop pointless static qualifier in bdev_cache_init()
@ 2019-02-18 14:22 Mao Wenan
  0 siblings, 0 replies; 3+ messages in thread
From: Mao Wenan @ 2019-02-18 14:22 UTC (permalink / raw)
  To: viro, linux-fsdevel, kernel-janitors, maowenan

There is no need to have the struct vfsmount *bd_mnt with static
since new value always be assigned before use it.

Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 fs/block_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 58a4c1217fa8..dcf54494c79e 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -847,7 +847,7 @@ EXPORT_SYMBOL_GPL(blockdev_superblock);
 void __init bdev_cache_init(void)
 {
 	int err;
-	static struct vfsmount *bd_mnt;
+	struct vfsmount *bd_mnt;
 
 	bdev_cachep = kmem_cache_create("bdev_cache", sizeof(struct bdev_inode),
 			0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs: drop pointless static qualifier in bdev_cache_init()
  2019-02-18 14:14 Mao Wenan
@ 2019-02-18 14:32 ` Matthew Wilcox
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2019-02-18 14:32 UTC (permalink / raw)
  To: Mao Wenan; +Cc: viro, linux-fsdevel, kernel-janitors

On Mon, Feb 18, 2019 at 10:14:17PM +0800, Mao Wenan wrote:
> There is no need to have the struct vfsmount *bd_mnt with static
> since new value always be assigned before use it.

No.  The point is to keep a copy of bd_mnt around.  Putting it on the
stack would lead to it being overwritten.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] fs: drop pointless static qualifier in bdev_cache_init()
@ 2019-02-18 14:14 Mao Wenan
  2019-02-18 14:32 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Mao Wenan @ 2019-02-18 14:14 UTC (permalink / raw)
  To: viro, linux-fsdevel, kernel-janitors

There is no need to have the struct vfsmount *bd_mnt with static
since new value always be assigned before use it.

Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 fs/block_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 58a4c1217fa8..dcf54494c79e 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -847,7 +847,7 @@ EXPORT_SYMBOL_GPL(blockdev_superblock);
 void __init bdev_cache_init(void)
 {
 	int err;
-	static struct vfsmount *bd_mnt;
+	struct vfsmount *bd_mnt;
 
 	bdev_cachep = kmem_cache_create("bdev_cache", sizeof(struct bdev_inode),
 			0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-18 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 14:22 [PATCH] fs: drop pointless static qualifier in bdev_cache_init() Mao Wenan
  -- strict thread matches above, loose matches on Subject: below --
2019-02-18 14:14 Mao Wenan
2019-02-18 14:32 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).