aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/filesystems/vfs.txt6
-rw-r--r--fs/efivarfs/super.c1
-rw-r--r--fs/namespace.c59
-rw-r--r--fs/super.c1
-rw-r--r--include/linux/fs.h9
5 files changed, 0 insertions, 76 deletions
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index f42b90687d40..ee56a7d10da9 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -1187,12 +1187,6 @@ The underlying reason for the above rules is to make sure, that a
1187mount can be accurately replicated (e.g. umounting and mounting again) 1187mount can be accurately replicated (e.g. umounting and mounting again)
1188based on the information found in /proc/mounts. 1188based on the information found in /proc/mounts.
1189 1189
1190A simple method of saving options at mount/remount time and showing
1191them is provided with the save_mount_options() and
1192generic_show_options() helper functions. Please note, that using
1193these may have drawbacks. For more info see header comments for these
1194functions in fs/namespace.c.
1195
1196Resources 1190Resources
1197========= 1191=========
1198 1192
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index d7a7c53803c1..5b68e4294faa 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -29,7 +29,6 @@ static const struct super_operations efivarfs_ops = {
29 .statfs = simple_statfs, 29 .statfs = simple_statfs,
30 .drop_inode = generic_delete_inode, 30 .drop_inode = generic_delete_inode,
31 .evict_inode = efivarfs_evict_inode, 31 .evict_inode = efivarfs_evict_inode,
32 .show_options = generic_show_options,
33}; 32};
34 33
35static struct super_block *efivarfs_sb; 34static struct super_block *efivarfs_sb;
diff --git a/fs/namespace.c b/fs/namespace.c
index 544ab84642eb..0e1fdb306133 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1237,65 +1237,6 @@ struct vfsmount *mnt_clone_internal(const struct path *path)
1237 return &p->mnt; 1237 return &p->mnt;
1238} 1238}
1239 1239
1240static inline void mangle(struct seq_file *m, const char *s)
1241{
1242 seq_escape(m, s, " \t\n\\");
1243}
1244
1245/*
1246 * Simple .show_options callback for filesystems which don't want to
1247 * implement more complex mount option showing.
1248 *
1249 * See also save_mount_options().
1250 */
1251int generic_show_options(struct seq_file *m, struct dentry *root)
1252{
1253 const char *options;
1254
1255 rcu_read_lock();
1256 options = rcu_dereference(root->d_sb->s_options);
1257
1258 if (options != NULL && options[0]) {
1259 seq_putc(m, ',');
1260 mangle(m, options);
1261 }
1262 rcu_read_unlock();
1263
1264 return 0;
1265}
1266EXPORT_SYMBOL(generic_show_options);
1267
1268/*
1269 * If filesystem uses generic_show_options(), this function should be
1270 * called from the fill_super() callback.
1271 *
1272 * The .remount_fs callback usually needs to be handled in a special
1273 * way, to make sure, that previous options are not overwritten if the
1274 * remount fails.
1275 *
1276 * Also note, that if the filesystem's .remount_fs function doesn't
1277 * reset all options to their default value, but changes only newly
1278 * given options, then the displayed options will not reflect reality
1279 * any more.
1280 */
1281void save_mount_options(struct super_block *sb, char *options)
1282{
1283 BUG_ON(sb->s_options);
1284 rcu_assign_pointer(sb->s_options, kstrdup(options, GFP_KERNEL));
1285}
1286EXPORT_SYMBOL(save_mount_options);
1287
1288void replace_mount_options(struct super_block *sb, char *options)
1289{
1290 char *old = sb->s_options;
1291 rcu_assign_pointer(sb->s_options, options);
1292 if (old) {
1293 synchronize_rcu();
1294 kfree(old);
1295 }
1296}
1297EXPORT_SYMBOL(replace_mount_options);
1298
1299#ifdef CONFIG_PROC_FS 1240#ifdef CONFIG_PROC_FS
1300/* iterator; we want it to have access to namespace_sem, thus here... */ 1241/* iterator; we want it to have access to namespace_sem, thus here... */
1301static void *m_start(struct seq_file *m, loff_t *pos) 1242static void *m_start(struct seq_file *m, loff_t *pos)
diff --git a/fs/super.c b/fs/super.c
index dfb56a9665d8..6bc3352adcf3 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -168,7 +168,6 @@ static void destroy_super(struct super_block *s)
168 WARN_ON(!list_empty(&s->s_mounts)); 168 WARN_ON(!list_empty(&s->s_mounts));
169 put_user_ns(s->s_user_ns); 169 put_user_ns(s->s_user_ns);
170 kfree(s->s_subtype); 170 kfree(s->s_subtype);
171 kfree(s->s_options);
172 call_rcu(&s->rcu, destroy_super_rcu); 171 call_rcu(&s->rcu, destroy_super_rcu);
173} 172}
174 173
diff --git a/include/linux/fs.h b/include/linux/fs.h
index bc0c054894b9..e265b2ea72c6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1351,11 +1351,6 @@ struct super_block {
1351 */ 1351 */
1352 char *s_subtype; 1352 char *s_subtype;
1353 1353
1354 /*
1355 * Saved mount options for lazy filesystems using
1356 * generic_show_options()
1357 */
1358 char __rcu *s_options;
1359 const struct dentry_operations *s_d_op; /* default d_op for dentries */ 1354 const struct dentry_operations *s_d_op; /* default d_op for dentries */
1360 1355
1361 /* 1356 /*
@@ -3033,10 +3028,6 @@ extern void setattr_copy(struct inode *inode, const struct iattr *attr);
3033 3028
3034extern int file_update_time(struct file *file); 3029extern int file_update_time(struct file *file);
3035 3030
3036extern int generic_show_options(struct seq_file *m, struct dentry *root);
3037extern void save_mount_options(struct super_block *sb, char *options);
3038extern void replace_mount_options(struct super_block *sb, char *options);
3039
3040static inline bool io_is_direct(struct file *filp) 3031static inline bool io_is_direct(struct file *filp)
3041{ 3032{
3042 return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host); 3033 return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host);