Commit 93da4003 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds

ramfs: support O_TMPFILE

[akpm@linux-foundation.org: update inode_operations.tmpfile]

Link: http://lkml.kernel.org/r/20190206073349.GA15311@avx2Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Acked-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3d742d4b
...@@ -151,6 +151,18 @@ static int ramfs_symlink(struct user_namespace *mnt_userns, struct inode *dir, ...@@ -151,6 +151,18 @@ static int ramfs_symlink(struct user_namespace *mnt_userns, struct inode *dir,
return error; return error;
} }
static int ramfs_tmpfile(struct user_namespace *mnt_userns,
struct inode *dir, struct dentry *dentry, umode_t mode)
{
struct inode *inode;
inode = ramfs_get_inode(dir->i_sb, dir, mode, 0);
if (!inode)
return -ENOSPC;
d_tmpfile(dentry, inode);
return 0;
}
static const struct inode_operations ramfs_dir_inode_operations = { static const struct inode_operations ramfs_dir_inode_operations = {
.create = ramfs_create, .create = ramfs_create,
.lookup = simple_lookup, .lookup = simple_lookup,
...@@ -161,6 +173,7 @@ static const struct inode_operations ramfs_dir_inode_operations = { ...@@ -161,6 +173,7 @@ static const struct inode_operations ramfs_dir_inode_operations = {
.rmdir = simple_rmdir, .rmdir = simple_rmdir,
.mknod = ramfs_mknod, .mknod = ramfs_mknod,
.rename = simple_rename, .rename = simple_rename,
.tmpfile = ramfs_tmpfile,
}; };
/* /*
......
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