diff options
Diffstat (limited to 'fs/xfs/xfs_symlink.c')
-rw-r--r-- | fs/xfs/xfs_symlink.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index 53ed512c6f21..3b797a39950d 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c @@ -90,6 +90,11 @@ xfs_symlink( struct xfs_inode **ipp) { struct xfs_mount *mp = dp->i_mount; + struct xfs_icreate_args args = { + .idmap = idmap, + .pip = dp, + .mode = S_IFLNK | (mode & ~S_IFMT), + }; struct xfs_trans *tp = NULL; struct xfs_inode *ip = NULL; int error = 0; @@ -111,6 +116,9 @@ xfs_symlink( if (xfs_is_shutdown(mp)) return -EIO; + if (xfs_has_parent(mp)) + args.flags |= XFS_ICREATE_INIT_XATTRS; + /* * Check component lengths of the target path name. */ @@ -170,9 +178,7 @@ xfs_symlink( */ error = xfs_dialloc(&tp, dp->i_ino, S_IFLNK, &ino); if (!error) - error = xfs_init_new_inode(idmap, tp, dp, ino, - S_IFLNK | (mode & ~S_IFMT), 1, 0, prid, - xfs_has_parent(mp), &ip); + error = xfs_icreate(tp, ino, &args, &ip); if (error) goto out_trans_cancel; |