aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/anon_inodes.c9
-rw-r--r--fs/eventfd.c2
-rw-r--r--fs/eventpoll.c2
-rw-r--r--fs/signalfd.c3
-rw-r--r--fs/timerfd.c2
-rw-r--r--include/linux/anon_inodes.h2
-rw-r--r--virt/kvm/kvm_main.c4
7 files changed, 13 insertions, 11 deletions
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index 977ef208c051..1a4eee620b0d 100644
--- a/fs/anon_inodes.c
+++ b/fs/anon_inodes.c
@@ -58,8 +58,9 @@ static struct dentry_operations anon_inodefs_dentry_operations = {
58 * of the file 58 * of the file
59 * 59 *
60 * @name: [in] name of the "class" of the new file 60 * @name: [in] name of the "class" of the new file
61 * @fops [in] file operations for the new file 61 * @fops: [in] file operations for the new file
62 * @priv [in] private data for the new file (will be file's private_data) 62 * @priv: [in] private data for the new file (will be file's private_data)
63 * @flags: [in] flags
63 * 64 *
64 * Creates a new file by hooking it on a single inode. This is useful for files 65 * Creates a new file by hooking it on a single inode. This is useful for files
65 * that do not need to have a full-fledged inode in order to operate correctly. 66 * that do not need to have a full-fledged inode in order to operate correctly.
@@ -68,7 +69,7 @@ static struct dentry_operations anon_inodefs_dentry_operations = {
68 * setup. Returns new descriptor or -error. 69 * setup. Returns new descriptor or -error.
69 */ 70 */
70int anon_inode_getfd(const char *name, const struct file_operations *fops, 71int anon_inode_getfd(const char *name, const struct file_operations *fops,
71 void *priv) 72 void *priv, int flags)
72{ 73{
73 struct qstr this; 74 struct qstr this;
74 struct dentry *dentry; 75 struct dentry *dentry;
@@ -78,7 +79,7 @@ int anon_inode_getfd(const char *name, const struct file_operations *fops,
78 if (IS_ERR(anon_inode_inode)) 79 if (IS_ERR(anon_inode_inode))
79 return -ENODEV; 80 return -ENODEV;
80 81
81 error = get_unused_fd(); 82 error = get_unused_fd_flags(flags);
82 if (error < 0) 83 if (error < 0)
83 return error; 84 return error;
84 fd = error; 85 fd = error;
diff --git a/fs/eventfd.c b/fs/eventfd.c
index 343942deeec1..6094265ca409 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -214,7 +214,7 @@ asmlinkage long sys_eventfd(unsigned int count)
214 * When we call this, the initialization must be complete, since 214 * When we call this, the initialization must be complete, since
215 * anon_inode_getfd() will install the fd. 215 * anon_inode_getfd() will install the fd.
216 */ 216 */
217 fd = anon_inode_getfd("[eventfd]", &eventfd_fops, ctx); 217 fd = anon_inode_getfd("[eventfd]", &eventfd_fops, ctx, 0);
218 if (fd < 0) 218 if (fd < 0)
219 kfree(ctx); 219 kfree(ctx);
220 return fd; 220 return fd;
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 990c01d2d66b..9392dd968125 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1068,7 +1068,7 @@ asmlinkage long sys_epoll_create(int size)
1068 * Creates all the items needed to setup an eventpoll file. That is, 1068 * Creates all the items needed to setup an eventpoll file. That is,
1069 * a file structure and a free file descriptor. 1069 * a file structure and a free file descriptor.
1070 */ 1070 */
1071 fd = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep); 1071 fd = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep, 0);
1072 if (fd < 0) 1072 if (fd < 0)
1073 ep_free(ep); 1073 ep_free(ep);
1074 1074
diff --git a/fs/signalfd.c b/fs/signalfd.c
index 619725644c75..ddb328b74bde 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -227,7 +227,8 @@ asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemas
227 * When we call this, the initialization must be complete, since 227 * When we call this, the initialization must be complete, since
228 * anon_inode_getfd() will install the fd. 228 * anon_inode_getfd() will install the fd.
229 */ 229 */
230 ufd = anon_inode_getfd("[signalfd]", &signalfd_fops, ctx); 230 ufd = anon_inode_getfd("[signalfd]", &signalfd_fops, ctx,
231 0);
231 if (ufd < 0) 232 if (ufd < 0)
232 kfree(ctx); 233 kfree(ctx);
233 } else { 234 } else {
diff --git a/fs/timerfd.c b/fs/timerfd.c
index d87d354ec424..77c2bc92cbee 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -198,7 +198,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
198 ctx->clockid = clockid; 198 ctx->clockid = clockid;
199 hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS); 199 hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS);
200 200
201 ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx); 201 ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx, 0);
202 if (ufd < 0) 202 if (ufd < 0)
203 kfree(ctx); 203 kfree(ctx);
204 204
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h
index 6129e58ca7c9..e0a0cdc2da43 100644
--- a/include/linux/anon_inodes.h
+++ b/include/linux/anon_inodes.h
@@ -9,7 +9,7 @@
9#define _LINUX_ANON_INODES_H 9#define _LINUX_ANON_INODES_H
10 10
11int anon_inode_getfd(const char *name, const struct file_operations *fops, 11int anon_inode_getfd(const char *name, const struct file_operations *fops,
12 void *priv); 12 void *priv, int flags);
13 13
14#endif /* _LINUX_ANON_INODES_H */ 14#endif /* _LINUX_ANON_INODES_H */
15 15
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 904d7b7bd780..a845890b6800 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -902,7 +902,7 @@ static const struct file_operations kvm_vcpu_fops = {
902 */ 902 */
903static int create_vcpu_fd(struct kvm_vcpu *vcpu) 903static int create_vcpu_fd(struct kvm_vcpu *vcpu)
904{ 904{
905 int fd = anon_inode_getfd("kvm-vcpu", &kvm_vcpu_fops, vcpu); 905 int fd = anon_inode_getfd("kvm-vcpu", &kvm_vcpu_fops, vcpu, 0);
906 if (fd < 0) 906 if (fd < 0)
907 kvm_put_kvm(vcpu->kvm); 907 kvm_put_kvm(vcpu->kvm);
908 return fd; 908 return fd;
@@ -1261,7 +1261,7 @@ static int kvm_dev_ioctl_create_vm(void)
1261 kvm = kvm_create_vm(); 1261 kvm = kvm_create_vm();
1262 if (IS_ERR(kvm)) 1262 if (IS_ERR(kvm))
1263 return PTR_ERR(kvm); 1263 return PTR_ERR(kvm);
1264 fd = anon_inode_getfd("kvm-vm", &kvm_vm_fops, kvm); 1264 fd = anon_inode_getfd("kvm-vm", &kvm_vm_fops, kvm, 0);
1265 if (fd < 0) 1265 if (fd < 0)
1266 kvm_put_kvm(kvm); 1266 kvm_put_kvm(kvm);
1267 1267