From: Zhi Yong Wu Date: Wed, 18 Dec 2013 00:22:41 +0000 (+0800) Subject: xfs: allow linkat() on O_TMPFILE files X-Git-Tag: v3.15-rc1~90^2~1^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab29743117f9f4c22ac44c13c1647fb24fb2bafe;p=pandora-kernel.git 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 Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Ben Myers --- Reading git-diff-tree failed