Skip to content

Commit 1751e8a

Browse files
committed
Rename superblock flags (MS_xyz -> SB_xyz)
This is a pure automated search-and-replace of the internal kernel superblock flags. The s_flags are now called SB_*, with the names and the values for the moment mirroring the MS_* flags that they're equivalent to. Note how the MS_xyz flags are the ones passed to the mount system call, while the SB_xyz flags are what we then use in sb->s_flags. The script to do this was: # places to look in; re security/*: it generally should *not* be # touched (that stuff parses mount(2) arguments directly), but # there are two places where we really deal with superblock flags. FILES="drivers/mtd drivers/staging/lustre fs ipc mm \ include/linux/fs.h include/uapi/linux/bfs_fs.h \ security/apparmor/apparmorfs.c security/apparmor/include/lib.h" # the list of MS_... constants SYMS="RDONLY NOSUID NODEV NOEXEC SYNCHRONOUS REMOUNT MANDLOCK \ DIRSYNC NOATIME NODIRATIME BIND MOVE REC VERBOSE SILENT \ POSIXACL UNBINDABLE PRIVATE SLAVE SHARED RELATIME KERNMOUNT \ I_VERSION STRICTATIME LAZYTIME SUBMOUNT NOREMOTELOCK NOSEC BORN \ ACTIVE NOUSER" SED_PROG= for i in $SYMS; do SED_PROG="$SED_PROG -e s/MS_$i/SB_$i/g"; done # we want files that contain at least one of MS_..., # with fs/namespace.c and fs/pnode.c excluded. L=$(for i in $SYMS; do git grep -w -l MS_$i $FILES; done| sort|uniq|grep -v '^fs/namespace.c'|grep -v '^fs/pnode.c') for f in $L; do sed -i $f $SED_PROG; done Requested-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 141cbfb commit 1751e8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+417
-417
lines changed

drivers/mtd/mtdsuper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ static struct dentry *mount_mtd_aux(struct file_system_type *fs_type, int flags,
7979
pr_debug("MTDSB: New superblock for device %d (\"%s\")\n",
8080
mtd->index, mtd->name);
8181

82-
ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
82+
ret = fill_super(sb, data, flags & SB_SILENT ? 1 : 0);
8383
if (ret < 0) {
8484
deactivate_locked_super(sb);
8585
return ERR_PTR(ret);
8686
}
8787

8888
/* go */
89-
sb->s_flags |= MS_ACTIVE;
89+
sb->s_flags |= SB_ACTIVE;
9090
return dget(sb->s_root);
9191

9292
/* new mountpoint for an already mounted superblock */
@@ -202,7 +202,7 @@ struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
202202
not_an_MTD_device:
203203
#endif /* CONFIG_BLOCK */
204204

205-
if (!(flags & MS_SILENT))
205+
if (!(flags & SB_SILENT))
206206
printk(KERN_NOTICE
207207
"MTD: Attempt to mount non-MTD device \"%s\"\n",
208208
dev_name);

drivers/staging/lustre/lustre/llite/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ static bool file_is_noatime(const struct file *file)
10161016
if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
10171017
return true;
10181018

1019-
if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
1019+
if ((inode->i_sb->s_flags & SB_NODIRATIME) && S_ISDIR(inode->i_mode))
10201020
return true;
10211021

10221022
return false;

drivers/staging/lustre/lustre/llite/llite_lib.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,11 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
313313
}
314314

315315
if (data->ocd_connect_flags & OBD_CONNECT_ACL) {
316-
sb->s_flags |= MS_POSIXACL;
316+
sb->s_flags |= SB_POSIXACL;
317317
sbi->ll_flags |= LL_SBI_ACL;
318318
} else {
319319
LCONSOLE_INFO("client wants to enable acl, but mdt not!\n");
320-
sb->s_flags &= ~MS_POSIXACL;
320+
sb->s_flags &= ~SB_POSIXACL;
321321
sbi->ll_flags &= ~LL_SBI_ACL;
322322
}
323323

@@ -660,7 +660,7 @@ void ll_kill_super(struct super_block *sb)
660660
struct ll_sb_info *sbi;
661661

662662
/* not init sb ?*/
663-
if (!(sb->s_flags & MS_ACTIVE))
663+
if (!(sb->s_flags & SB_ACTIVE))
664664
return;
665665

