mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
switch simple cases of fget_light to fdget
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
a5b470ba06
commit
2903ff019b
44 changed files with 633 additions and 763 deletions
17
fs/fhandle.c
17
fs/fhandle.c
|
|
@ -113,24 +113,21 @@ SYSCALL_DEFINE5(name_to_handle_at, int, dfd, const char __user *, name,
|
|||
|
||||
static struct vfsmount *get_vfsmount_from_fd(int fd)
|
||||
{
|
||||
struct path path;
|
||||
struct vfsmount *mnt;
|
||||
|
||||
if (fd == AT_FDCWD) {
|
||||
struct fs_struct *fs = current->fs;
|
||||
spin_lock(&fs->lock);
|
||||
path = fs->pwd;
|
||||
mntget(path.mnt);
|
||||
mnt = mntget(fs->pwd.mnt);
|
||||
spin_unlock(&fs->lock);
|
||||
} else {
|
||||
int fput_needed;
|
||||
struct file *file = fget_light(fd, &fput_needed);
|
||||
if (!file)
|
||||
struct fd f = fdget(fd);
|
||||
if (!f.file)
|
||||
return ERR_PTR(-EBADF);
|
||||
path = file->f_path;
|
||||
mntget(path.mnt);
|
||||
fput_light(file, fput_needed);
|
||||
mnt = mntget(f.file->f_path.mnt);
|
||||
fdput(f);
|
||||
}
|
||||
return path.mnt;
|
||||
return mnt;
|
||||
}
|
||||
|
||||
static int vfs_dentry_acceptable(void *context, struct dentry *dentry)
|
||||
|
|
|
|||
Loading…
Reference in a new issue