Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139222
b: refs/heads/master
c: 56fcef7
h: refs/heads/master
v: v3
  • Loading branch information
Ian Kent authored and Linus Torvalds committed Apr 1, 2009
1 parent d62d698 commit ea4eb0b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 00fcf2cb6f6bb421851c3ba062c0a36760ea6e53
refs/heads/master: 56fcef75117a153f298b3fe54af31053f53997dd
2 changes: 2 additions & 0 deletions trunk/fs/autofs4/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ int autofs4_expire_wait(struct dentry *dentry);
int autofs4_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,
struct autofs_sb_info *sbi, int when);
int autofs4_expire_multi(struct super_block *, struct vfsmount *,
struct autofs_sb_info *, int __user *);
struct dentry *autofs4_expire_direct(struct super_block *sb,
Expand Down
29 changes: 1 addition & 28 deletions trunk/fs/autofs4/dev-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,40 +525,13 @@ static int autofs_dev_ioctl_expire(struct file *fp,
struct autofs_sb_info *sbi,
struct autofs_dev_ioctl *param)
{
struct dentry *dentry;
struct vfsmount *mnt;
int err = -EAGAIN;
int how;

how = param->expire.how;
mnt = fp->f_path.mnt;

if (autofs_type_trigger(sbi->type))
dentry = autofs4_expire_direct(sbi->sb, mnt, sbi, how);
else
dentry = autofs4_expire_indirect(sbi->sb, mnt, sbi, how);

if (dentry) {
struct autofs_info *ino = autofs4_dentry_ino(dentry);

/*
* This is synchronous because it makes the daemon a
* little easier
*/
err = autofs4_wait(sbi, dentry, NFY_EXPIRE);

spin_lock(&sbi->fs_lock);
if (ino->flags & AUTOFS_INF_MOUNTPOINT) {
ino->flags &= ~AUTOFS_INF_MOUNTPOINT;
sbi->sb->s_root->d_mounted++;
}
ino->flags &= ~AUTOFS_INF_EXPIRING;
complete_all(&ino->expire_complete);
spin_unlock(&sbi->fs_lock);
dput(dentry);
}

return err;
return autofs4_do_expire_multi(sbi->sb, mnt, sbi, how);
}

/* Check if autofs mount point is in use */
Expand Down
27 changes: 17 additions & 10 deletions trunk/fs/autofs4/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,22 +478,16 @@ int autofs4_expire_run(struct super_block *sb,
return ret;
}

/* 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,
struct autofs_sb_info *sbi, int __user *arg)
int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
struct autofs_sb_info *sbi, int when)
{
struct dentry *dentry;
int ret = -EAGAIN;
int do_now = 0;

if (arg && get_user(do_now, arg))
return -EFAULT;

if (autofs_type_trigger(sbi->type))
dentry = autofs4_expire_direct(sb, mnt, sbi, do_now);
dentry = autofs4_expire_direct(sb, mnt, sbi, when);
else
dentry = autofs4_expire_indirect(sb, mnt, sbi, do_now);
dentry = autofs4_expire_indirect(sb, mnt, sbi, when);

if (dentry) {
struct autofs_info *ino = autofs4_dentry_ino(dentry);
Expand All @@ -516,3 +510,16 @@ int autofs4_expire_multi(struct super_block *sb, struct vfsmount *mnt,
return ret;
}

/* 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,
struct autofs_sb_info *sbi, int __user *arg)
{
int do_now = 0;

if (arg && get_user(do_now, arg))
return -EFAULT;

return autofs4_do_expire_multi(sb, mnt, sbi, do_now);
}

0 comments on commit ea4eb0b

Please sign in to comment.