Commit e9a7c2f1 authored by Ian Kent's avatar Ian Kent Committed by Linus Torvalds

autofs4: coding style fixes

Try and make the coding style completely consistent throughtout the
autofs module and inline with kernel coding style recommendations.
Signed-off-by: default avatarIan Kent <raven@themaw.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c83aa55d
/* -*- c -*- ------------------------------------------------------------- * /*
* * Copyright 1997-1998 Transmeta Corporation - All Rights Reserved
* linux/fs/autofs/autofs_i.h * Copyright 2005-2006 Ian Kent <raven@themaw.net>
*
* Copyright 1997-1998 Transmeta Corporation - All Rights Reserved
* Copyright 2005-2006 Ian Kent <raven@themaw.net>
* *
* This file is part of the Linux kernel and is made available under * This file is part of the Linux kernel and is made available under
* the terms of the GNU General Public License, version 2, or at your * the terms of the GNU General Public License, version 2, or at your
* option, any later version, incorporated herein by reference. * option, any later version, incorporated herein by reference.
* */
* ----------------------------------------------------------------------- */
/* Internal header file for autofs */ /* Internal header file for autofs */
...@@ -35,7 +31,7 @@ ...@@ -35,7 +31,7 @@
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/namei.h> #include <linux/namei.h>
#include <asm/current.h> #include <asm/current.h>
#include <asm/uaccess.h> #include <linux/uaccess.h>
/* #define DEBUG */ /* #define DEBUG */
...@@ -51,12 +47,14 @@ ...@@ -51,12 +47,14 @@
printk(KERN_ERR "pid %d: %s: " fmt "\n", \ printk(KERN_ERR "pid %d: %s: " fmt "\n", \
current->pid, __func__, ##__VA_ARGS__) current->pid, __func__, ##__VA_ARGS__)
/* Unified info structure. This is pointed to by both the dentry and /*
inode structures. Each file in the filesystem has an instance of this * Unified info structure. This is pointed to by both the dentry and
structure. It holds a reference to the dentry, so dentries are never * inode structures. Each file in the filesystem has an instance of this
flushed while the file exists. All name lookups are dealt with at the * structure. It holds a reference to the dentry, so dentries are never
dentry level, although the filesystem can interfere in the validation * flushed while the file exists. All name lookups are dealt with at the
process. Readdir is implemented by traversing the dentry lists. */ * dentry level, although the filesystem can interfere in the validation
* process. Readdir is implemented by traversing the dentry lists.
*/
struct autofs_info { struct autofs_info {
struct dentry *dentry; struct dentry *dentry;
struct inode *inode; struct inode *inode;
...@@ -78,7 +76,7 @@ struct autofs_info { ...@@ -78,7 +76,7 @@ struct autofs_info {
kgid_t gid; kgid_t gid;
}; };
#define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */ #define AUTOFS_INF_EXPIRING (1<<0) /* dentry in the process of expiring */
#define AUTOFS_INF_NO_RCU (1<<1) /* the dentry is being considered #define AUTOFS_INF_NO_RCU (1<<1) /* the dentry is being considered
* for expiry, so RCU_walk is * for expiry, so RCU_walk is
* not permitted * not permitted
...@@ -140,10 +138,11 @@ static inline struct autofs_info *autofs4_dentry_ino(struct dentry *dentry) ...@@ -140,10 +138,11 @@ static inline struct autofs_info *autofs4_dentry_ino(struct dentry *dentry)
} }
/* autofs4_oz_mode(): do we see the man behind the curtain? (The /* autofs4_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 autofs4_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;
} }
...@@ -154,12 +153,12 @@ void autofs4_free_ino(struct autofs_info *); ...@@ -154,12 +153,12 @@ void autofs4_free_ino(struct autofs_info *);
int is_autofs4_dentry(struct dentry *); int is_autofs4_dentry(struct dentry *);
int autofs4_expire_wait(struct dentry *dentry, int rcu_walk); int autofs4_expire_wait(struct dentry *dentry, int rcu_walk);
int autofs4_expire_run(struct super_block *, struct vfsmount *, int autofs4_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 autofs4_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 autofs4_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 *autofs4_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);
...@@ -224,8 +223,8 @@ static inline int autofs_prepare_pipe(struct file *pipe) ...@@ -224,8 +223,8 @@ static inline int autofs_prepare_pipe(struct file *pipe)
/* Queue management functions */ /* Queue management functions */
int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify); int autofs4_wait(struct autofs_sb_info *, struct dentry *, enum autofs_notify);
int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int); int autofs4_wait_release(struct autofs_sb_info *, autofs_wqt_t, int);
void autofs4_catatonic_mode(struct autofs_sb_info *); void autofs4_catatonic_mode(struct autofs_sb_info *);
static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi) static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi)
...@@ -242,37 +241,37 @@ static inline void __autofs4_add_expiring(struct dentry *dentry) ...@@ -242,37 +241,37 @@ static inline void __autofs4_add_expiring(struct dentry *dentry)
{ {
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
struct autofs_info *ino = autofs4_dentry_ino(dentry); struct autofs_info *ino = autofs4_dentry_ino(dentry);
if (ino) { if (ino) {
if (list_empty(&ino->expiring)) if (list_empty(&ino->expiring))
list_add(&ino->expiring, &sbi->expiring_list); list_add(&ino->expiring, &sbi->expiring_list);
} }
return;
} }
static inline void autofs4_add_expiring(struct dentry *dentry) static inline void autofs4_add_expiring(struct dentry *dentry)
{ {
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
struct autofs_info *ino = autofs4_dentry_ino(dentry); struct autofs_info *ino = autofs4_dentry_ino(dentry);
if (ino) { if (ino) {
spin_lock(&sbi->lookup_lock); spin_lock(&sbi->lookup_lock);
if (list_empty(&ino->expiring)) if (list_empty(&ino->expiring))
list_add(&ino->expiring, &sbi->expiring_list); list_add(&ino->expiring, &sbi->expiring_list);
spin_unlock(&sbi->lookup_lock); spin_unlock(&sbi->lookup_lock);
} }
return;
} }
static inline void autofs4_del_expiring(struct dentry *dentry) static inline void autofs4_del_expiring(struct dentry *dentry)
{ {
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
struct autofs_info *ino = autofs4_dentry_ino(dentry); struct autofs_info *ino = autofs4_dentry_ino(dentry);
if (ino) { if (ino) {
spin_lock(&sbi->lookup_lock); spin_lock(&sbi->lookup_lock);
if (!list_empty(&ino->expiring)) if (!list_empty(&ino->expiring))
list_del_init(&ino->expiring); list_del_init(&ino->expiring);
spin_unlock(&sbi->lookup_lock); spin_unlock(&sbi->lookup_lock);
} }
return;
} }
extern void autofs4_kill_sb(struct super_block *); extern void autofs4_kill_sb(struct super_block *);
...@@ -72,8 +72,8 @@ static int check_dev_ioctl_version(int cmd, struct autofs_dev_ioctl *param) ...@@ -72,8 +72,8 @@ static int check_dev_ioctl_version(int cmd, struct autofs_dev_ioctl *param)
{ {
int err = 0; int err = 0;
if ((AUTOFS_DEV_IOCTL_VERSION_MAJOR != param->ver_major) || if ((param->ver_major != AUTOFS_DEV_IOCTL_VERSION_MAJOR) ||
(AUTOFS_DEV_IOCTL_VERSION_MINOR < param->ver_minor)) { (param->ver_minor > AUTOFS_DEV_IOCTL_VERSION_MINOR)) {
AUTOFS_WARN("ioctl control interface version mismatch: " AUTOFS_WARN("ioctl control interface version mismatch: "
"kernel(%u.%u), user(%u.%u), cmd(%d)", "kernel(%u.%u), user(%u.%u), cmd(%d)",
AUTOFS_DEV_IOCTL_VERSION_MAJOR, AUTOFS_DEV_IOCTL_VERSION_MAJOR,
...@@ -93,7 +93,8 @@ static int check_dev_ioctl_version(int cmd, struct autofs_dev_ioctl *param) ...@@ -93,7 +93,8 @@ static int check_dev_ioctl_version(int cmd, struct autofs_dev_ioctl *param)
* Copy parameter control struct, including a possible path allocated * Copy parameter control struct, including a possible path allocated
* at the end of the struct. * at the end of the struct.
*/ */
static struct autofs_dev_ioctl *copy_dev_ioctl(struct autofs_dev_ioctl __user *in) static struct autofs_dev_ioctl *
copy_dev_ioctl(struct autofs_dev_ioctl __user *in)
{ {
struct autofs_dev_ioctl tmp, *res; struct autofs_dev_ioctl tmp, *res;
...@@ -116,7 +117,6 @@ static struct autofs_dev_ioctl *copy_dev_ioctl(struct autofs_dev_ioctl __user *i ...@@ -116,7 +117,6 @@ static struct autofs_dev_ioctl *copy_dev_ioctl(struct autofs_dev_ioctl __user *i
static inline void free_dev_ioctl(struct autofs_dev_ioctl *param) static inline void free_dev_ioctl(struct autofs_dev_ioctl *param)
{ {
kfree(param); kfree(param);
return;
} }
/* /*
...@@ -197,7 +197,9 @@ static int find_autofs_mount(const char *pathname, ...@@ -197,7 +197,9 @@ static int find_autofs_mount(const char *pathname,
void *data) void *data)
{ {
struct path path; struct path path;
int err = kern_path_mountpoint(AT_FDCWD, pathname, &path, 0); int err;
err = kern_path_mountpoint(AT_FDCWD, pathname, &path, 0);
if (err) if (err)
return err; return err;
err = -ENOENT; err = -ENOENT;
...@@ -225,6 +227,7 @@ static int test_by_dev(struct path *path, void *p) ...@@ -225,6 +227,7 @@ static int test_by_dev(struct path *path, void *p)
static int test_by_type(struct path *path, void *p) static int test_by_type(struct path *path, void *p)
{ {
struct autofs_info *ino = autofs4_dentry_ino(path->dentry); struct autofs_info *ino = autofs4_dentry_ino(path->dentry);
return ino && ino->sbi->type & *(unsigned *)p; return ino && ino->sbi->type & *(unsigned *)p;
} }
...@@ -456,8 +459,10 @@ static int autofs_dev_ioctl_requester(struct file *fp, ...@@ -456,8 +459,10 @@ static int autofs_dev_ioctl_requester(struct file *fp,
err = 0; err = 0;
autofs4_expire_wait(path.dentry, 0); autofs4_expire_wait(path.dentry, 0);
spin_lock(&sbi->fs_lock); spin_lock(&sbi->fs_lock);
param->requester.uid = from_kuid_munged(current_user_ns(), ino->uid); param->requester.uid =
param->requester.gid = from_kgid_munged(current_user_ns(), ino->gid); from_kuid_munged(current_user_ns(), ino->uid);
param->requester.gid =
from_kgid_munged(current_user_ns(), ino->gid);
spin_unlock(&sbi->fs_lock); spin_unlock(&sbi->fs_lock);
} }
path_put(&path); path_put(&path);
...@@ -619,7 +624,8 @@ static ioctl_fn lookup_dev_ioctl(unsigned int cmd) ...@@ -619,7 +624,8 @@ static ioctl_fn lookup_dev_ioctl(unsigned int cmd)
} }
/* ioctl dispatcher */ /* ioctl dispatcher */
static int _autofs_dev_ioctl(unsigned int command, struct autofs_dev_ioctl __user *user) static int _autofs_dev_ioctl(unsigned int command,
struct autofs_dev_ioctl __user *user)
{ {
struct autofs_dev_ioctl *param; struct autofs_dev_ioctl *param;
struct file *fp; struct file *fp;
...@@ -711,6 +717,7 @@ static int _autofs_dev_ioctl(unsigned int command, struct autofs_dev_ioctl __use ...@@ -711,6 +717,7 @@ static int _autofs_dev_ioctl(unsigned int command, struct autofs_dev_ioctl __use
static long autofs_dev_ioctl(struct file *file, uint command, ulong u) static long autofs_dev_ioctl(struct file *file, uint command, ulong u)
{ {
int err; int err;
err = _autofs_dev_ioctl(command, (struct autofs_dev_ioctl __user *) u); err = _autofs_dev_ioctl(command, (struct autofs_dev_ioctl __user *) u);
return (long) err; return (long) err;
} }
...@@ -733,8 +740,8 @@ static const struct file_operations _dev_ioctl_fops = { ...@@ -733,8 +740,8 @@ static const struct file_operations _dev_ioctl_fops = {
static struct miscdevice _autofs_dev_ioctl_misc = { static struct miscdevice _autofs_dev_ioctl_misc = {
.minor = AUTOFS_MINOR, .minor = AUTOFS_MINOR,
.name = AUTOFS_DEVICE_NAME, .name = AUTOFS_DEVICE_NAME,
.fops = &_dev_ioctl_fops .fops = &_dev_ioctl_fops
}; };
MODULE_ALIAS_MISCDEV(AUTOFS_MINOR); MODULE_ALIAS_MISCDEV(AUTOFS_MINOR);
...@@ -757,6 +764,5 @@ int __init autofs_dev_ioctl_init(void) ...@@ -757,6 +764,5 @@ int __init autofs_dev_ioctl_init(void)
void autofs_dev_ioctl_exit(void) void autofs_dev_ioctl_exit(void)
{ {
misc_deregister(&_autofs_dev_ioctl_misc); misc_deregister(&_autofs_dev_ioctl_misc);
return;
} }
/* -*- c -*- --------------------------------------------------------------- * /*
* * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* linux/fs/autofs/expire.c * Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
* * Copyright 2001-2006 Ian Kent <raven@themaw.net>
* Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
* Copyright 2001-2006 Ian Kent <raven@themaw.net>
* *
* This file is part of the Linux kernel and is made available under * This file is part of the Linux kernel and is made available under
* the terms of the GNU General Public License, version 2, or at your * the terms of the GNU General Public License, version 2, or at your
* option, any later version, incorporated herein by reference. * option, any later version, incorporated herein by reference.
* */
* ------------------------------------------------------------------------- */
#include "autofs_i.h" #include "autofs_i.h"
...@@ -18,7 +14,7 @@ static unsigned long now; ...@@ -18,7 +14,7 @@ static unsigned long now;
/* Check if a dentry can be expired */ /* Check if a dentry can be expired */
static inline int autofs4_can_expire(struct dentry *dentry, static inline int autofs4_can_expire(struct dentry *dentry,
unsigned long timeout, int do_now) unsigned long timeout, int do_now)
{ {
struct autofs_info *ino = autofs4_dentry_ino(dentry); struct autofs_info *ino = autofs4_dentry_ino(dentry);
...@@ -58,7 +54,9 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry) ...@@ -58,7 +54,9 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
/* Update the expiry counter if fs is busy */ /* Update the expiry counter if fs is busy */
if (!may_umount_tree(path.mnt)) { if (!may_umount_tree(path.mnt)) {
struct autofs_info *ino = autofs4_dentry_ino(top); struct autofs_info *ino;
ino = autofs4_dentry_ino(top);
ino->last_used = jiffies; ino->last_used = jiffies;
goto done; goto done;
} }
...@@ -74,7 +72,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry) ...@@ -74,7 +72,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
* Calculate and dget next entry in the subdirs list under root. * Calculate and dget next entry in the subdirs list under root.
*/ */
static struct dentry *get_next_positive_subdir(struct dentry *prev, static struct dentry *get_next_positive_subdir(struct dentry *prev,
struct dentry *root) struct dentry *root)
{ {
struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb); struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb);
struct list_head *next; struct list_head *next;
...@@ -121,7 +119,7 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev, ...@@ -121,7 +119,7 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev,
* Calculate and dget next entry in top down tree traversal. * Calculate and dget next entry in top down tree traversal.
*/ */
static struct dentry *get_next_positive_dentry(struct dentry *prev, static struct dentry *get_next_positive_dentry(struct dentry *prev,
struct dentry *root) struct dentry *root)
{ {
struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb); struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb);
struct list_head *next; struct list_head *next;
...@@ -187,15 +185,17 @@ static struct dentry *get_next_positive_dentry(struct dentry *prev, ...@@ -187,15 +185,17 @@ static struct dentry *get_next_positive_dentry(struct dentry *prev,
* autofs submounts. * autofs submounts.
*/ */
static int autofs4_direct_busy(struct vfsmount *mnt, static int autofs4_direct_busy(struct vfsmount *mnt,
struct dentry *top, struct dentry *top,
unsigned long timeout, unsigned long timeout,
int do_now) int do_now)
{ {
DPRINTK("top %p %pd", top, top); DPRINTK("top %p %pd", top, top);
/* If it's busy update the expiry counters */ /* If it's busy update the expiry counters */
if (!may_umount_tree(mnt)) { if (!may_umount_tree(mnt)) {
struct autofs_info *ino = autofs4_dentry_ino(top); struct autofs_info *ino;
ino = autofs4_dentry_ino(top);
if (ino) if (ino)
ino->last_used = jiffies; ino->last_used = jiffies;
return 1; return 1;
...@@ -208,7 +208,8 @@ static int autofs4_direct_busy(struct vfsmount *mnt, ...@@ -208,7 +208,8 @@ static int autofs4_direct_busy(struct vfsmount *mnt,
return 0; return 0;
} }
/* Check a directory tree of mount points for busyness /*
* Check a directory tree of mount points for busyness
* The tree is not busy iff no mountpoints are busy * The tree is not busy iff no mountpoints are busy
*/ */
static int autofs4_tree_busy(struct vfsmount *mnt, static int autofs4_tree_busy(struct vfsmount *mnt,
...@@ -404,6 +405,7 @@ static struct dentry *should_expire(struct dentry *dentry, ...@@ -404,6 +405,7 @@ static struct dentry *should_expire(struct dentry *dentry,
} else { } else {
/* Path walk currently on this dentry? */ /* Path walk currently on this dentry? */
struct dentry *expired; struct dentry *expired;
ino_count = atomic_read(&ino->count) + 1; ino_count = atomic_read(&ino->count) + 1;
if (d_count(dentry) > ino_count) if (d_count(dentry) > ino_count)
return NULL; return NULL;
...@@ -522,21 +524,22 @@ int autofs4_expire_wait(struct dentry *dentry, int rcu_walk) ...@@ -522,21 +524,22 @@ int autofs4_expire_wait(struct dentry *dentry, int rcu_walk)
/* Perform an expiry operation */ /* Perform an expiry operation */
int autofs4_expire_run(struct super_block *sb, int autofs4_expire_run(struct super_block *sb,
struct vfsmount *mnt, struct vfsmount *mnt,
struct autofs_sb_info *sbi, struct autofs_sb_info *sbi,
struct autofs_packet_expire __user *pkt_p) struct autofs_packet_expire __user *pkt_p)
{ {
struct autofs_packet_expire pkt; struct autofs_packet_expire pkt;
struct autofs_info *ino; struct autofs_info *ino;
struct dentry *dentry; struct dentry *dentry;
int ret = 0; int ret = 0;
memset(&pkt,0,sizeof pkt); memset(&pkt, 0, sizeof(pkt));
pkt.hdr.proto_version = sbi->version; pkt.hdr.proto_version = sbi->version;
pkt.hdr.type = autofs_ptype_expire; pkt.hdr.type = autofs_ptype_expire;
if ((dentry = autofs4_expire_indirect(sb, mnt, sbi, 0)) == NULL) dentry = autofs4_expire_indirect(sb, mnt, sbi, 0);
if (!dentry)
return -EAGAIN; return -EAGAIN;
pkt.len = dentry->d_name.len; pkt.len = dentry->d_name.len;
...@@ -544,7 +547,7 @@ int autofs4_expire_run(struct super_block *sb, ...@@ -544,7 +547,7 @@ int autofs4_expire_run(struct super_block *sb,
pkt.name[pkt.len] = '\0'; pkt.name[pkt.len] = '\0';
dput(dentry); dput(dentry);
if ( copy_to_user(pkt_p, &pkt, sizeof(struct autofs_packet_expire)) ) if (copy_to_user(pkt_p, &pkt, sizeof(struct autofs_packet_expire)))
ret = -EFAULT; ret = -EFAULT;
spin_lock(&sbi->fs_lock); spin_lock(&sbi->fs_lock);
...@@ -573,7 +576,8 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt, ...@@ -573,7 +576,8 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
struct autofs_info *ino = autofs4_dentry_ino(dentry); struct autofs_info *ino = autofs4_dentry_ino(dentry);
/* This is synchronous because it makes the daemon a /* This is synchronous because it makes the daemon a
little easier */ * little easier
*/
ret = autofs4_wait(sbi, dentry, NFY_EXPIRE); ret = autofs4_wait(sbi, dentry, NFY_EXPIRE);
spin_lock(&sbi->fs_lock); spin_lock(&sbi->fs_lock);
...@@ -588,8 +592,10 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt, ...@@ -588,8 +592,10 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
return ret; return ret;
} }
/* Call repeatedly until it returns -EAGAIN, meaning there's nothing /*
more to be done */ * Call repeatedly until it returns -EAGAIN, meaning there's nothing
* more to be done.
*/
int autofs4_expire_multi(struct super_block *sb, struct vfsmount *mnt, int autofs4_expire_multi(struct super_block *sb, struct vfsmount *mnt,
struct autofs_sb_info *sbi, int __user *arg) struct autofs_sb_info *sbi, int __user *arg)
{ {
......
/* -*- c -*- --------------------------------------------------------------- * /*
* * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* linux/fs/autofs/init.c
*
* Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* *
* This file is part of the Linux kernel and is made available under * This file is part of the Linux kernel and is made available under
* the terms of the GNU General Public License, version 2, or at your * the terms of the GNU General Public License, version 2, or at your
* option, any later version, incorporated herein by reference. * option, any later version, incorporated herein by reference.
* */
* ------------------------------------------------------------------------- */
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
......
/* -*- c -*- --------------------------------------------------------------- * /*
* * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* linux/fs/autofs/inode.c * Copyright 2005-2006 Ian Kent <raven@themaw.net>
*
* Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* Copyright 2005-2006 Ian Kent <raven@themaw.net>
* *
* This file is part of the Linux kernel and is made available under * This file is part of the Linux kernel and is made available under
* the terms of the GNU General Public License, version 2, or at your * the terms of the GNU General Public License, version 2, or at your
* option, any later version, incorporated herein by reference. * option, any later version, incorporated herein by reference.
* */
* ------------------------------------------------------------------------- */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -24,7 +20,9 @@ ...@@ -24,7 +20,9 @@
struct autofs_info *autofs4_new_ino(struct autofs_sb_info *sbi) struct autofs_info *autofs4_new_ino(struct autofs_sb_info *sbi)
{ {
struct autofs_info *ino = kzalloc(sizeof(*ino), GFP_KERNEL); struct autofs_info *ino;
ino = kzalloc(sizeof(*ino), GFP_KERNEL);
if (ino) { if (ino) {
INIT_LIST_HEAD(&ino->active); INIT_LIST_HEAD(&ino->active);
INIT_LIST_HEAD(&ino->expiring); INIT_LIST_HEAD(&ino->expiring);
...@@ -152,6 +150,7 @@ static int parse_options(char *options, int *pipefd, kuid_t *uid, kgid_t *gid, ...@@ -152,6 +150,7 @@ static int parse_options(char *options, int *pipefd, kuid_t *uid, kgid_t *gid,
while ((p = strsep(&options, ",")) != NULL) { while ((p = strsep(&options, ",")) != NULL) {
int token; int token;
if (!*p) if (!*p)
continue; continue;
...@@ -209,9 +208,9 @@ static int parse_options(char *options, int *pipefd, kuid_t *uid, kgid_t *gid, ...@@ -209,9 +208,9 @@ static int parse_options(char *options, int *pipefd, kuid_t *uid, kgid_t *gid,
int autofs4_fill_super(struct super_block *s, void *data, int silent) int autofs4_fill_super(struct super_block *s, void *data, int silent)
{ {
struct inode * root_inode; struct inode *root_inode;
struct dentry * root; struct dentry *root;
struct file * pipe; struct file *pipe;
int pipefd; int pipefd;
struct autofs_sb_info *sbi; struct autofs_sb_info *sbi;
struct autofs_info *ino; struct autofs_info *ino;
...@@ -222,7 +221,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) ...@@ -222,7 +221,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
if (!sbi) if (!sbi)
return -ENOMEM; return -ENOMEM;
DPRINTK("starting up, sbi = %p",sbi); DPRINTK("starting up, sbi = %p", sbi);
s->s_fs_info = sbi; s->s_fs_info = sbi;
sbi->magic = AUTOFS_SBI_MAGIC; sbi->magic = AUTOFS_SBI_MAGIC;
......
This diff is collapsed.
/* -*- c -*- --------------------------------------------------------------- * /*
* * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* linux/fs/autofs/symlink.c
*
* Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* *
* This file is part of the Linux kernel and is made available under * This file is part of the Linux kernel and is made available under
* the terms of the GNU General Public License, version 2, or at your * the terms of the GNU General Public License, version 2, or at your
* option, any later version, incorporated herein by reference. * option, any later version, incorporated herein by reference.
* */
* ------------------------------------------------------------------------- */
#include "autofs_i.h" #include "autofs_i.h"
...@@ -18,6 +14,7 @@ static const char *autofs4_get_link(struct dentry *dentry, ...@@ -18,6 +14,7 @@ static const char *autofs4_get_link(struct dentry *dentry,
{ {
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 = autofs4_sbi(dentry->d_sb);
......
/* -*- c -*- --------------------------------------------------------------- * /*
* * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* linux/fs/autofs/waitq.c * Copyright 2001-2006 Ian Kent <raven@themaw.net>
*
* Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
* Copyright 2001-2006 Ian Kent <raven@themaw.net>
* *
* This file is part of the Linux kernel and is made available under * This file is part of the Linux kernel and is made available under
* the terms of the GNU General Public License, version 2, or at your * the terms of the GNU General Public License, version 2, or at your
* option, any later version, incorporated herein by reference. * option, any later version, incorporated herein by reference.
* */
* ------------------------------------------------------------------------- */
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/time.h> #include <linux/time.h>
...@@ -18,7 +14,8 @@ ...@@ -18,7 +14,8 @@
#include "autofs_i.h" #include "autofs_i.h"
/* 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 autofs4_next_wait_queue = 1;
/* These are the signals we allow interrupting a pending mount */ /* These are the signals we allow interrupting a pending mount */
...@@ -69,17 +66,19 @@ static int autofs4_write(struct autofs_sb_info *sbi, ...@@ -69,17 +66,19 @@ static int autofs4_write(struct autofs_sb_info *sbi,
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
mutex_lock(&sbi->pipe_mutex); mutex_lock(&sbi->pipe_mutex);
while (bytes && wr = __vfs_write(file, data, bytes, &file->f_pos);
(wr = __vfs_write(file,data,bytes,&file->f_pos)) > 0) { while (bytes && wr) {
data += wr;