linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] xfs: add O_TMPFILE support
@ 2013-12-13 14:27 Zhi Yong Wu
  2013-12-13 14:27 ` [PATCH 1/5] xfs: factor prid related codes into xfs_get_initial_prid() Zhi Yong Wu
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Zhi Yong Wu @ 2013-12-13 14:27 UTC (permalink / raw)
  To: xfs; +Cc: linux-fsdevel, linux-kernel, Zhi Yong Wu

From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

HI, folks

  It's time to post out the first formal version, welcome to any constructive comment, thanks.

  If anyone is interested in playing with it, you can get this patchset from my dev git on github:
  git://github.com/wuzhy/kernel.git xfs_tmpfile

  The patchset was tests agaist the code snippet from Andy Lutomirski and other test cases:
  http://lwn.net/Articles/562296/
  If you have any other better test cases, please let me know, thanks.

#include <stdio.h>
#include <err.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

#define __O_TMPFILE 020000000
#define O_DIRECTORY 0200000
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
#define AT_EMPTY_PATH 0x1000

int main(int argc, char **argv)
{
   char buf[128];

   if (argc != 3)
     errx(1, "Usage: flinktest PATH linkat|proc");

   int fd = open(".", O_TMPFILE | O_RDWR, 0600);
   if (fd == -1)
     err(1, "O_TMPFILE");
   else
     printf("fd #: %d\n", fd);

   write(fd, "test", 4);

   if (!strcmp(argv[2], "linkat")) {
     if (linkat(fd, "", AT_FDCWD, argv[1], AT_EMPTY_PATH) != 0)
       err(1, "linkat");
   } else if (!strcmp(argv[2], "proc")) {
     sprintf(buf, "/proc/self/fd/%d", fd);
     if (linkat(AT_FDCWD, buf, AT_FDCWD, argv[1], AT_SYMLINK_FOLLOW) != 0)
       err(1, "linkat");
   } else {
     errx(1, "invalid mode");
   }

   return 0;
}


Changelog from rfc:
 - Addressed the comments from Dave Chinner and Christoph Hellwig.

Zhi Yong Wu (5):
  xfs: factor prid related codes into xfs_get_initial_prid()
  xfs: adjust the interface of xfs_qm_vop_dqalloc()
  xfs: add xfs_create_tmpfile() for O_TMPFILE support
  xfs: add a new method xfs_vn_tmpfile()
  xfs: allow linkat() on O_TMPFILE files

 fs/xfs/xfs_inode.c      |  142 ++++++++++++++++++++++++++++++++++++++++++++---
 fs/xfs/xfs_inode.h      |    2 +
 fs/xfs/xfs_ioctl.c      |    2 +-
 fs/xfs/xfs_iops.c       |   25 ++++++++-
 fs/xfs/xfs_qm.c         |   50 ++++++++++------
 fs/xfs/xfs_quota.h      |    6 +-
 fs/xfs/xfs_shared.h     |    4 +-
 fs/xfs/xfs_symlink.c    |    2 +-
 fs/xfs/xfs_trans_resv.c |   51 +++++++++++++++++
 fs/xfs/xfs_trans_resv.h |    4 +
 10 files changed, 255 insertions(+), 33 deletions(-)

-- 
1.7.6.5


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-12-14 11:43 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-13 14:27 [PATCH 0/5] xfs: add O_TMPFILE support Zhi Yong Wu
2013-12-13 14:27 ` [PATCH 1/5] xfs: factor prid related codes into xfs_get_initial_prid() Zhi Yong Wu
2013-12-13 16:32   ` Christoph Hellwig
2013-12-14 11:20     ` Jeff Liu
2013-12-14 11:43       ` Zhi Yong Wu
2013-12-13 14:27 ` [PATCH 2/5] xfs: adjust the interface of xfs_qm_vop_dqalloc() Zhi Yong Wu
2013-12-13 16:32   ` Christoph Hellwig
2013-12-13 17:29     ` Zhi Yong Wu
2013-12-13 14:27 ` [PATCH 3/5] xfs: add xfs_create_tmpfile() for O_TMPFILE support Zhi Yong Wu
2013-12-13 16:37   ` Christoph Hellwig
2013-12-13 17:29     ` Zhi Yong Wu
2013-12-13 14:27 ` [PATCH 4/5] xfs: add a new method xfs_vn_tmpfile() Zhi Yong Wu
2013-12-13 16:39   ` Christoph Hellwig
2013-12-13 17:32     ` Zhi Yong Wu
2013-12-13 14:27 ` [PATCH 5/5] xfs: allow linkat() on O_TMPFILE files Zhi Yong Wu
2013-12-13 16:41   ` Christoph Hellwig
2013-12-13 17:36     ` Zhi Yong Wu
2013-12-14  8:19       ` Dave Chinner
2013-12-14  9:58         ` Zhi Yong Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).