Skip to content

Commit

Permalink
Merge branch 'xfs-libxfs-restructure' into for-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Chinner committed Jul 14, 2014
2 parents 03e0134 + 2451337 commit 7f8a058
Show file tree
Hide file tree
Showing 102 changed files with 1,180 additions and 1,212 deletions.
70 changes: 38 additions & 32 deletions fs/xfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#

ccflags-y += -I$(src) # needed for trace events
ccflags-y += -I$(src)/libxfs

ccflags-$(CONFIG_XFS_DEBUG) += -g

Expand All @@ -25,6 +26,39 @@ obj-$(CONFIG_XFS_FS) += xfs.o
# this one should be compiled first, as the tracing macros can easily blow up
xfs-y += xfs_trace.o

# build the libxfs code first
xfs-y += $(addprefix libxfs/, \
xfs_alloc.o \
xfs_alloc_btree.o \
xfs_attr.o \
xfs_attr_leaf.o \
xfs_attr_remote.o \
xfs_bmap.o \
xfs_bmap_btree.o \
xfs_btree.o \
xfs_da_btree.o \
xfs_da_format.o \
xfs_dir2.o \
xfs_dir2_block.o \
xfs_dir2_data.o \
xfs_dir2_leaf.o \
xfs_dir2_node.o \
xfs_dir2_sf.o \
xfs_dquot_buf.o \
xfs_ialloc.o \
xfs_ialloc_btree.o \
xfs_inode_fork.o \
xfs_inode_buf.o \
xfs_log_rlimit.o \
xfs_sb.o \
xfs_symlink_remote.o \
xfs_trans_resv.o \
)
# xfs_rtbitmap is shared with libxfs
xfs-$(CONFIG_XFS_RT) += $(addprefix libxfs/, \
xfs_rtbitmap.o \
)

# highlevel code
xfs-y += xfs_aops.o \
xfs_attr_inactive.o \
Expand All @@ -45,6 +79,7 @@ xfs-y += xfs_aops.o \
xfs_ioctl.o \
xfs_iomap.o \
xfs_iops.o \
xfs_inode.o \
xfs_itable.o \
xfs_message.o \
xfs_mount.o \
Expand All @@ -56,42 +91,14 @@ xfs-y += xfs_aops.o \
kmem.o \
uuid.o

# code shared with libxfs
xfs-y += xfs_alloc.o \
xfs_alloc_btree.o \
xfs_attr.o \
xfs_attr_leaf.o \
xfs_attr_remote.o \
xfs_bmap.o \
xfs_bmap_btree.o \
xfs_btree.o \
xfs_da_btree.o \
xfs_da_format.o \
xfs_dir2.o \
xfs_dir2_block.o \
xfs_dir2_data.o \
xfs_dir2_leaf.o \
xfs_dir2_node.o \
xfs_dir2_sf.o \
xfs_dquot_buf.o \
xfs_ialloc.o \
xfs_ialloc_btree.o \
xfs_icreate_item.o \
xfs_inode.o \
xfs_inode_fork.o \
xfs_inode_buf.o \
xfs_log_recover.o \
xfs_log_rlimit.o \
xfs_sb.o \
xfs_symlink_remote.o \
xfs_trans_resv.o

# low-level transaction/log code
xfs-y += xfs_log.o \
xfs_log_cil.o \
xfs_buf_item.o \
xfs_extfree_item.o \
xfs_icreate_item.o \
xfs_inode_item.o \
xfs_log_recover.o \
xfs_trans_ail.o \
xfs_trans_buf.o \
xfs_trans_extfree.o \
Expand All @@ -107,8 +114,7 @@ xfs-$(CONFIG_XFS_QUOTA) += xfs_dquot.o \
xfs_quotaops.o

# xfs_rtbitmap is shared with libxfs
xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o \
xfs_rtbitmap.o
xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o

xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o
xfs-$(CONFIG_PROC_FS) += xfs_stats.o
Expand Down
File renamed without changes.
20 changes: 10 additions & 10 deletions fs/xfs/xfs_alloc.c → fs/xfs/libxfs/xfs_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,9 @@ xfs_agfl_read_verify(
return;

if (!xfs_buf_verify_cksum(bp, XFS_AGFL_CRC_OFF))
xfs_buf_ioerror(bp, EFSBADCRC);
xfs_buf_ioerror(bp, -EFSBADCRC);
else if (!xfs_agfl_verify(bp))
xfs_buf_ioerror(bp, EFSCORRUPTED);
xfs_buf_ioerror(bp, -EFSCORRUPTED);

if (bp->b_error)
xfs_verifier_error(bp);
Expand All @@ -503,7 +503,7 @@ xfs_agfl_write_verify(
return;

if (!xfs_agfl_verify(bp)) {
xfs_buf_ioerror(bp, EFSCORRUPTED);
xfs_buf_ioerror(bp, -EFSCORRUPTED);
xfs_verifier_error(bp);
return;
}
Expand Down Expand Up @@ -559,7 +559,7 @@ xfs_alloc_update_counters(
xfs_trans_agblocks_delta(tp, len);
if (unlikely(be32_to_cpu(agf->agf_freeblks) >
be32_to_cpu(agf->agf_length)))
return EFSCORRUPTED;
return -EFSCORRUPTED;

xfs_alloc_log_agf(tp, agbp, XFS_AGF_FREEBLKS);
return 0;
Expand Down Expand Up @@ -2234,11 +2234,11 @@ xfs_agf_read_verify(

if (xfs_sb_version_hascrc(&mp->m_sb) &&
!xfs_buf_verify_cksum(bp, XFS_AGF_CRC_OFF))
xfs_buf_ioerror(bp, EFSBADCRC);
xfs_buf_ioerror(bp, -EFSBADCRC);
else if (XFS_TEST_ERROR(!xfs_agf_verify(mp, bp), mp,
XFS_ERRTAG_ALLOC_READ_AGF,
XFS_RANDOM_ALLOC_READ_AGF))
xfs_buf_ioerror(bp, EFSCORRUPTED);
xfs_buf_ioerror(bp, -EFSCORRUPTED);

if (bp->b_error)
xfs_verifier_error(bp);
Expand All @@ -2252,7 +2252,7 @@ xfs_agf_write_verify(
struct xfs_buf_log_item *bip = bp->b_fspriv;

if (!xfs_agf_verify(mp, bp)) {
xfs_buf_ioerror(bp, EFSCORRUPTED);
xfs_buf_ioerror(bp, -EFSCORRUPTED);
xfs_verifier_error(bp);
return;
}
Expand Down Expand Up @@ -2601,11 +2601,11 @@ xfs_free_extent(
*/
args.agno = XFS_FSB_TO_AGNO(args.mp, bno);
if (args.agno >= args.mp->m_sb.sb_agcount)
return EFSCORRUPTED;
return -EFSCORRUPTED;

args.agbno = XFS_FSB_TO_AGBNO(args.mp, bno);
if (args.agbno >= args.mp->m_sb.sb_agblocks)
return EFSCORRUPTED;
return -EFSCORRUPTED;

args.pag = xfs_perag_get(args.mp, args.agno);
ASSERT(args.pag);
Expand All @@ -2617,7 +2617,7 @@ xfs_free_extent(
/* validate the extent size is legal now we have the agf locked */
if (args.agbno + len >
be32_to_cpu(XFS_BUF_TO_AGF(args.agbp)->agf_length)) {
error = EFSCORRUPTED;
error = -EFSCORRUPTED;
goto error0;
}

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions fs/xfs/xfs_alloc_btree.c → fs/xfs/libxfs/xfs_alloc_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ xfs_allocbt_read_verify(
struct xfs_buf *bp)
{
if (!xfs_btree_sblock_verify_crc(bp))
xfs_buf_ioerror(bp, EFSBADCRC);
xfs_buf_ioerror(bp, -EFSBADCRC);
else if (!xfs_allocbt_verify(bp))
xfs_buf_ioerror(bp, EFSCORRUPTED);
xfs_buf_ioerror(bp, -EFSCORRUPTED);

if (bp->b_error) {
trace_xfs_btree_corrupt(bp, _RET_IP_);
Expand All @@ -371,7 +371,7 @@ xfs_allocbt_write_verify(
{
if (!xfs_allocbt_verify(bp)) {
trace_xfs_btree_corrupt(bp, _RET_IP_);
xfs_buf_ioerror(bp, EFSCORRUPTED);
xfs_buf_ioerror(bp, -EFSCORRUPTED);
xfs_verifier_error(bp);
return;
}
Expand Down
File renamed without changes.
Loading

0 comments on commit 7f8a058

Please sign in to comment.