From: Zhi Yong Wu <zwu.kernel@gmail.com>
To: xfs@oss.sgi.com
Cc: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Subject: [RFC PATCH 3/4] xfs: add a new method xfs_vn_tmpfile()
Date: Mon, 25 Nov 2013 19:32:33 +0800 [thread overview]
Message-ID: <1385379154-3802-4-git-send-email-zwu.kernel@gmail.com> (raw)
In-Reply-To: <1385379154-3802-1-git-send-email-zwu.kernel@gmail.com>
From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Add a new O_TMPFILE method to VFS inteface.
http://oss.sgi.com/archives/xfs/2013-08/msg00336.html
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
fs/xfs/xfs_iops.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index eb55be5..5d2e781 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -39,6 +39,7 @@
#include "xfs_da_btree.h"
#include "xfs_dir2_priv.h"
#include "xfs_dinode.h"
+#include "xfs_trans_space.h"
#include <linux/capability.h>
#include <linux/xattr.h>
@@ -1051,6 +1052,24 @@ xfs_vn_fiemap(
return 0;
}
+STATIC int
+xfs_vn_tmpfile(
+ struct inode *dir,
+ struct dentry *dentry,
+ umode_t mode)
+{
+ struct xfs_inode *ip = NULL;
+ int error;
+
+ error = xfs_create_tmpfile(XFS_I(dir)->i_mount, mode, 0, &ip);
+ if (error)
+ return -error;
+
+ d_instantiate(dentry, VFS_I(ip));
+
+ return -error;
+}
+
static const struct inode_operations xfs_inode_operations = {
.get_acl = xfs_get_acl,
.getattr = xfs_vn_getattr,
@@ -1087,6 +1106,7 @@ static const struct inode_operations xfs_dir_inode_operations = {
.removexattr = generic_removexattr,
.listxattr = xfs_vn_listxattr,
.update_time = xfs_vn_update_time,
+ .tmpfile = xfs_vn_tmpfile,
};
static const struct inode_operations xfs_dir_ci_inode_operations = {
@@ -1113,6 +1133,7 @@ static const struct inode_operations xfs_dir_ci_inode_operations = {
.removexattr = generic_removexattr,
.listxattr = xfs_vn_listxattr,
.update_time = xfs_vn_update_time,
+ .tmpfile = xfs_vn_tmpfile,
};
static const struct inode_operations xfs_symlink_inode_operations = {
--
1.7.6.5
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-11-25 11:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-25 11:32 [RFC PATCH 0/4] xfs: add O_TMPFILE support Zhi Yong Wu
2013-11-25 11:32 ` [RFC PATCH 1/4] xfs: adjust the interface of xfs_qm_vop_dqalloc() Zhi Yong Wu
2013-11-25 13:43 ` Christoph Hellwig
2013-11-28 1:43 ` Zhi Yong Wu
2013-11-25 11:32 ` [RFC PATCH 2/4] xfs: add xfs_create_tmpfile() for O_TMPFILE support Zhi Yong Wu
2013-11-25 13:48 ` Christoph Hellwig
2013-11-28 1:48 ` Zhi Yong Wu
2013-11-25 21:36 ` Dave Chinner
2013-11-26 5:59 ` Christoph Hellwig
2013-11-28 2:41 ` Zhi Yong Wu
2013-11-25 11:32 ` Zhi Yong Wu [this message]
2013-11-25 13:48 ` [RFC PATCH 3/4] xfs: add a new method xfs_vn_tmpfile() Christoph Hellwig
2013-11-28 2:20 ` Zhi Yong Wu
2013-11-25 11:32 ` [RFC PATCH 4/4] xfs: allow linkat() on O_TMPFILE files Zhi Yong Wu
2013-11-25 13:51 ` Christoph Hellwig
2013-11-28 2:37 ` Zhi Yong Wu
2013-11-28 10:39 ` Christoph Hellwig
2013-11-28 10:47 ` Zhi Yong Wu
2013-11-25 21:46 ` Dave Chinner
2013-11-28 2:28 ` Zhi Yong Wu
2013-12-13 11:34 ` Zhi Yong Wu
2013-12-13 16:31 ` Christoph Hellwig
2013-11-28 10:35 ` [RFC PATCH 0/4] xfs: add O_TMPFILE support Christoph Hellwig
2013-11-28 10:50 ` Zhi Yong Wu
2013-11-28 14:39 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385379154-3802-4-git-send-email-zwu.kernel@gmail.com \
--to=zwu.kernel@gmail.com \
--cc=wuzhy@linux.vnet.ibm.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.