mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
exfat:fixed exfat compliling failed on kernel 5.4
fixed exfat compliling failed on kernel 5.4 , due to MS_RDONLY and MS_NODIRATIME flag is just used for mounting, if file system need used SB_*. Change-Id: Icf8bb0595bd2aacefcc3bbf6bc81c48f103af6bf Signed-off-by: yuedl1 <yuedl1@lenovo.com> Reviewed-on: https://gerrit.mot.com/1773673 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Dongliang Yue <yuedl1@motorola.com> Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
df5ea75b7d
commit
371fad72cb
3 changed files with 23 additions and 0 deletions
|
|
@ -1764,8 +1764,14 @@ void fs_error(struct super_block *sb)
|
|||
|
||||
if (opts->errors == EXFAT_ERRORS_PANIC)
|
||||
panic("[EXFAT] Filesystem panic from previous error\n");
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,19,0)
|
||||
else if ((opts->errors == EXFAT_ERRORS_RO) && !(sb->s_flags & MS_RDONLY)) {
|
||||
sb->s_flags |= MS_RDONLY;
|
||||
#else
|
||||
else if ((opts->errors == EXFAT_ERRORS_RO) && !(sb->s_flags & SB_RDONLY)) {
|
||||
sb->s_flags |= SB_RDONLY;
|
||||
#endif
|
||||
|
||||
if (sbi && !sbi->disable_uevent)
|
||||
schedule_work(&sbi->uevent_work);
|
||||
printk(KERN_ERR "[EXFAT] Filesystem has been set read-only\n");
|
||||
|
|
|
|||
|
|
@ -2160,7 +2160,12 @@ static int exfat_statfs(struct dentry *dentry, struct kstatfs *buf)
|
|||
|
||||
static int exfat_remount(struct super_block *sb, int *flags, char *data)
|
||||
{
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,19,0)
|
||||
*flags |= MS_NODIRATIME;
|
||||
#else
|
||||
*flags |= SB_NODIRATIME;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -2516,7 +2521,12 @@ static int exfat_fill_super(struct super_block *sb, void *data, int silent)
|
|||
INIT_WORK(&sbi->uevent_work, exfat_sbi_uevent_work);
|
||||
|
||||
sb->s_fs_info = sbi;
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,19,0)
|
||||
sb->s_flags |= MS_NODIRATIME;
|
||||
#else
|
||||
sb->s_flags |= SB_NODIRATIME;
|
||||
#endif
|
||||
|
||||
sb->s_magic = EXFAT_SUPER_MAGIC;
|
||||
sb->s_op = &exfat_sops;
|
||||
sb->s_export_op = &exfat_export_ops;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,14 @@ static inline struct exfat_inode_info *EXFAT_I(struct inode *inode)
|
|||
|
||||
static inline bool exfat_readonly(struct super_block *sb)
|
||||
{
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,19,0)
|
||||
return sb->s_flags & MS_RDONLY;
|
||||
#else
|
||||
return sb->s_flags & SB_RDONLY;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue