Commit 2a117354 authored by Al Viro's avatar Al Viro

switch o2hb_region_dev_write() to fget_light()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 7b540d06
...@@ -1750,6 +1750,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, ...@@ -1750,6 +1750,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg,
struct inode *inode = NULL; struct inode *inode = NULL;
ssize_t ret = -EINVAL; ssize_t ret = -EINVAL;
int live_threshold; int live_threshold;
int fput_needed;
if (reg->hr_bdev) if (reg->hr_bdev)
goto out; goto out;
...@@ -1766,7 +1767,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, ...@@ -1766,7 +1767,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg,
if (fd < 0 || fd >= INT_MAX) if (fd < 0 || fd >= INT_MAX)
goto out; goto out;
filp = fget(fd); filp = fget_light(fd, &fput_needed);
if (filp == NULL) if (filp == NULL)
goto out; goto out;
...@@ -1884,7 +1885,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, ...@@ -1884,7 +1885,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg,
out: out:
if (filp) if (filp)
fput(filp); fput_light(filp, fput_needed);
if (inode) if (inode)
iput(inode); iput(inode);
if (ret < 0) { if (ret < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment