From 90a8d97bcfd1a0f5c20e38a86d7d245d4e225523 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 12 Aug 2012 18:04:37 -0400 Subject: [PATCH] --- yaml --- r: 328959 b: refs/heads/master c: c921b40d6201f7ec7b1edf7ea9a844f93e1a27f4 h: refs/heads/master i: 328957: c42aa179ede31c01c81d33d51ec0bd19e739428f 328955: 6a445e905d8ce04faadaf5b77ba6caf391f8ebfe 328951: ecd5c686a2e00f6758ddc1c0b87c0797f1644a9b 328943: ea95fea93699988ee5f4c585c5e81f5253d0b7bb 328927: 73c4944f826bb12563034919678120bd8c423fb6 328895: 0d02bb45fc4b674cb82d17c295b2304a2f0b0e58 328831: 5ef327b9a312562d4e62eeea171eec7e12a666d5 328703: 45eabca46d34e184a393a3eca6b3522666321668 v: v3 --- [refs] | 2 +- trunk/fs/autofs4/dev-ioctl.c | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 86f62a9c88d9..17a54d4d6941 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1a7bd2265fc57f29400d57f66275cc5918e30aa6 +refs/heads/master: c921b40d6201f7ec7b1edf7ea9a844f93e1a27f4 diff --git a/trunk/fs/autofs4/dev-ioctl.c b/trunk/fs/autofs4/dev-ioctl.c index abf645c1703b..a16214109d31 100644 --- a/trunk/fs/autofs4/dev-ioctl.c +++ b/trunk/fs/autofs4/dev-ioctl.c @@ -221,20 +221,6 @@ static int test_by_type(struct path *path, void *p) return ino && ino->sbi->type & *(unsigned *)p; } -static void autofs_dev_ioctl_fd_install(unsigned int fd, struct file *file) -{ - struct files_struct *files = current->files; - struct fdtable *fdt; - - spin_lock(&files->file_lock); - fdt = files_fdtable(files); - BUG_ON(fdt->fd[fd] != NULL); - rcu_assign_pointer(fdt->fd[fd], file); - __set_close_on_exec(fd, fdt); - spin_unlock(&files->file_lock); -} - - /* * Open a file descriptor on the autofs mount point corresponding * to the given path and device number (aka. new_encode_dev(sb->s_dev)). @@ -243,7 +229,7 @@ static int autofs_dev_ioctl_open_mountpoint(const char *name, dev_t devid) { int err, fd; - fd = get_unused_fd(); + fd = get_unused_fd_flags(O_CLOEXEC); if (likely(fd >= 0)) { struct file *filp; struct path path; @@ -264,7 +250,7 @@ static int autofs_dev_ioctl_open_mountpoint(const char *name, dev_t devid) goto out; } - autofs_dev_ioctl_fd_install(fd, filp); + fd_install(fd, filp); } return fd;