diff options
Diffstat (limited to 'fs/xfs/xfs_trans_buf.c')
| -rw-r--r-- | fs/xfs/xfs_trans_buf.c | 29 | 
1 files changed, 23 insertions, 6 deletions
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c index 3edf5dbee00..f950edd0d53 100644 --- a/fs/xfs/xfs_trans_buf.c +++ b/fs/xfs/xfs_trans_buf.c @@ -659,6 +659,7 @@ xfs_trans_binval(  		ASSERT(XFS_BUF_ISSTALE(bp));  		ASSERT(!(bip->bli_flags & (XFS_BLI_LOGGED | XFS_BLI_DIRTY)));  		ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_INODE_BUF)); +		ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_TYPE_MASK));  		ASSERT(bip->__bli_format.blf_flags & XFS_BLF_CANCEL);  		ASSERT(bip->bli_item.li_desc->lid_flags & XFS_LID_DIRTY);  		ASSERT(tp->t_flags & XFS_TRANS_DIRTY); @@ -671,6 +672,7 @@ xfs_trans_binval(  	bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY);  	bip->__bli_format.blf_flags &= ~XFS_BLF_INODE_BUF;  	bip->__bli_format.blf_flags |= XFS_BLF_CANCEL; +	bip->__bli_format.blf_flags &= ~XFS_BLF_TYPE_MASK;  	for (i = 0; i < bip->bli_format_count; i++) {  		memset(bip->bli_formats[i].blf_data_map, 0,  		       (bip->bli_formats[i].blf_map_size * sizeof(uint))); @@ -751,6 +753,26 @@ xfs_trans_inode_alloc_buf(  	bip->bli_flags |= XFS_BLI_INODE_ALLOC_BUF;  } +/* + * Set the type of the buffer for log recovery so that it can correctly identify + * and hence attach the correct buffer ops to the buffer after replay. + */ +void +xfs_trans_buf_set_type( +	struct xfs_trans	*tp, +	struct xfs_buf		*bp, +	uint			type) +{ +	struct xfs_buf_log_item	*bip = bp->b_fspriv; + +	ASSERT(bp->b_transp == tp); +	ASSERT(bip != NULL); +	ASSERT(atomic_read(&bip->bli_refcount) > 0); +	ASSERT((type & XFS_BLF_TYPE_MASK) != 0); + +	bip->__bli_format.blf_flags &= ~XFS_BLF_TYPE_MASK; +	bip->__bli_format.blf_flags |= type; +}  /*   * Similar to xfs_trans_inode_buf(), this marks the buffer as a cluster of @@ -769,14 +791,9 @@ xfs_trans_dquot_buf(  	xfs_buf_t	*bp,  	uint		type)  { -	xfs_buf_log_item_t	*bip = bp->b_fspriv; - -	ASSERT(bp->b_transp == tp); -	ASSERT(bip != NULL);  	ASSERT(type == XFS_BLF_UDQUOT_BUF ||  	       type == XFS_BLF_PDQUOT_BUF ||  	       type == XFS_BLF_GDQUOT_BUF); -	ASSERT(atomic_read(&bip->bli_refcount) > 0); -	bip->__bli_format.blf_flags |= type; +	xfs_trans_buf_set_type(tp, bp, type);  }  |