Commit 47206e01 authored by Ian Kent's avatar Ian Kent Committed by Linus Torvalds

autofs4: use autofs instead of autofs4 everywhere

Update naming within autofs source to be consistent by changing
occurrences of autofs4 to autofs.

Link: http://lkml.kernel.org/r/152626703688.28589.8315406711135226803.stgit@pluto.themaw.netSigned-off-by: default avatarIan Kent <raven@themaw.net>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ef8b42f7
......@@ -122,42 +122,42 @@ struct autofs_sb_info {
struct rcu_head rcu;
};
static inline struct autofs_sb_info *autofs4_sbi(struct super_block *sb)
static inline struct autofs_sb_info *autofs_sbi(struct super_block *sb)
{
return (struct autofs_sb_info *)(sb->s_fs_info);
}
static inline struct autofs_info *autofs4_dentry_ino(struct dentry *dentry)
static inline struct autofs_info *autofs_dentry_ino(struct dentry *dentry)
{
return (struct autofs_info *)(dentry->d_fsdata);
}
/* autofs4_oz_mode(): do we see the man behind the curtain? (The
/* autofs_oz_mode(): do we see the man behind the curtain? (The
* processes which do manipulations for us in user space sees the raw
* filesystem without "magic".)
*/
static inline int autofs4_oz_mode(struct autofs_sb_info *sbi)
static inline int autofs_oz_mode(struct autofs_sb_info *sbi)
{
return sbi->catatonic || task_pgrp(current) == sbi->oz_pgrp;
}
struct inode *autofs4_get_inode(struct super_block *, umode_t);
void autofs4_free_ino(struct autofs_info *);
struct inode *autofs_get_inode(struct super_block *, umode_t);
void autofs_free_ino(struct autofs_info *);
/* Expiration */
int is_autofs4_dentry(struct dentry *);
int autofs4_expire_wait(const struct path *path, int rcu_walk);
int autofs4_expire_run(struct super_block *, struct vfsmount *,
int is_autofs_dentry(struct dentry *);
int autofs_expire_wait(const struct path *path, int rcu_walk);
int autofs_expire_run(struct super_block *, struct vfsmount *,
struct autofs_sb_info *,
struct autofs_packet_expire __user *);
int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
int autofs_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
struct autofs_sb_info *sbi, int when);
int autofs4_expire_multi(struct super_block *, struct vfsmount *,
int autofs_expire_multi(struct super_block *, struct vfsmount *,
struct autofs_sb_info *, int __user *);
struct dentry *autofs4_expire_direct(struct super_block *sb,
struct dentry *autofs_expire_direct(struct super_block *sb,
struct vfsmount *mnt,
struct autofs_sb_info *sbi, int how);
struct dentry *autofs4_expire_indirect(struct super_block *sb,
struct dentry *autofs_expire_indirect(struct super_block *sb,
struct vfsmount *mnt,
struct autofs_sb_info *sbi, int how);
......@@ -168,11 +168,11 @@ void autofs_dev_ioctl_exit(void);
/* Operations structures */
extern const struct inode_operations autofs4_symlink_inode_operations;
extern const struct inode_operations autofs4_dir_inode_operations;
extern const struct file_operations autofs4_dir_operations;
extern const struct file_operations autofs4_root_operations;
extern const struct dentry_operations autofs4_dentry_operations;
extern const struct inode_operations autofs_symlink_inode_operations;
extern const struct inode_operations autofs_dir_inode_operations;
extern const struct file_operations autofs_dir_operations;
extern const struct file_operations autofs_root_operations;
extern const struct dentry_operations autofs_dentry_operations;
/* VFS automount flags management functions */
static inline void __managed_dentry_set_managed(struct dentry *dentry)
......@@ -201,9 +201,9 @@ static inline void managed_dentry_clear_managed(struct dentry *dentry)
/* Initializing function */
int autofs4_fill_super(struct super_block *, void *, int);
struct autofs_info *autofs4_new_ino(struct autofs_sb_info *);
void autofs4_clean_ino(struct autofs_info *);
int autofs_fill_super(struct super_block *, void *, int);
struct autofs_info *autofs_new_ino(struct autofs_sb_info *);
void autofs_clean_ino(struct autofs_info *);
static inline int autofs_prepare_pipe(struct file *pipe)
{
......@@ -218,25 +218,25 @@ static inline int autofs_prepare_pipe(struct file *pipe)
/* Queue management functions */
int autofs4_wait(struct autofs_sb_info *,
int autofs_wait(struct autofs_sb_info *,
const struct path *, enum autofs_notify);
int autofs4_wait_release(struct autofs_sb_info *, autofs_wqt_t, int);
void autofs4_catatonic_mode(struct autofs_sb_info *);
int autofs_wait_release(struct autofs_sb_info *, autofs_wqt_t, int);
void autofs_catatonic_mode(struct autofs_sb_info *);
static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi)
static inline u32 autofs_get_dev(struct autofs_sb_info *sbi)
{
return new_encode_dev(sbi->sb->s_dev);
}
static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi)
static inline u64 autofs_get_ino(struct autofs_sb_info *sbi)
{
return d_inode(sbi->sb->s_root)->i_ino;
}
static inline void __autofs4_add_expiring(struct dentry *dentry)
static inline void __autofs_add_expiring(struct dentry *dentry)
{
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
struct autofs_info *ino = autofs4_dentry_ino(dentry);
struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb);
struct autofs_info *ino = autofs_dentry_ino(dentry);
if (ino) {
if (list_empty(&ino->expiring))
......@@ -244,10 +244,10 @@ static inline void __autofs4_add_expiring(struct dentry *dentry)
}
}
static inline void autofs4_add_expiring(struct dentry *dentry)
static inline void autofs_add_expiring(struct dentry *dentry)
{
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
struct autofs_info *ino = autofs4_dentry_ino(dentry);
struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb);
struct autofs_info *ino = autofs_dentry_ino(dentry);
if (ino) {
spin_lock(&sbi->lookup_lock);
......@@ -257,10 +257,10 @@ static inline void autofs4_add_expiring(struct dentry *dentry)
}
}
static inline void autofs4_del_expiring(struct dentry *dentry)
static inline void autofs_del_expiring(struct dentry *dentry)
{
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
struct autofs_info *ino = autofs4_dentry_ino(dentry);
struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb);
struct autofs_info *ino = autofs_dentry_ino(dentry);
if (ino) {
spin_lock(&sbi->lookup_lock);
......@@ -270,4 +270,4 @@ static inline void autofs4_del_expiring(struct dentry *dentry)
}
}
void autofs4_kill_sb(struct super_block *);
void autofs_kill_sb(struct super_block *);
......@@ -166,7 +166,7 @@ static struct autofs_sb_info *autofs_dev_ioctl_sbi(struct file *f)
if (f) {
inode = file_inode(f);
sbi = autofs4_sbi(inode->i_sb);
sbi = autofs_sbi(inode->i_sb);
}
return sbi;
}
......@@ -236,7 +236,7 @@ static int test_by_dev(const struct path *path, void *p)
static int test_by_type(const struct path *path, void *p)
{
struct autofs_info *ino = autofs4_dentry_ino(path->dentry);
struct autofs_info *ino = autofs_dentry_ino(path->dentry);
return ino && ino->sbi->type & *(unsigned *)p;
}
......@@ -324,7 +324,7 @@ static int autofs_dev_ioctl_ready(struct file *fp,
autofs_wqt_t token;
token = (autofs_wqt_t) param->ready.token;
return autofs4_wait_release(sbi, token, 0);
return autofs_wait_release(sbi, token, 0);
}
/*
......@@ -340,7 +340,7 @@ static int autofs_dev_ioctl_fail(struct file *fp,
token = (autofs_wqt_t) param->fail.token;
status = param->fail.status < 0 ? param->fail.status : -ENOENT;
return autofs4_wait_release(sbi, token, status);
return autofs_wait_release(sbi, token, status);
}
/*
......@@ -412,7 +412,7 @@ static int autofs_dev_ioctl_catatonic(struct file *fp,
struct autofs_sb_info *sbi,
struct autofs_dev_ioctl *param)
{
autofs4_catatonic_mode(sbi);
autofs_catatonic_mode(sbi);
return 0;
}
......@@ -459,10 +459,10 @@ static int autofs_dev_ioctl_requester(struct file *fp,
if (err)
goto out;
ino = autofs4_dentry_ino(path.dentry);
ino = autofs_dentry_ino(path.dentry);
if (ino) {
err = 0;
autofs4_expire_wait(&path, 0);
autofs_expire_wait(&path, 0);
spin_lock(&sbi->fs_lock);
param->requester.uid =
from_kuid_munged(current_user_ns(), ino->uid);
......@@ -489,7 +489,7 @@ static int autofs_dev_ioctl_expire(struct file *fp,
how = param->expire.how;
mnt = fp->f_path.mnt;
return autofs4_do_expire_multi(sbi->sb, mnt, sbi, how);
return autofs_do_expire_multi(sbi->sb, mnt, sbi, how);
}
/* Check if autofs mount point is in use */
......@@ -686,7 +686,7 @@ static int _autofs_dev_ioctl(unsigned int command,
* Admin needs to be able to set the mount catatonic in
* order to be able to perform the re-open.
*/
if (!autofs4_oz_mode(sbi) &&
if (!autofs_oz_mode(sbi) &&
cmd != AUTOFS_DEV_IOCTL_CATATONIC_CMD) {
err = -EACCES;
fput(fp);
......
This diff is collapsed.
......@@ -13,18 +13,18 @@
static struct dentry *autofs_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
return mount_nodev(fs_type, flags, data, autofs4_fill_super);
return mount_nodev(fs_type, flags, data, autofs_fill_super);
}
static struct file_system_type autofs_fs_type = {
.owner = THIS_MODULE,
.name = "autofs",
.mount = autofs_mount,
.kill_sb = autofs4_kill_sb,
.kill_sb = autofs_kill_sb,
};
MODULE_ALIAS_FS("autofs");
static int __init init_autofs4_fs(void)
static int __init init_autofs_fs(void)
{
int err;
......@@ -37,12 +37,12 @@ static int __init init_autofs4_fs(void)
return err;
}
static void __exit exit_autofs4_fs(void)
static void __exit exit_autofs_fs(void)
{
autofs_dev_ioctl_exit();
unregister_filesystem(&autofs_fs_type);
}
module_init(init_autofs4_fs)
module_exit(exit_autofs4_fs)
module_init(init_autofs_fs)
module_exit(exit_autofs_fs)
MODULE_LICENSE("GPL");
......@@ -18,7 +18,7 @@
#include "autofs_i.h"
#include <linux/module.h>
struct autofs_info *autofs4_new_ino(struct autofs_sb_info *sbi)
struct autofs_info *autofs_new_ino(struct autofs_sb_info *sbi)
{
struct autofs_info *ino;
......@@ -32,21 +32,21 @@ struct autofs_info *autofs4_new_ino(struct autofs_sb_info *sbi)
return ino;
}
void autofs4_clean_ino(struct autofs_info *ino)
void autofs_clean_ino(struct autofs_info *ino)
{
ino->uid = GLOBAL_ROOT_UID;
ino->gid = GLOBAL_ROOT_GID;
ino->last_used = jiffies;
}
void autofs4_free_ino(struct autofs_info *ino)
void autofs_free_ino(struct autofs_info *ino)
{
kfree(ino);
}
void autofs4_kill_sb(struct super_block *sb)
void autofs_kill_sb(struct super_block *sb)
{
struct autofs_sb_info *sbi = autofs4_sbi(sb);
struct autofs_sb_info *sbi = autofs_sbi(sb);
/*
* In the event of a failure in get_sb_nodev the superblock
......@@ -56,7 +56,7 @@ void autofs4_kill_sb(struct super_block *sb)
*/
if (sbi) {
/* Free wait queues, close pipe */
autofs4_catatonic_mode(sbi);
autofs_catatonic_mode(sbi);
put_pid(sbi->oz_pgrp);
}
......@@ -66,9 +66,9 @@ void autofs4_kill_sb(struct super_block *sb)
kfree_rcu(sbi, rcu);
}
static int autofs4_show_options(struct seq_file *m, struct dentry *root)
static int autofs_show_options(struct seq_file *m, struct dentry *root)
{
struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb);
struct autofs_sb_info *sbi = autofs_sbi(root->d_sb);
struct inode *root_inode = d_inode(root->d_sb->s_root);
if (!sbi)
......@@ -101,16 +101,16 @@ static int autofs4_show_options(struct seq_file *m, struct dentry *root)
return 0;
}
static void autofs4_evict_inode(struct inode *inode)
static void autofs_evict_inode(struct inode *inode)
{
clear_inode(inode);
kfree(inode->i_private);
}
static const struct super_operations autofs4_sops = {
static const struct super_operations autofs_sops = {
.statfs = simple_statfs,
.show_options = autofs4_show_options,
.evict_inode = autofs4_evict_inode,
.show_options = autofs_show_options,
.evict_inode = autofs_evict_inode,
};
enum {Opt_err, Opt_fd, Opt_uid, Opt_gid, Opt_pgrp, Opt_minproto, Opt_maxproto,
......@@ -206,7 +206,7 @@ static int parse_options(char *options, int *pipefd, kuid_t *uid, kgid_t *gid,
return (*pipefd < 0);
}
int autofs4_fill_super(struct super_block *s, void *data, int silent)
int autofs_fill_super(struct super_block *s, void *data, int silent)
{
struct inode *root_inode;
struct dentry *root;
......@@ -246,19 +246,19 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
s->s_blocksize = 1024;
s->s_blocksize_bits = 10;
s->s_magic = AUTOFS_SUPER_MAGIC;
s->s_op = &autofs4_sops;
s->s_d_op = &autofs4_dentry_operations;
s->s_op = &autofs_sops;
s->s_d_op = &autofs_dentry_operations;
s->s_time_gran = 1;
/*
* Get the root inode and dentry, but defer checking for errors.
*/
ino = autofs4_new_ino(sbi);
ino = autofs_new_ino(sbi);
if (!ino) {
ret = -ENOMEM;
goto fail_free;
}
root_inode = autofs4_get_inode(s, S_IFDIR | 0755);
root_inode = autofs_get_inode(s, S_IFDIR | 0755);
root = d_make_root(root_inode);
if (!root)
goto fail_ino;
......@@ -305,8 +305,8 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
if (autofs_type_trigger(sbi->type))
__managed_dentry_set_managed(root);
root_inode->i_fop = &autofs4_root_operations;
root_inode->i_op = &autofs4_dir_inode_operations;
root_inode->i_fop = &autofs_root_operations;
root_inode->i_op = &autofs_dir_inode_operations;
pr_debug("pipe fd = %d, pgrp = %u\n", pipefd, pid_nr(sbi->oz_pgrp));
pipe = fget(pipefd);
......@@ -340,14 +340,14 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
dput(root);
goto fail_free;
fail_ino:
autofs4_free_ino(ino);
autofs_free_ino(ino);
fail_free:
kfree(sbi);
s->s_fs_info = NULL;
return ret;
}
struct inode *autofs4_get_inode(struct super_block *sb, umode_t mode)
struct inode *autofs_get_inode(struct super_block *sb, umode_t mode)
{
struct inode *inode = new_inode(sb);
......@@ -364,10 +364,10 @@ struct inode *autofs4_get_inode(struct super_block *sb, umode_t mode)
if (S_ISDIR(mode)) {
set_nlink(inode, 2);
inode->i_op = &autofs4_dir_inode_operations;
inode->i_fop = &autofs4_dir_operations;
inode->i_op = &autofs_dir_inode_operations;
inode->i_fop = &autofs_dir_operations;
} else if (S_ISLNK(mode)) {
inode->i_op = &autofs4_symlink_inode_operations;
inode->i_op = &autofs_symlink_inode_operations;
} else
WARN_ON(1);
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
#include "autofs_i.h"
static const char *autofs4_get_link(struct dentry *dentry,
static const char *autofs_get_link(struct dentry *dentry,
struct inode *inode,
struct delayed_call *done)
{
......@@ -17,13 +17,13 @@ static const char *autofs4_get_link(struct dentry *dentry,
if (!dentry)
return ERR_PTR(-ECHILD);
sbi = autofs4_sbi(dentry->d_sb);
ino = autofs4_dentry_ino(dentry);
if (ino && !autofs4_oz_mode(sbi))
sbi = autofs_sbi(dentry->d_sb);
ino = autofs_dentry_ino(dentry);
if (ino && !autofs_oz_mode(sbi))
ino->last_used = jiffies;
return d_inode(dentry)->i_private;
}
const struct inode_operations autofs4_symlink_inode_operations = {
.get_link = autofs4_get_link
const struct inode_operations autofs_symlink_inode_operations = {
.get_link = autofs_get_link
};
......@@ -17,9 +17,9 @@
/* We make this a static variable rather than a part of the superblock; it
* is better if we don't reassign numbers easily even across filesystems
*/
static autofs_wqt_t autofs4_next_wait_queue = 1;
static autofs_wqt_t autofs_next_wait_queue = 1;
void autofs4_catatonic_mode(struct autofs_sb_info *sbi)
void autofs_catatonic_mode(struct autofs_sb_info *sbi)
{
struct autofs_wait_queue *wq, *nwq;
......@@ -49,7 +49,7 @@ void autofs4_catatonic_mode(struct autofs_sb_info *sbi)
mutex_unlock(&sbi->wq_mutex);
}
static int autofs4_write(struct autofs_sb_info *sbi,
static int autofs_write(struct autofs_sb_info *sbi,
struct file *file, const void *addr, int bytes)
{
unsigned long sigpipe, flags;
......@@ -82,7 +82,7 @@ static int autofs4_write(struct autofs_sb_info *sbi,
return bytes == 0 ? 0 : wr < 0 ? wr : -EIO;
}
static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
static void autofs_notify_daemon(struct autofs_sb_info *sbi,
struct autofs_wait_queue *wq,
int type)
{
......@@ -167,22 +167,22 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
mutex_unlock(&sbi->wq_mutex);
switch (ret = autofs4_write(sbi, pipe, &pkt, pktsz)) {
switch (ret = autofs_write(sbi, pipe, &pkt, pktsz)) {
case 0:
break;
case -ENOMEM:
case -ERESTARTSYS:
/* Just fail this one */
autofs4_wait_release(sbi, wq->wait_queue_token, ret);
autofs_wait_release(sbi, wq->wait_queue_token, ret);
break;
default:
autofs4_catatonic_mode(sbi);
autofs_catatonic_mode(sbi);
break;
}
fput(pipe);
}
static int autofs4_getpath(struct autofs_sb_info *sbi,
static int autofs_getpath(struct autofs_sb_info *sbi,
struct dentry *dentry, char **name)
{
struct dentry *root = sbi->sb->s_root;
......@@ -228,7 +228,7 @@ static int autofs4_getpath(struct autofs_sb_info *sbi,
}
static struct autofs_wait_queue *
autofs4_find_wait(struct autofs_sb_info *sbi, const struct qstr *qstr)
autofs_find_wait(struct autofs_sb_info *sbi, const struct qstr *qstr)
{
struct autofs_wait_queue *wq;
......@@ -263,7 +263,7 @@ static int validate_request(struct autofs_wait_queue **wait,
return -ENOENT;
/* Wait in progress, continue; */
wq = autofs4_find_wait(sbi, qstr);
wq = autofs_find_wait(sbi, qstr);
if (wq) {
*wait = wq;
return 1;
......@@ -272,7 +272,7 @@ static int validate_request(struct autofs_wait_queue **wait,
*wait = NULL;
/* If we don't yet have any info this is a new request */
ino = autofs4_dentry_ino(dentry);
ino = autofs_dentry_ino(dentry);
if (!ino)
return 1;
......@@ -297,7 +297,7 @@ static int validate_request(struct autofs_wait_queue **wait,
if (sbi->catatonic)
return -ENOENT;
wq = autofs4_find_wait(sbi, qstr);
wq = autofs_find_wait(sbi, qstr);
if (wq) {
*wait = wq;
return 1;
......@@ -351,7 +351,7 @@ static int validate_request(struct autofs_wait_queue **wait,
return 1;
}
int autofs4_wait(struct autofs_sb_info *sbi,
int autofs_wait(struct autofs_sb_info *sbi,
const struct path *path, enum autofs_notify notify)
{
struct dentry *dentry = path->dentry;
......@@ -399,7 +399,7 @@ int autofs4_wait(struct autofs_sb_info *sbi,
if (IS_ROOT(dentry) && autofs_type_trigger(sbi->type))
qstr.len = sprintf(name, "%p", dentry);
else {
qstr.len = autofs4_getpath(sbi, dentry, &name);
qstr.len = autofs_getpath(sbi, dentry, &name);
if (!qstr.len) {
kfree(name);
return -ENOENT;
......@@ -430,15 +430,15 @@ int autofs4_wait(struct autofs_sb_info *sbi,
return -ENOMEM;
}
wq->wait_queue_token = autofs4_next_wait_queue;
if (++autofs4_next_wait_queue == 0)
autofs4_next_wait_queue = 1;
wq->wait_queue_token = autofs_next_wait_queue;
if (++autofs_next_wait_queue == 0)
autofs_next_wait_queue = 1;
wq->next = sbi->queues;
sbi->queues = wq;
init_waitqueue_head(&wq->queue);
memcpy(&wq->name, &qstr, sizeof(struct qstr));
wq->dev = autofs4_get_dev(sbi);
wq->ino = autofs4_get_ino(sbi);
wq->dev = autofs_get_dev(sbi);
wq->ino = autofs_get_ino(sbi);
wq->uid = current_uid();
wq->gid = current_gid();
wq->pid = pid;
......@@ -467,9 +467,9 @@ int autofs4_wait(struct autofs_sb_info *sbi,
wq->name.name, notify);
/*
* autofs4_notify_daemon() may block; it will unlock ->wq_mutex
* autofs_notify_daemon() may block; it will unlock ->wq_mutex
*/
autofs4_notify_daemon(sbi, wq, type);
autofs_notify_daemon(sbi, wq, type);
} else {
wq->wait_ctr++;
pr_debug("existing wait id = 0x%08lx, name = %.*s, nfy=%d\n",
......@@ -500,12 +500,12 @@ int autofs4_wait(struct autofs_sb_info *sbi,
struct dentry *de = NULL;
/* direct mount or browsable map */
ino = autofs4_dentry_ino(dentry);
ino = autofs_dentry_ino(dentry);
if (!ino) {
/* If not lookup actual dentry used */
de = d_lookup(dentry->d_parent, &dentry->d_name);
if (de)
ino = autofs4_dentry_ino(de);
ino = autofs_dentry_ino(de);
}
/* Set mount requester */
......@@ -530,7 +530,8 @@ int autofs4_wait(struct autofs_sb_info *sbi,
}
int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_token, int status)
int autofs_wait_release(struct autofs_sb_info *sbi,
autofs_wqt_t wait_queue_token, int status)
{
struct autofs_wait_queue *wq, **wql;
......
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