diff options
author | Sargun Dhillon <sargun@sargun.me> | 2020-01-07 09:59:24 -0800 |
---|---|---|
committer | Christian Brauner <christian.brauner@ubuntu.com> | 2020-01-13 21:48:42 +0100 |
commit | 5e876fb43dbf24c941a323139752bcb2f0a80da0 (patch) | |
tree | 79948c06e4f93aeb83eb698d2409ca4997bd942a /fs/hostfs | |
parent | c79f46a282390e0f5b306007bf7b11a46d529538 (diff) | |
download | linux-5e876fb43dbf24c941a323139752bcb2f0a80da0.tar.bz2 |
vfs, fdtable: Add fget_task helper
This introduces a function which can be used to fetch a file, given an
arbitrary task. As long as the user holds a reference (refcnt) to the
task_struct it is safe to call, and will either return NULL on failure,
or a pointer to the file, with a refcnt.
This patch is based on Oleg Nesterov's (cf. [1]) patch from September
2018.
[1]: Link: https://lore.kernel.org/r/20180915160423.GA31461@redhat.com
Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200107175927.4558-2-sargun@sargun.me
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Diffstat (limited to 'fs/hostfs')
0 files changed, 0 insertions, 0 deletions