diff options
| -rw-r--r-- | fs/xfs/xfs_inode.c | 5 | ||||
| -rw-r--r-- | fs/xfs/xfs_inode.h | 2 | ||||
| -rw-r--r-- | fs/xfs/xfs_iops.c | 20 |
3 files changed, 21 insertions, 6 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 5e7a38fa6ee6..768087bedbac 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
| @@ -1334,7 +1334,8 @@ int | |||
| 1334 | xfs_create_tmpfile( | 1334 | xfs_create_tmpfile( |
| 1335 | struct xfs_inode *dp, | 1335 | struct xfs_inode *dp, |
| 1336 | struct dentry *dentry, | 1336 | struct dentry *dentry, |
| 1337 | umode_t mode) | 1337 | umode_t mode, |
| 1338 | struct xfs_inode **ipp) | ||
| 1338 | { | 1339 | { |
| 1339 | struct xfs_mount *mp = dp->i_mount; | 1340 | struct xfs_mount *mp = dp->i_mount; |
| 1340 | struct xfs_inode *ip = NULL; | 1341 | struct xfs_inode *ip = NULL; |
| @@ -1402,7 +1403,6 @@ xfs_create_tmpfile( | |||
| 1402 | xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp); | 1403 | xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp); |
| 1403 | 1404 | ||
| 1404 | ip->i_d.di_nlink--; | 1405 | ip->i_d.di_nlink--; |
| 1405 | d_tmpfile(dentry, VFS_I(ip)); | ||
| 1406 | error = xfs_iunlink(tp, ip); | 1406 | error = xfs_iunlink(tp, ip); |
| 1407 | if (error) | 1407 | if (error) |
| 1408 | goto out_trans_abort; | 1408 | goto out_trans_abort; |
| @@ -1415,6 +1415,7 @@ xfs_create_tmpfile( | |||
| 1415 | xfs_qm_dqrele(gdqp); | 1415 | xfs_qm_dqrele(gdqp); |
| 1416 | xfs_qm_dqrele(pdqp); | 1416 | xfs_qm_dqrele(pdqp); |
| 1417 | 1417 | ||
| 1418 | *ipp = ip; | ||
| 1418 | return 0; | 1419 | return 0; |
| 1419 | 1420 | ||
| 1420 | out_trans_abort: | 1421 | out_trans_abort: |
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 396cc1fafd0d..f2fcde52b66d 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
| @@ -334,7 +334,7 @@ int xfs_lookup(struct xfs_inode *dp, struct xfs_name *name, | |||
| 334 | int xfs_create(struct xfs_inode *dp, struct xfs_name *name, | 334 | int xfs_create(struct xfs_inode *dp, struct xfs_name *name, |
| 335 | umode_t mode, xfs_dev_t rdev, struct xfs_inode **ipp); | 335 | umode_t mode, xfs_dev_t rdev, struct xfs_inode **ipp); |
| 336 | int xfs_create_tmpfile(struct xfs_inode *dp, struct dentry *dentry, | 336 | int xfs_create_tmpfile(struct xfs_inode *dp, struct dentry *dentry, |
| 337 | umode_t mode); | 337 | umode_t mode, struct xfs_inode **ipp); |
| 338 | int xfs_remove(struct xfs_inode *dp, struct xfs_name *name, | 338 | int xfs_remove(struct xfs_inode *dp, struct xfs_name *name, |
| 339 | struct xfs_inode *ip); | 339 | struct xfs_inode *ip); |
| 340 | int xfs_link(struct xfs_inode *tdp, struct xfs_inode *sip, | 340 | int xfs_link(struct xfs_inode *tdp, struct xfs_inode *sip, |
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 89b07e43ca28..ef1ca010f417 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
| @@ -1053,11 +1053,25 @@ xfs_vn_tmpfile( | |||
| 1053 | struct dentry *dentry, | 1053 | struct dentry *dentry, |
| 1054 | umode_t mode) | 1054 | umode_t mode) |
| 1055 | { | 1055 | { |
| 1056 | int error; | 1056 | int error; |
| 1057 | struct xfs_inode *ip; | ||
| 1058 | struct inode *inode; | ||
| 1057 | 1059 | ||
| 1058 | error = xfs_create_tmpfile(XFS_I(dir), dentry, mode); | 1060 | error = xfs_create_tmpfile(XFS_I(dir), dentry, mode, &ip); |
| 1061 | if (unlikely(error)) | ||
| 1062 | return -error; | ||
| 1059 | 1063 | ||
| 1060 | return -error; | 1064 | inode = VFS_I(ip); |
| 1065 | |||
| 1066 | error = xfs_init_security(inode, dir, &dentry->d_name); | ||
| 1067 | if (unlikely(error)) { | ||
| 1068 | iput(inode); | ||
| 1069 | return -error; | ||
| 1070 | } | ||
| 1071 | |||
| 1072 | d_tmpfile(dentry, inode); | ||
| 1073 | |||
| 1074 | return 0; | ||
| 1061 | } | 1075 | } |
| 1062 | 1076 | ||
| 1063 | static const struct inode_operations xfs_inode_operations = { | 1077 | static const struct inode_operations xfs_inode_operations = { |
