diff options
author | Roland Dreier <rolandd@cisco.com> | 2008-04-16 21:01:08 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-04-16 21:01:08 -0700 |
commit | a7dab9e887ce37391f004ffd6ce0ffed7272fd69 (patch) | |
tree | 641653c9d0943722fe9c099adee3089ad293e0dd | |
parent | 1ae5c187acb67c2929428479c23a79c4288f0c68 (diff) |
IB/uverbs: Use alloc_file() instead of get_empty_filp()
Christoph Hellwig wants to unexport get_empty_filp(), which is an ugly
internal interface. Change the modular user in ib_uverbs_alloc_event_file()
to use the better alloc_file() interface; this makes the code cleaner too.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/infiniband/core/uverbs_main.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 63335da4274..f49f94653a9 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -517,23 +517,18 @@ struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file, goto err; } - filp = get_empty_filp(); - if (!filp) { - ret = -ENFILE; - goto err_fd; - } - /* * fops_get() can't fail here, because we're coming from a * system call on a uverbs file, which will already have a * module reference. */ - filp->f_op = fops_get(&uverbs_event_fops); - filp->f_path.mnt = mntget(uverbs_event_mnt); - filp->f_path.dentry = dget(uverbs_event_mnt->mnt_root); - filp->f_mapping = filp->f_path.dentry->d_inode->i_mapping; - filp->f_flags = O_RDONLY; - filp->f_mode = FMODE_READ; + filp = alloc_file(uverbs_event_mnt, dget(uverbs_event_mnt->mnt_root), + FMODE_READ, fops_get(&uverbs_event_fops)); + if (!filp) { + ret = -ENFILE; + goto err_fd; + } + filp->private_data = ev_file; return filp; |