aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2008-04-17 00:01:08 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-17 00:01:08 -0400
commita7dab9e887ce37391f004ffd6ce0ffed7272fd69 (patch)
tree641653c9d0943722fe9c099adee3089ad293e0dd /drivers/infiniband/core
parent1ae5c187acb67c2929428479c23a79c4288f0c68 (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>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/uverbs_main.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 63335da42744..f49f94653a96 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,
517 goto err; 517 goto err;
518 } 518 }
519 519
520 filp = get_empty_filp();
521 if (!filp) {
522 ret = -ENFILE;
523 goto err_fd;
524 }
525
526 /* 520 /*
527 * fops_get() can't fail here, because we're coming from a 521 * fops_get() can't fail here, because we're coming from a
528 * system call on a uverbs file, which will already have a 522 * system call on a uverbs file, which will already have a
529 * module reference. 523 * module reference.
530 */ 524 */
531 filp->f_op = fops_get(&uverbs_event_fops); 525 filp = alloc_file(uverbs_event_mnt, dget(uverbs_event_mnt->mnt_root),
532 filp->f_path.mnt = mntget(uverbs_event_mnt); 526 FMODE_READ, fops_get(&uverbs_event_fops));
533 filp->f_path.dentry = dget(uverbs_event_mnt->mnt_root); 527 if (!filp) {
534 filp->f_mapping = filp->f_path.dentry->d_inode->i_mapping; 528 ret = -ENFILE;
535 filp->f_flags = O_RDONLY; 529 goto err_fd;
536 filp->f_mode = FMODE_READ; 530 }
531
537 filp->private_data = ev_file; 532 filp->private_data = ev_file;
538 533
539 return filp; 534 return filp;