]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xfs: allow linkat() on O_TMPFILE files
authorZhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Wed, 18 Dec 2013 00:22:41 +0000 (08:22 +0800)
committerBen Myers <bpm@sgi.com>
Mon, 6 Jan 2014 19:52:53 +0000 (13:52 -0600)
commitab29743117f9f4c22ac44c13c1647fb24fb2bafe
tree2c3dde038b7b275cdaad65246f516b7d416b8218
parent99b6436bc29e4f10e4388c27a3e4810191cc4788
xfs: allow linkat() on O_TMPFILE files

The VFS allows an anonymous temporary file to be named at a later
time via a linkat() syscall. The inodes for O_TMPFILE files are
are marked with a special flag I_LINKABLE and have a zero link count.

To support this in XFS, xfs_link() detects if this flag I_LINKABLE
is set and behaves appropriately when detected. So in this case,
its transaciton reservation takes into account the additional
overhead of removing the inode from the unlinked list. Then the
inode is removed from the unlinked list and the directory entry
is added. Finally its link count is bumped accordingly.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_inode.c
fs/xfs/xfs_trans_resv.c