rpdfs: Add basic tmpfile support
PATCH v2 1/1 rpdfs: Add basic tmpfile support
This is sufficient for getting basic xfstests passing.
Signed-off-by Chris Kirby <[email protected]>
---
Changes in v2:
- Remove unnecessary comment about tmpfile orphans
- Mark the inode dirty before unlocking
fs/rpdfs/dir.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
fs/rpdfs/dir.c +20 -0
@@ -754,6 +754,25 @@ static int rpdfs_readdir(struct file *file, struct dir_context *ctx)return ret; } +/* +* Basic tmpfile support. This still needs to mark the inode as an orphan. +*/ +static int rpdfs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +struct file *file,umode_t mode) +{ +struct inode *inode; + + inode =create_new_inode (idmap, dir,NULL , mode); +if (IS_ERR (inode)) +return PTR_ERR (inode); + +d_tmpfile (file, inode); +mark_inode_dirty (inode); +unlock_new_inode (inode); + +return finish_open_simple (file,0 ); +} +const struct inode_operations rpdfs_dir_iops = { .create = rpdfs_create, .getattr = rpdfs_getattr,
@@ -762,6 +781,7 @@ const struct inode_operations rpdfs_dir_iops = { .mkdir = rpdfs_mkdir, .rename = rpdfs_rename, .setattr = rpdfs_setattr, + .tmpfile = rpdfs_tmpfile, .unlink = rpdfs_unlink, .rmdir = rpdfs_rmdir, };
Signature · 1 line
2.55.0
Zach Brown
AppliedQuoted 1 line · Chris Kirby
This is sufficient for getting basic xfstests passing.
Applied, thanks!
- z