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