666666
sbi = ll_s2sbi(sb);
@@ -2039,8 +2039,8 @@ int ll_remount_fs(struct super_block *sb, int *flags, char *data)
20392039
int err;
20402040
__u32 read_only;
20412041

2042-
if ((bool)(*flags & MS_RDONLY) != sb_rdonly(sb)) {
2043-
read_only = *flags & MS_RDONLY;
2042+
if ((bool)(*flags & SB_RDONLY) != sb_rdonly(sb)) {
2043+
read_only = *flags & SB_RDONLY;
20442044
err = obd_set_info_async(NULL, sbi->ll_md_exp,
20452045
sizeof(KEY_READ_ONLY),
20462046
KEY_READ_ONLY, sizeof(read_only),
@@ -2053,9 +2053,9 @@ int ll_remount_fs(struct super_block *sb, int *flags, char *data)
20532053
}
20542054

20552055
if (read_only)
2056-
sb->s_flags |= MS_RDONLY;
2056+
sb->s_flags |= SB_RDONLY;
20572057
else
2058-
sb->s_flags &= ~MS_RDONLY;
2058+
sb->s_flags &= ~SB_RDONLY;
20592059

20602060
if (sbi->ll_flags & LL_SBI_VERBOSE)
20612061
LCONSOLE_WARN("Remounted %s %s\n", profilenm,

fs/9p/vfs_super.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
9494
if (v9ses->cache)
9595
sb->s_bdi->ra_pages = (VM_MAX_READAHEAD * 1024)/PAGE_SIZE;
9696

97-
sb->s_flags |= MS_ACTIVE | MS_DIRSYNC | MS_NOATIME;
97+
sb->s_flags |= SB_ACTIVE | SB_DIRSYNC | SB_NOATIME;
9898
if (!v9ses->cache)
99-
sb->s_flags |= MS_SYNCHRONOUS;
99+
sb->s_flags |= SB_SYNCHRONOUS;
100100

101101
#ifdef CONFIG_9P_FS_POSIX_ACL
102102
if ((v9ses->flags & V9FS_ACL_MASK) == V9FS_POSIX_ACL)
103-
sb->s_flags |= MS_POSIXACL;
103+
sb->s_flags |= SB_POSIXACL;
104104
#endif
105105

106106
return 0;

fs/adfs/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int parse_options(struct super_block *sb, char *options)
213213
static int adfs_remount(struct super_block *sb, int *flags, char *data)
214214
{
215215
sync_filesystem(sb);
216-
*flags |= MS_NODIRATIME;
216+
*flags |= SB_NODIRATIME;
217217
return parse_options(sb, data);
218218
}
219219

@@ -372,7 +372,7 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
372372
struct inode *root;
373373
int ret = -EINVAL;
374374

375-
sb->s_flags |= MS_NODIRATIME;
375+
sb->s_flags |= SB_NODIRATIME;
376376

377377
asb = kzalloc(sizeof(*asb), GFP_KERNEL);
378378
if (!asb)

fs/affs/amigaffs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ affs_error(struct super_block *sb, const char *function, const char *fmt, ...)
453453
pr_crit("error (device %s): %s(): %pV\n", sb->s_id, function, &vaf);
454454
if (!sb_rdonly(sb))
455455
pr_warn("Remounting filesystem read-only\n");
456-
sb->s_flags |= MS_RDONLY;
456+
sb->s_flags |= SB_RDONLY;
457457
va_end(args);
458458
}
459459

fs/affs/bitmap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ int affs_init_bitmap(struct super_block *sb, int *flags)
250250
int i, res = 0;
251251
struct affs_sb_info *sbi = AFFS_SB(sb);
252252

253-
if (*flags & MS_RDONLY)
253+
if (*flags & SB_RDONLY)
254254
return 0;
255255

256256
if (!AFFS_ROOT_TAIL(sb, sbi->s_root_bh)->bm_flag) {
257257
pr_notice("Bitmap invalid - mounting %s read only\n", sb->s_id);
258-
*flags |= MS_RDONLY;
258+
*flags |= SB_RDONLY;
259259
return 0;
260260
}
261261

@@ -288,7 +288,7 @@ int affs_init_bitmap(struct super_block *sb, int *flags)
288288
if (affs_checksum_block(sb, bh)) {
289289
pr_warn("Bitmap %u invalid - mounting %s read only.\n",
290290
bm->bm_key, sb->s_id);
291-
*flags |= MS_RDONLY;
291+
*flags |= SB_RDONLY;
292292
goto out;
293293
}
294294
pr_debug("read bitmap block %d: %d\n", blk, bm->bm_key);

fs/affs/super.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
356356

357357
sb->s_magic = AFFS_SUPER_MAGIC;
358358
sb->s_op = &affs_sops;
359-
sb->s_flags |= MS_NODIRATIME;
359+
sb->s_flags |= SB_NODIRATIME;
360360

361361
sbi = kzalloc(sizeof(struct affs_sb_info), GFP_KERNEL);
362362
if (!sbi)
@@ -466,7 +466,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
466466
if ((chksum == FS_DCFFS || chksum == MUFS_DCFFS || chksum == FS_DCOFS
467467
|| chksum == MUFS_DCOFS) && !sb_rdonly(sb)) {
468468
pr_notice("Dircache FS - mounting %s read only\n", sb->s_id);
469-
sb->s_flags |= MS_RDONLY;
469+
sb->s_flags |= SB_RDONLY;
470470
}
471471
switch (chksum) {
472472
case MUFS_FS:
@@ -488,7 +488,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
488488
/* fall thru */
489489
case FS_OFS:
490490
affs_set_opt(sbi->s_flags, SF_OFS);
491-
sb->s_flags |= MS_NOEXEC;
491+
sb->s_flags |= SB_NOEXEC;
492492
break;
493493
case MUFS_DCOFS:
494494
case MUFS_INTLOFS:
@@ -497,7 +497,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
497497
case FS_INTLOFS:
498498
affs_set_opt(sbi->s_flags, SF_INTL);
499499
affs_set_opt(sbi->s_flags, SF_OFS);
500-
sb->s_flags |= MS_NOEXEC;
500+
sb->s_flags |= SB_NOEXEC;
501501
break;
502502
default:
503503
pr_err("Unknown filesystem on device %s: %08X\n",
@@ -513,7 +513,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
513513
sig, sig[3] + '0', blocksize);
514514
}
515515

516-
sb->s_flags |= MS_NODEV | MS_NOSUID;
516+
sb->s_flags |= SB_NODEV | SB_NOSUID;
517517

518518
sbi->s_data_blksize = sb->s_blocksize;
519519
if (affs_test_opt(sbi->s_flags, SF_OFS))
@@ -570,7 +570,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
570570
pr_debug("%s(flags=0x%x,opts=\"%s\")\n", __func__, *flags, data);
571571

572572
sync_filesystem(sb);
573-
*flags |= MS_NODIRATIME;
573+
*flags |= SB_NODIRATIME;
574574

575575
memcpy(volume, sbi->s_volume, 32);
576576
if (!parse_options(data, &uid, &gid, &mode, &reserved, &root_block,
@@ -596,10 +596,10 @@ affs_remount(struct super_block *sb, int *flags, char *data)
596596
memcpy(sbi->s_volume, volume, 32);
597597
spin_unlock(&sbi->symlink_lock);
598598

599-
if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb))
599+
if ((bool)(*flags & SB_RDONLY) == sb_rdonly(sb))
600600
return 0;
601601

602-
if (*flags & MS_RDONLY)
602+
if (*flags & SB_RDONLY)
603603
affs_free_bitmap(sb);
604604
else
605605
res = affs_init_bitmap(sb, flags);

fs/afs/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,10 +496,10 @@ static struct dentry *afs_mount(struct file_system_type *fs_type,
496496
if (ret < 0)
497497
goto error_sb;
498498
as = NULL;
499-
sb->s_flags |= MS_ACTIVE;
499+
sb->s_flags |= SB_ACTIVE;
500500
} else {
501501
_debug("reuse");
502-
ASSERTCMP(sb->s_flags, &, MS_ACTIVE);
502+
ASSERTCMP(sb->s_flags, &, SB_ACTIVE);
503503
afs_destroy_sbi(as);
504504
as = NULL;
505505
}

fs/befs/ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ Version 0.4 (2001-10-28)
365365
(fs/befs/super.c)
366366

367367
* Tell the kernel to only mount befs read-only.
368-
By setting the MS_RDONLY flag in befs_read_super().
368+
By setting the SB_RDONLY flag in befs_read_super().
369369
Not that it was possible to write before. But now the kernel won't even try.
370370
(fs/befs/super.c)
371371

0 commit comments

Comments
 (0)