xfs: use ->t_dfops for attr set/remove operations
Attach the local dfops to the transaction allocated for xattr add and remove operations. Add an earlier initialization in xfs_attr_remove() to ensure the structure is valid if it remains unused at transaction commit time. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:

committed by
Darrick J. Wong

vanhempi
813d08cb6d
commit
40d03ac6aa
@@ -1057,6 +1057,8 @@ xfs_bmap_add_attrfork(
|
||||
rsvd ? XFS_TRANS_RESERVE : 0, &tp);
|
||||
if (error)
|
||||
return error;
|
||||
xfs_defer_init(&dfops, &firstblock);
|
||||
tp->t_dfops = &dfops;
|
||||
|
||||
xfs_ilock(ip, XFS_ILOCK_EXCL);
|
||||
error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ?
|
||||
@@ -1104,7 +1106,6 @@ xfs_bmap_add_attrfork(
|
||||
ip->i_afp = kmem_zone_zalloc(xfs_ifork_zone, KM_SLEEP);
|
||||
ip->i_afp->if_flags = XFS_IFEXTENTS;
|
||||
logflags = 0;
|
||||
xfs_defer_init(&dfops, &firstblock);
|
||||
switch (ip->i_d.di_format) {
|
||||
case XFS_DINODE_FMT_LOCAL:
|
||||
error = xfs_bmap_add_attrfork_local(tp, ip, &firstblock, &dfops,
|
||||
|
Viittaa uudesa ongelmassa
Block a user