File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2989,7 +2989,7 @@ xfs_bmap_extsize_align(
29892989 * If realtime, and the result isn't a multiple of the realtime
29902990 * extent size we need to remove blocks until it is.
29912991 */
2992- if (rt && (temp = ( align_alen % mp -> m_sb . sb_rextsize ))) {
2992+ if (rt && (temp = xfs_extlen_to_rtxmod ( mp , align_alen ))) {
29932993 /*
29942994 * We're not covering the original request, or
29952995 * we won't be able to once we fix the length.
@@ -3016,7 +3016,7 @@ xfs_bmap_extsize_align(
30163016 else {
30173017 align_alen -= orig_off - align_off ;
30183018 align_off = orig_off ;
3019- align_alen -= align_alen % mp -> m_sb . sb_rextsize ;
3019+ align_alen -= xfs_extlen_to_rtxmod ( mp , align_alen ) ;
30203020 }
30213021 /*
30223022 * Result doesn't cover the request, fail it.
Original file line number Diff line number Diff line change @@ -22,6 +22,15 @@ xfs_rtxlen_to_extlen(
2222 return rtxlen * mp -> m_sb .sb_rextsize ;
2323}
2424
25+ /* Compute the misalignment between an extent length and a realtime extent .*/
26+ static inline unsigned int
27+ xfs_extlen_to_rtxmod (
28+ struct xfs_mount * mp ,
29+ xfs_extlen_t len )
30+ {
31+ return len % mp -> m_sb .sb_rextsize ;
32+ }
33+
2534/*
2635 * Functions for walking free space rtextents in the realtime bitmap.
2736 */
Original file line number Diff line number Diff line change 2020#include "xfs_reflink.h"
2121#include "xfs_rmap.h"
2222#include "xfs_bmap_util.h"
23+ #include "xfs_rtbitmap.h"
2324#include "scrub/scrub.h"
2425#include "scrub/common.h"
2526#include "scrub/btree.h"
@@ -225,7 +226,7 @@ xchk_inode_extsize(
225226 */
226227 if ((flags & XFS_DIFLAG_RTINHERIT ) &&
227228 (flags & XFS_DIFLAG_EXTSZINHERIT ) &&
228- value % sc -> mp -> m_sb . sb_rextsize > 0 )
229+ xfs_extlen_to_rtxmod ( sc -> mp , value ) > 0 )
229230 xchk_ino_set_warning (sc , ino );
230231}
231232
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ xfs_bmap_rtalloc(
9797 if (error )
9898 return error ;
9999 ASSERT (ap -> length );
100- ASSERT (ap -> length % mp -> m_sb . sb_rextsize == 0 );
100+ ASSERT (xfs_extlen_to_rtxmod ( mp , ap -> length ) == 0 );
101101
102102 /*
103103 * If we shifted the file offset downward to satisfy an extent size
Original file line number Diff line number Diff line change 1919#include "xfs_log.h"
2020#include "xfs_log_priv.h"
2121#include "xfs_error.h"
22+ #include "xfs_rtbitmap.h"
2223
2324#include <linux/iversion.h>
2425
@@ -107,7 +108,7 @@ xfs_inode_item_precommit(
107108 */
108109 if ((ip -> i_diflags & XFS_DIFLAG_RTINHERIT ) &&
109110 (ip -> i_diflags & XFS_DIFLAG_EXTSZINHERIT ) &&
110- (ip -> i_extsize % ip -> i_mount -> m_sb . sb_rextsize ) > 0 ) {
111+ xfs_extlen_to_rtxmod (ip -> i_mount , ip -> i_extsize ) > 0 ) {
111112 ip -> i_diflags &= ~(XFS_DIFLAG_EXTSIZE |
112113 XFS_DIFLAG_EXTSZINHERIT );
113114 ip -> i_extsize = 0 ;
Original file line number Diff line number Diff line change 3838#include "xfs_reflink.h"
3939#include "xfs_ioctl.h"
4040#include "xfs_xattr.h"
41+ #include "xfs_rtbitmap.h"
4142
4243#include <linux/mount.h>
4344#include <linux/namei.h>
@@ -1004,7 +1005,7 @@ xfs_fill_fsxattr(
10041005 * later.
10051006 */
10061007 if ((ip -> i_diflags & XFS_DIFLAG_RTINHERIT ) &&
1007- ip -> i_extsize % mp -> m_sb . sb_rextsize > 0 ) {
1008+ xfs_extlen_to_rtxmod ( mp , ip -> i_extsize ) > 0 ) {
10081009 fa -> fsx_xflags &= ~(FS_XFLAG_EXTSIZE |
10091010 FS_XFLAG_EXTSZINHERIT );
10101011 fa -> fsx_extsize = 0 ;
@@ -1130,7 +1131,7 @@ xfs_ioctl_setattr_xflags(
11301131 /* If realtime flag is set then must have realtime device */
11311132 if (fa -> fsx_xflags & FS_XFLAG_REALTIME ) {
11321133 if (mp -> m_sb .sb_rblocks == 0 || mp -> m_sb .sb_rextsize == 0 ||
1133- ( ip -> i_extsize % mp -> m_sb . sb_rextsize ))
1134+ xfs_extlen_to_rtxmod ( mp , ip -> i_extsize ))
11341135 return - EINVAL ;
11351136 }
11361137
You can’t perform that action at this time.
0 commit comments