From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 3E3C229DF8 for ; Tue, 17 Dec 2013 18:16:02 -0600 (CST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 286A68F8040 for ; Tue, 17 Dec 2013 16:15:59 -0800 (PST) Received: from e7.ny.us.ibm.com (e7.ny.us.ibm.com [32.97.182.137]) by cuda.sgi.com with ESMTP id TgF6IvZgsVEFGLYR (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 17 Dec 2013 16:15:57 -0800 (PST) Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Dec 2013 19:15:57 -0500 Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 4844A6E8041 for ; Tue, 17 Dec 2013 19:15:52 -0500 (EST) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by b01cxnp22035.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBI0FtOJ7012858 for ; Wed, 18 Dec 2013 00:15:55 GMT Received: from d01av02.pok.ibm.com (localhost [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBI0Fs9c008692 for ; Tue, 17 Dec 2013 19:15:55 -0500 From: Zhi Yong Wu Subject: [PATCH v2 0/3] xfs: add O_TMPFILE support Date: Wed, 18 Dec 2013 08:15:42 +0800 Message-Id: <1387325745-22003-1-git-send-email-zwu.kernel@gmail.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com Cc: Zhi Yong Wu From: Zhi Yong Wu HI, folks It's time to post the latest revision out, 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 tested against 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 #include #include #include #include #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 v1: - Fixed one chunk of the comments from Christoph Hellwig and Jeff Liu. v1: - Addressed the comments from Dave Chinner and Christoph Hellwig. Zhi Yong Wu (3): xfs: factor prid related codes into xfs_get_initial_prid() xfs: add O_TMPFILE support xfs: allow linkat() on O_TMPFILE files fs/xfs/xfs_inode.c | 123 ++++++++++++++++++++++++++++++++++++++++++++-- fs/xfs/xfs_inode.h | 12 +++++ fs/xfs/xfs_iops.c | 16 ++++++ fs/xfs/xfs_shared.h | 4 +- fs/xfs/xfs_symlink.c | 5 +-- fs/xfs/xfs_trans_resv.c | 55 +++++++++++++++++++-- fs/xfs/xfs_trans_resv.h | 3 + 7 files changed, 203 insertions(+), 15 deletions(-) -- 1.7.6.5 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs