usermode_driver.c (942baad211336efefb93a8369478888ab845c450) usermode_driver.c (58ec9059b396a570b208239b4edc45eeb68b14c4)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * umd - User mode driver support
4 */
5#include <linux/shmem_fs.h>
6#include <linux/pipe_fs_i.h>
7#include <linux/mount.h>
8#include <linux/fs_struct.h>

--- 12 unchanged lines hidden (view full) ---

21 if (!type)
22 return ERR_PTR(-ENODEV);
23
24 mnt = kern_mount(type);
25 put_filesystem(type);
26 if (IS_ERR(mnt))
27 return mnt;
28
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * umd - User mode driver support
4 */
5#include <linux/shmem_fs.h>
6#include <linux/pipe_fs_i.h>
7#include <linux/mount.h>
8#include <linux/fs_struct.h>

--- 12 unchanged lines hidden (view full) ---

21 if (!type)
22 return ERR_PTR(-ENODEV);
23
24 mnt = kern_mount(type);
25 put_filesystem(type);
26 if (IS_ERR(mnt))
27 return mnt;
28
29 file = file_open_root(mnt->mnt_root, mnt, name, O_CREAT | O_WRONLY, 0700);
29 file = file_open_root_mnt(mnt, name, O_CREAT | O_WRONLY, 0700);
30 if (IS_ERR(file)) {
31 mntput(mnt);
32 return ERR_CAST(file);
33 }
34
35 written = kernel_write(file, data, len, &pos);
36 if (written != len) {
37 int err = written;

--- 154 unchanged lines hidden ---
30 if (IS_ERR(file)) {
31 mntput(mnt);
32 return ERR_CAST(file);
33 }
34
35 written = kernel_write(file, data, len, &pos);
36 if (written != len) {
37 int err = written;

--- 154 unchanged lines hidden ---