Skip to content

Commit 7a102b0

Browse files
committed
nilfs2: remove individual gfp constants for each metadata file
This gets rid of NILFS_CPFILE_GFP, NILFS_SUFILE_GFP, NILFS_DAT_GFP, and NILFS_IFILE_GFP. All of these constants refer to NILFS_MDT_GFP, and can be removed. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
1 parent 3218929 commit 7a102b0

8 files changed

Lines changed: 9 additions & 19 deletions

File tree

‎fs/nilfs2/cpfile.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
#include <linux/buffer_head.h>
2828
#include <linux/nilfs2_fs.h>
2929

30-
#define NILFS_CPFILE_GFP NILFS_MDT_GFP
31-
3230

3331
int nilfs_cpfile_get_checkpoint(struct inode *, __u64, int,
3432
struct nilfs_checkpoint **,

‎fs/nilfs2/dat.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <linux/buffer_head.h>
2828
#include <linux/fs.h>
2929

30-
#define NILFS_DAT_GFP NILFS_MDT_GFP
3130

3231
struct nilfs_palloc_req;
3332

‎fs/nilfs2/ifile.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "mdt.h"
3232
#include "alloc.h"
3333

34-
#define NILFS_IFILE_GFP NILFS_MDT_GFP
3534

3635
static inline struct nilfs_inode *
3736
nilfs_ifile_map_inode(struct inode *ifile, ino_t ino, struct buffer_head *ibh)

‎fs/nilfs2/mdt.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,10 @@ nilfs_mdt_new_common(struct the_nilfs *nilfs, struct super_block *sb,
513513
}
514514

515515
struct inode *nilfs_mdt_new(struct the_nilfs *nilfs, struct super_block *sb,
516-
ino_t ino, gfp_t gfp_mask)
516+
ino_t ino)
517517
{
518-
struct inode *inode = nilfs_mdt_new_common(nilfs, sb, ino, gfp_mask);
518+
struct inode *inode = nilfs_mdt_new_common(nilfs, sb, ino,
519+
NILFS_MDT_GFP);
519520

520521
if (!inode)
521522
return NULL;

‎fs/nilfs2/mdt.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ int nilfs_mdt_forget_block(struct inode *, unsigned long);
7474
int nilfs_mdt_mark_block_dirty(struct inode *, unsigned long);
7575
int nilfs_mdt_fetch_dirty(struct inode *);
7676

77-
struct inode *nilfs_mdt_new(struct the_nilfs *, struct super_block *, ino_t,
78-
gfp_t);
77+
struct inode *nilfs_mdt_new(struct the_nilfs *, struct super_block *, ino_t);
7978
struct inode *nilfs_mdt_new_common(struct the_nilfs *, struct super_block *,
8079
ino_t, gfp_t);
8180
void nilfs_mdt_destroy(struct inode *);

‎fs/nilfs2/sufile.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <linux/nilfs2_fs.h>
2929
#include "mdt.h"
3030

31-
#define NILFS_SUFILE_GFP NILFS_MDT_GFP
3231

3332
static inline unsigned long nilfs_sufile_get_nsegments(struct inode *sufile)
3433
{

‎fs/nilfs2/super.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno)
363363
list_add(&sbi->s_list, &nilfs->ns_supers);
364364
up_write(&nilfs->ns_super_sem);
365365

366-
sbi->s_ifile = nilfs_mdt_new(
367-
nilfs, sbi->s_super, NILFS_IFILE_INO, NILFS_IFILE_GFP);
366+
sbi->s_ifile = nilfs_mdt_new(nilfs, sbi->s_super, NILFS_IFILE_INO);
368367
if (!sbi->s_ifile)
369368
return -ENOMEM;
370369

‎fs/nilfs2/the_nilfs.c‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,23 +187,19 @@ static int nilfs_load_super_root(struct the_nilfs *nilfs,
187187
inode_size = nilfs->ns_inode_size;
188188

189189
err = -ENOMEM;
190-
nilfs->ns_dat = nilfs_mdt_new(
191-
nilfs, NULL, NILFS_DAT_INO, NILFS_DAT_GFP);
190+
nilfs->ns_dat = nilfs_mdt_new(nilfs, NULL, NILFS_DAT_INO);
192191
if (unlikely(!nilfs->ns_dat))
193192
goto failed;
194193

195-
nilfs->ns_gc_dat = nilfs_mdt_new(
196-
nilfs, NULL, NILFS_DAT_INO, NILFS_DAT_GFP);
194+
nilfs->ns_gc_dat = nilfs_mdt_new(nilfs, NULL, NILFS_DAT_INO);
197195
if (unlikely(!nilfs->ns_gc_dat))
198196
goto failed_dat;
199197

200-
nilfs->ns_cpfile = nilfs_mdt_new(
201-
nilfs, NULL, NILFS_CPFILE_INO, NILFS_CPFILE_GFP);
198+
nilfs->ns_cpfile = nilfs_mdt_new(nilfs, NULL, NILFS_CPFILE_INO);
202199
if (unlikely(!nilfs->ns_cpfile))
203200
goto failed_gc_dat;
204201

205-
nilfs->ns_sufile = nilfs_mdt_new(
206-
nilfs, NULL, NILFS_SUFILE_INO, NILFS_SUFILE_GFP);
202+
nilfs->ns_sufile = nilfs_mdt_new(nilfs, NULL, NILFS_SUFILE_INO);
207203
if (unlikely(!nilfs->ns_sufile))
208204
goto failed_cpfile;
209205

0 commit comments

Comments
 (0)