diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-12-09 19:24:43 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:40:33 -0500 |
commit | 4311901daabe1d0f22cfcf86c57ad450f14b4e9f (patch) | |
tree | 1c4bfbbc288ca085bf58bfad339956ab4cc9a946 | |
parent | 512620f44df85df87348fc9a6fc54fcaa254b8d3 (diff) |
ocfs2: Pass value buf to ocfs2_remove_value_outside().
ocfs2_remove_value_outside() needs to know the type of buffer it is
looking at. Pass in an ocfs2_xattr_value_buf.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
-rw-r--r-- | fs/ocfs2/xattr.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index c08b5e8746c3..d2760e644751 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -1699,7 +1699,7 @@ out: | |||
1699 | } | 1699 | } |
1700 | 1700 | ||
1701 | static int ocfs2_remove_value_outside(struct inode*inode, | 1701 | static int ocfs2_remove_value_outside(struct inode*inode, |
1702 | struct buffer_head *bh, | 1702 | struct ocfs2_xattr_value_buf *vb, |
1703 | struct ocfs2_xattr_header *header) | 1703 | struct ocfs2_xattr_header *header) |
1704 | { | 1704 | { |
1705 | int ret = 0, i; | 1705 | int ret = 0, i; |
@@ -1720,17 +1720,13 @@ static int ocfs2_remove_value_outside(struct inode*inode, | |||
1720 | struct ocfs2_xattr_entry *entry = &header->xh_entries[i]; | 1720 | struct ocfs2_xattr_entry *entry = &header->xh_entries[i]; |
1721 | 1721 | ||
1722 | if (!ocfs2_xattr_is_local(entry)) { | 1722 | if (!ocfs2_xattr_is_local(entry)) { |
1723 | struct ocfs2_xattr_value_buf vb = { | ||
1724 | .vb_bh = bh, | ||
1725 | .vb_access = ocfs2_journal_access, | ||
1726 | }; | ||
1727 | void *val; | 1723 | void *val; |
1728 | 1724 | ||
1729 | val = (void *)header + | 1725 | val = (void *)header + |
1730 | le16_to_cpu(entry->xe_name_offset); | 1726 | le16_to_cpu(entry->xe_name_offset); |
1731 | vb.vb_xv = (struct ocfs2_xattr_value_root *) | 1727 | vb->vb_xv = (struct ocfs2_xattr_value_root *) |
1732 | (val + OCFS2_XATTR_SIZE(entry->xe_name_len)); | 1728 | (val + OCFS2_XATTR_SIZE(entry->xe_name_len)); |
1733 | ret = ocfs2_xattr_value_truncate(inode, &vb, 0, &ctxt); | 1729 | ret = ocfs2_xattr_value_truncate(inode, vb, 0, &ctxt); |
1734 | if (ret < 0) { | 1730 | if (ret < 0) { |
1735 | mlog_errno(ret); | 1731 | mlog_errno(ret); |
1736 | break; | 1732 | break; |
@@ -1752,12 +1748,16 @@ static int ocfs2_xattr_ibody_remove(struct inode *inode, | |||
1752 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; | 1748 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; |
1753 | struct ocfs2_xattr_header *header; | 1749 | struct ocfs2_xattr_header *header; |
1754 | int ret; | 1750 | int ret; |
1751 | struct ocfs2_xattr_value_buf vb = { | ||
1752 | .vb_bh = di_bh, | ||
1753 | .vb_access = ocfs2_journal_access_di, | ||
1754 | }; | ||
1755 | 1755 | ||
1756 | header = (struct ocfs2_xattr_header *) | 1756 | header = (struct ocfs2_xattr_header *) |
1757 | ((void *)di + inode->i_sb->s_blocksize - | 1757 | ((void *)di + inode->i_sb->s_blocksize - |
1758 | le16_to_cpu(di->i_xattr_inline_size)); | 1758 | le16_to_cpu(di->i_xattr_inline_size)); |
1759 | 1759 | ||
1760 | ret = ocfs2_remove_value_outside(inode, di_bh, header); | 1760 | ret = ocfs2_remove_value_outside(inode, &vb, header); |
1761 | 1761 | ||
1762 | return ret; | 1762 | return ret; |
1763 | } | 1763 | } |
@@ -1767,11 +1767,15 @@ static int ocfs2_xattr_block_remove(struct inode *inode, | |||
1767 | { | 1767 | { |
1768 | struct ocfs2_xattr_block *xb; | 1768 | struct ocfs2_xattr_block *xb; |
1769 | int ret = 0; | 1769 | int ret = 0; |
1770 | struct ocfs2_xattr_value_buf vb = { | ||
1771 | .vb_bh = blk_bh, | ||
1772 | .vb_access = ocfs2_journal_access_xb, | ||
1773 | }; | ||
1770 | 1774 | ||
1771 | xb = (struct ocfs2_xattr_block *)blk_bh->b_data; | 1775 | xb = (struct ocfs2_xattr_block *)blk_bh->b_data; |
1772 | if (!(le16_to_cpu(xb->xb_flags) & OCFS2_XATTR_INDEXED)) { | 1776 | if (!(le16_to_cpu(xb->xb_flags) & OCFS2_XATTR_INDEXED)) { |
1773 | struct ocfs2_xattr_header *header = &(xb->xb_attrs.xb_header); | 1777 | struct ocfs2_xattr_header *header = &(xb->xb_attrs.xb_header); |
1774 | ret = ocfs2_remove_value_outside(inode, blk_bh, header); | 1778 | ret = ocfs2_remove_value_outside(inode, &vb, header); |
1775 | } else | 1779 | } else |
1776 | ret = ocfs2_delete_xattr_index_block(inode, blk_bh); | 1780 | ret = ocfs2_delete_xattr_index_block(inode, blk_bh); |
1777 | 1781 | ||