Commit 8636df83 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] remount: forced-nodiratime filesystems

 - a bunch of filesystems force MS_NODIRATIME on mount but forgot to do
   the same on remount.  Fixed.
parent 360ee2d5
...@@ -192,6 +192,7 @@ static int parse_options(struct super_block *sb, char *options) ...@@ -192,6 +192,7 @@ static int parse_options(struct super_block *sb, char *options)
static int adfs_remount(struct super_block *sb, int *flags, char *data) static int adfs_remount(struct super_block *sb, int *flags, char *data)
{ {
*flags |= MS_NODIRATIME;
return parse_options(sb, data); return parse_options(sb, data);
} }
......
...@@ -502,6 +502,8 @@ affs_remount(struct super_block *sb, int *flags, char *data) ...@@ -502,6 +502,8 @@ affs_remount(struct super_block *sb, int *flags, char *data)
pr_debug("AFFS: remount(flags=0x%x,opts=\"%s\")\n",*flags,data); pr_debug("AFFS: remount(flags=0x%x,opts=\"%s\")\n",*flags,data);
*flags |= MS_NODIRATIME;
if (!parse_options(data,&uid,&gid,&mode,&reserved,&root_block, if (!parse_options(data,&uid,&gid,&mode,&reserved,&root_block,
&blocksize,&sbi->s_prefix,sbi->s_volume,&mount_flags)) &blocksize,&sbi->s_prefix,sbi->s_volume,&mount_flags))
return -EINVAL; return -EINVAL;
......
...@@ -357,6 +357,12 @@ static struct quotactl_ops cifs_quotactl_ops = { ...@@ -357,6 +357,12 @@ static struct quotactl_ops cifs_quotactl_ops = {
}; };
#endif #endif
static int cifs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
struct super_operations cifs_super_ops = { struct super_operations cifs_super_ops = {
.read_inode = cifs_read_inode, .read_inode = cifs_read_inode,
.put_super = cifs_put_super, .put_super = cifs_put_super,
...@@ -369,6 +375,7 @@ struct super_operations cifs_super_ops = { ...@@ -369,6 +375,7 @@ struct super_operations cifs_super_ops = {
us with the same number of releases (closes) as opens */ us with the same number of releases (closes) as opens */
.show_options = cifs_show_options, .show_options = cifs_show_options,
/* .umount_begin = cifs_umount_begin, *//* consider adding in the future */ /* .umount_begin = cifs_umount_begin, *//* consider adding in the future */
.remount_fs = cifs_remount,
}; };
static struct super_block * static struct super_block *
......
...@@ -82,6 +82,12 @@ void coda_destroy_inodecache(void) ...@@ -82,6 +82,12 @@ void coda_destroy_inodecache(void)
printk(KERN_INFO "coda_inode_cache: not all structures were freed\n"); printk(KERN_INFO "coda_inode_cache: not all structures were freed\n");
} }
static int coda_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
/* exported operations */ /* exported operations */
struct super_operations coda_super_operations = struct super_operations coda_super_operations =
{ {
...@@ -90,6 +96,7 @@ struct super_operations coda_super_operations = ...@@ -90,6 +96,7 @@ struct super_operations coda_super_operations =
.clear_inode = coda_clear_inode, .clear_inode = coda_clear_inode,
.put_super = coda_put_super, .put_super = coda_put_super,
.statfs = coda_statfs, .statfs = coda_statfs,
.remount_fs = coda_remount,
}; };
static int get_device_index(struct coda_mount_data *data) static int get_device_index(struct coda_mount_data *data)
......
...@@ -734,6 +734,12 @@ void __exit fat_destroy_inodecache(void) ...@@ -734,6 +734,12 @@ void __exit fat_destroy_inodecache(void)
printk(KERN_INFO "fat_inode_cache: not all structures were freed\n"); printk(KERN_INFO "fat_inode_cache: not all structures were freed\n");
} }
static int fat_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
static struct super_operations fat_sops = { static struct super_operations fat_sops = {
.alloc_inode = fat_alloc_inode, .alloc_inode = fat_alloc_inode,
.destroy_inode = fat_destroy_inode, .destroy_inode = fat_destroy_inode,
...@@ -742,6 +748,7 @@ static struct super_operations fat_sops = { ...@@ -742,6 +748,7 @@ static struct super_operations fat_sops = {
.put_super = fat_put_super, .put_super = fat_put_super,
.statfs = fat_statfs, .statfs = fat_statfs,
.clear_inode = fat_clear_inode, .clear_inode = fat_clear_inode,
.remount_fs = fat_remount,
.read_inode = make_bad_inode, .read_inode = make_bad_inode,
......
...@@ -94,6 +94,7 @@ static int hfs_statfs(struct super_block *sb, struct kstatfs *buf) ...@@ -94,6 +94,7 @@ static int hfs_statfs(struct super_block *sb, struct kstatfs *buf)
int hfs_remount(struct super_block *sb, int *flags, char *data) int hfs_remount(struct super_block *sb, int *flags, char *data)
{ {
*flags |= MS_NODIRATIME;
if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
return 0; return 0;
if (!(*flags & MS_RDONLY)) { if (!(*flags & MS_RDONLY)) {
......
...@@ -1771,6 +1771,12 @@ jffs_write_super(struct super_block *sb) ...@@ -1771,6 +1771,12 @@ jffs_write_super(struct super_block *sb)
unlock_kernel(); unlock_kernel();
} }
static int jffs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
static struct super_operations jffs_ops = static struct super_operations jffs_ops =
{ {
.read_inode = jffs_read_inode, .read_inode = jffs_read_inode,
...@@ -1778,6 +1784,7 @@ static struct super_operations jffs_ops = ...@@ -1778,6 +1784,7 @@ static struct super_operations jffs_ops =
.put_super = jffs_put_super, .put_super = jffs_put_super,
.write_super = jffs_write_super, .write_super = jffs_write_super,
.statfs = jffs_statfs, .statfs = jffs_statfs,
.remount_fs = jffs_remount,
}; };
static struct super_block *jffs_get_sb(struct file_system_type *fs_type, static struct super_block *jffs_get_sb(struct file_system_type *fs_type,
......
...@@ -85,6 +85,12 @@ static void destroy_inodecache(void) ...@@ -85,6 +85,12 @@ static void destroy_inodecache(void)
printk(KERN_INFO "ncp_inode_cache: not all structures were freed\n"); printk(KERN_INFO "ncp_inode_cache: not all structures were freed\n");
} }
static int ncp_remount(struct super_block *sb, int *flags, char* data)
{
*flags |= MS_NODIRATIME;
return 0;
}
static struct super_operations ncp_sops = static struct super_operations ncp_sops =
{ {
.alloc_inode = ncp_alloc_inode, .alloc_inode = ncp_alloc_inode,
...@@ -93,6 +99,7 @@ static struct super_operations ncp_sops = ...@@ -93,6 +99,7 @@ static struct super_operations ncp_sops =
.delete_inode = ncp_delete_inode, .delete_inode = ncp_delete_inode,
.put_super = ncp_put_super, .put_super = ncp_put_super,
.statfs = ncp_statfs, .statfs = ncp_statfs,
.remount_fs = ncp_remount,
}; };
extern struct dentry_operations ncp_root_dentry_operations; extern struct dentry_operations ncp_root_dentry_operations;
......
...@@ -127,6 +127,12 @@ int __init proc_init_inodecache(void) ...@@ -127,6 +127,12 @@ int __init proc_init_inodecache(void)
return 0; return 0;
} }
static int proc_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
static struct super_operations proc_sops = { static struct super_operations proc_sops = {
.alloc_inode = proc_alloc_inode, .alloc_inode = proc_alloc_inode,
.destroy_inode = proc_destroy_inode, .destroy_inode = proc_destroy_inode,
...@@ -134,6 +140,7 @@ static struct super_operations proc_sops = { ...@@ -134,6 +140,7 @@ static struct super_operations proc_sops = {
.drop_inode = generic_delete_inode, .drop_inode = generic_delete_inode,
.delete_inode = proc_delete_inode, .delete_inode = proc_delete_inode,
.statfs = simple_statfs, .statfs = simple_statfs,
.remount_fs = proc_remount,
}; };
enum { enum {
......
...@@ -93,6 +93,12 @@ static void destroy_inodecache(void) ...@@ -93,6 +93,12 @@ static void destroy_inodecache(void)
printk(KERN_INFO "smb_inode_cache: not all structures were freed\n"); printk(KERN_INFO "smb_inode_cache: not all structures were freed\n");
} }
static int smb_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
static struct super_operations smb_sops = static struct super_operations smb_sops =
{ {
.alloc_inode = smb_alloc_inode, .alloc_inode = smb_alloc_inode,
...@@ -102,6 +108,7 @@ static struct super_operations smb_sops = ...@@ -102,6 +108,7 @@ static struct super_operations smb_sops =
.put_super = smb_put_super, .put_super = smb_put_super,
.statfs = smb_statfs, .statfs = smb_statfs,
.show_options = smb_show_options, .show_options = smb_show_options,
.remount_fs = smb_remount,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment