mm: trivial code style fix to shmem_statfs
Subsystems (2)
PATCH 1/1 mm: trivial code style fix to shmem_statfs
Should read the super_block fields, even if current implementation uses the same constants.
Signed-off-by Wang Sheng-Hui <[email protected]>
--- mm/shmem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
mm/shmem.c +4 -3
@@ -1874,10 +1874,11 @@ out:static int shmem_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct shmem_sb_info *sbinfo =SHMEM_SB (dentry->d_sb); +struct super_block *sb = dentry->d_sb; +struct shmem_sb_info *sbinfo =SHMEM_SB (sb); - buf->f_type =TMPFS_MAGIC ; - buf->f_bsize =PAGE_CACHE_SIZE ; + buf->f_type = sb->s_magic; + buf->f_bsize = sb->s_blocksize; buf->f_namelen =NAME_MAX ;if (sbinfo->max_blocks) { buf->f_blocks = sbinfo->max_blocks;
Signature · 7 lines
1.8.3.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Hugh Dickins
maintainerQuoted 5 lines · Wang Sheng-Hui
Should read the
super_blockfields, even if current implementation uses the same constants.Signed-off-by Wang Sheng-Hui <[email protected]>
I prefer how it is already, more direct, less code. They are very unlikely to change: if they do, we can update then.
If you're looking for a trivial patch to make in mm/shmem.c, I suggest removing the unused gfp arg to shmem_add_to_page_cache().
Hugh
Quoted 25 lines
--- mm/shmem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)mm/shmem.c +4
-3@@ -1874,10 +1874,11 @@ out:static int shmem_statfs (struct dentry *dentry,struct kstatfs *buf) { -struct shmem_sb_info *sbinfo =SHMEM_SB (dentry->d_sb); +struct super_block *sb = dentry->d_sb; +struct shmem_sb_info *sbinfo =SHMEM_SB (sb); - buf->f_type =TMPFS_MAGIC ; - buf->f_bsize =PAGE_CACHE_SIZE ; + buf->f_type = sb->s_magic; + buf->f_bsize = sb->s_blocksize; buf->f_namelen =NAME_MAX ;if (sbinfo->max_blocks) { buf->f_blocks = sbinfo->max_blocks;Signature · 1 line
1.8.3.2
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>