-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xfs: introduce rmap extent operation stubs
Originally-From: Dave Chinner <dchinner@redhat.com> Add the stubs into the extent allocation and freeing paths that the rmap btree implementation will hook into. While doing this, add the trace points that will be used to track rmap btree extent manipulations. [darrick.wong@oracle.com: Extend the stubs to take full owner info.] Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
- Loading branch information
Darrick J. Wong
authored and
Dave Chinner
committed
Aug 3, 2016
1 parent
340785c
commit 673930c
Showing
5 changed files
with
195 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright (c) 2014 Red Hat, Inc. | ||
* All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it would be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
#include "xfs.h" | ||
#include "xfs_fs.h" | ||
#include "xfs_shared.h" | ||
#include "xfs_format.h" | ||
#include "xfs_log_format.h" | ||
#include "xfs_trans_resv.h" | ||
#include "xfs_bit.h" | ||
#include "xfs_sb.h" | ||
#include "xfs_mount.h" | ||
#include "xfs_defer.h" | ||
#include "xfs_da_format.h" | ||
#include "xfs_da_btree.h" | ||
#include "xfs_btree.h" | ||
#include "xfs_trans.h" | ||
#include "xfs_alloc.h" | ||
#include "xfs_rmap.h" | ||
#include "xfs_trans_space.h" | ||
#include "xfs_trace.h" | ||
#include "xfs_error.h" | ||
#include "xfs_extent_busy.h" | ||
|
||
int | ||
xfs_rmap_free( | ||
struct xfs_trans *tp, | ||
struct xfs_buf *agbp, | ||
xfs_agnumber_t agno, | ||
xfs_agblock_t bno, | ||
xfs_extlen_t len, | ||
struct xfs_owner_info *oinfo) | ||
{ | ||
struct xfs_mount *mp = tp->t_mountp; | ||
int error = 0; | ||
|
||
if (!xfs_sb_version_hasrmapbt(&mp->m_sb)) | ||
return 0; | ||
|
||
trace_xfs_rmap_unmap(mp, agno, bno, len, false, oinfo); | ||
if (1) | ||
goto out_error; | ||
trace_xfs_rmap_unmap_done(mp, agno, bno, len, false, oinfo); | ||
return 0; | ||
|
||
out_error: | ||
trace_xfs_rmap_unmap_error(mp, agno, error, _RET_IP_); | ||
return error; | ||
} | ||
|
||
int | ||
xfs_rmap_alloc( | ||
struct xfs_trans *tp, | ||
struct xfs_buf *agbp, | ||
xfs_agnumber_t agno, | ||
xfs_agblock_t bno, | ||
xfs_extlen_t len, | ||
struct xfs_owner_info *oinfo) | ||
{ | ||
struct xfs_mount *mp = tp->t_mountp; | ||
int error = 0; | ||
|
||
if (!xfs_sb_version_hasrmapbt(&mp->m_sb)) | ||
return 0; | ||
|
||
trace_xfs_rmap_map(mp, agno, bno, len, false, oinfo); | ||
if (1) | ||
goto out_error; | ||
trace_xfs_rmap_map_done(mp, agno, bno, len, false, oinfo); | ||
return 0; | ||
|
||
out_error: | ||
trace_xfs_rmap_map_error(mp, agno, error, _RET_IP_); | ||
return error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters