mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb)
Firstly by applying the following with coccinelle's spatch: @@ expression SB; @@ -SB->s_flags & MS_RDONLY +sb_rdonly(SB) to effect the conversion to sb_rdonly(sb), then by applying: @@ expression A, SB; @@ ( -(!sb_rdonly(SB)) && A +!sb_rdonly(SB) && A | -A != (sb_rdonly(SB)) +A != sb_rdonly(SB) | -A == (sb_rdonly(SB)) +A == sb_rdonly(SB) | -!(sb_rdonly(SB)) +!sb_rdonly(SB) | -A && (sb_rdonly(SB)) +A && sb_rdonly(SB) | -A || (sb_rdonly(SB)) +A || sb_rdonly(SB) | -(sb_rdonly(SB)) != A +sb_rdonly(SB) != A | -(sb_rdonly(SB)) == A +sb_rdonly(SB) == A | -(sb_rdonly(SB)) && A +sb_rdonly(SB) && A | -(sb_rdonly(SB)) || A +sb_rdonly(SB) || A ) @@ expression A, B, SB; @@ ( -(sb_rdonly(SB)) ? 1 : 0 +sb_rdonly(SB) | -(sb_rdonly(SB)) ? A : B +sb_rdonly(SB) ? A : B ) to remove left over excess bracketage and finally by applying: @@ expression A, SB; @@ ( -(A & MS_RDONLY) != sb_rdonly(SB) +(bool)(A & MS_RDONLY) != sb_rdonly(SB) | -(A & MS_RDONLY) == sb_rdonly(SB) +(bool)(A & MS_RDONLY) == sb_rdonly(SB) ) to make comparisons against the result of sb_rdonly() (which is a bool) work correctly. Signed-off-by: David Howells <[email protected]>
This commit is contained in:
parent
94e92e7ac9
commit
bc98a42c1f
74 changed files with 210 additions and 226 deletions
|
|
@ -309,7 +309,7 @@ static void mark_fsinfo_dirty(struct super_block *sb)
|
|||
{
|
||||
struct msdos_sb_info *sbi = MSDOS_SB(sb);
|
||||
|
||||
if (sb->s_flags & MS_RDONLY || sbi->fat_bits != 32)
|
||||
if (sb_rdonly(sb) || sbi->fat_bits != 32)
|
||||
return;
|
||||
|
||||
__mark_inode_dirty(sbi->fsinfo_inode, I_DIRTY_SYNC);
|
||||
|
|
|
|||
|
|
@ -657,7 +657,7 @@ static void fat_set_state(struct super_block *sb,
|
|||
struct msdos_sb_info *sbi = MSDOS_SB(sb);
|
||||
|
||||
/* do not change any thing if mounted read only */
|
||||
if ((sb->s_flags & MS_RDONLY) && !force)
|
||||
if (sb_rdonly(sb) && !force)
|
||||
return;
|
||||
|
||||
/* do not change state if fs was dirty */
|
||||
|
|
@ -787,7 +787,7 @@ static int fat_remount(struct super_block *sb, int *flags, char *data)
|
|||
|
||||
/* make sure we update state on remount. */
|
||||
new_rdonly = *flags & MS_RDONLY;
|
||||
if (new_rdonly != (sb->s_flags & MS_RDONLY)) {
|
||||
if (new_rdonly != sb_rdonly(sb)) {
|
||||
if (new_rdonly)
|
||||
fat_set_state(sb, 0, 0);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ void __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
|
|||
|
||||
if (opts->errors == FAT_ERRORS_PANIC)
|
||||
panic("FAT-fs (%s): fs panic from previous error\n", sb->s_id);
|
||||
else if (opts->errors == FAT_ERRORS_RO && !(sb->s_flags & MS_RDONLY)) {
|
||||
else if (opts->errors == FAT_ERRORS_RO && !sb_rdonly(sb)) {
|
||||
sb->s_flags |= MS_RDONLY;
|
||||
fat_msg(sb, KERN_ERR, "Filesystem has been set read-only");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue