Skip to content

Commit 1d278a8

Browse files
dhowellsAl Viro
authored andcommitted
VFS: Kill off s_options and helpers
Kill off s_options, save/replace_mount_options() and generic_show_options() as all filesystems now implement ->show_options() for themselves. This should make it easier to implement a context-based mount where the mount options can be passed individually over a file descriptor. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 4dfdb71 commit 1d278a8

File tree

5 files changed

+0
-76
lines changed

5 files changed

+0
-76
lines changed

Documentation/filesystems/vfs.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,12 +1187,6 @@ The underlying reason for the above rules is to make sure, that a
11871187
mount can be accurately replicated (e.g. umounting and mounting again)
11881188
based on the information found in /proc/mounts.
11891189

1190-
A simple method of saving options at mount/remount time and showing
1191-
them is provided with the save_mount_options() and
1192-
generic_show_options() helper functions. Please note, that using
1193-
these may have drawbacks. For more info see header comments for these
1194-
functions in fs/namespace.c.
1195-
11961190
Resources
11971191
=========
11981192

fs/efivarfs/super.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ static const struct super_operations efivarfs_ops = {
2929
.statfs = simple_statfs,
3030
.drop_inode = generic_delete_inode,
3131
.evict_inode = efivarfs_evict_inode,
32-
.show_options = generic_show_options,
3332
};
3433

3534
static struct super_block *efivarfs_sb;

fs/namespace.c

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,65 +1237,6 @@ struct vfsmount *mnt_clone_internal(const struct path *path)
12371237
return &p->mnt;
12381238
}
12391239

1240-
static 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-
*/
1251-
int 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-
}
1266-
EXPORT_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-
*/
1281-
void 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-
}
1286-
EXPORT_SYMBOL(save_mount_options);
1287-
1288-
void 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-
}
1297-
EXPORT_SYMBOL(replace_mount_options);
1298-
12991240
#ifdef CONFIG_PROC_FS
13001241
/* iterator; we want it to have access to namespace_sem, thus here... */
13011242
static void *m_start(struct seq_file *m, loff_t *pos)

fs/super.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ static void destroy_super(struct super_block *s)
168168
WARN_ON(!list_empty(&s->s_mounts));
169169
put_user_ns(s->s_user_ns);
170170
kfree(s->s_subtype);
171-
kfree(s->s_options);
172171
call_rcu(&s->rcu, destroy_super_rcu);
173172
}
174173

include/linux/fs.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,11 +1351,6 @@ struct super_block {
13511351
*/
13521352
char *s_subtype;
13531353

1354-
/*
1355-
* Saved mount options for lazy filesystems using
1356-
* generic_show_options()
1357-
*/
1358-
char __rcu *s_options;
13591354
const struct dentry_operations *s_d_op; /* default d_op for dentries */
13601355

13611356
/*
@@ -3033,10 +3028,6 @@ extern void setattr_copy(struct inode *inode, const struct iattr *attr);
30333028

30343029
extern int file_update_time(struct file *file);
30353030

3036-
extern int generic_show_options(struct seq_file *m, struct dentry *root);
3037-
extern void save_mount_options(struct super_block *sb, char *options);
3038-
extern void replace_mount_options(struct super_block *sb, char *options);
3039-
30403031
static inline bool io_is_direct(struct file *filp)
30413032
{
30423033
return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host);

0 commit comments

Comments
 (0)