File tree Expand file tree Collapse file tree 6 files changed +19
-7
lines changed Expand file tree Collapse file tree 6 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -2989,7 +2989,7 @@ xfs_bmap_extsize_align(
2989
2989
* If realtime, and the result isn't a multiple of the realtime
2990
2990
* extent size we need to remove blocks until it is.
2991
2991
*/
2992
- if (rt && (temp = ( align_alen % mp -> m_sb . sb_rextsize ))) {
2992
+ if (rt && (temp = xfs_extlen_to_rtxmod ( mp , align_alen ))) {
2993
2993
/*
2994
2994
* We're not covering the original request, or
2995
2995
* we won't be able to once we fix the length.
@@ -3016,7 +3016,7 @@ xfs_bmap_extsize_align(
3016
3016
else {
3017
3017
align_alen -= orig_off - align_off ;
3018
3018
align_off = orig_off ;
3019
- align_alen -= align_alen % mp -> m_sb . sb_rextsize ;
3019
+ align_alen -= xfs_extlen_to_rtxmod ( mp , align_alen ) ;
3020
3020
}
3021
3021
/*
3022
3022
* 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(
22
22
return rtxlen * mp -> m_sb .sb_rextsize ;
23
23
}
24
24
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
+
25
34
/*
26
35
* Functions for walking free space rtextents in the realtime bitmap.
27
36
*/
Original file line number Diff line number Diff line change 20
20
#include "xfs_reflink.h"
21
21
#include "xfs_rmap.h"
22
22
#include "xfs_bmap_util.h"
23
+ #include "xfs_rtbitmap.h"
23
24
#include "scrub/scrub.h"
24
25
#include "scrub/common.h"
25
26
#include "scrub/btree.h"
@@ -225,7 +226,7 @@ xchk_inode_extsize(
225
226
*/
226
227
if ((flags & XFS_DIFLAG_RTINHERIT ) &&
227
228
(flags & XFS_DIFLAG_EXTSZINHERIT ) &&
228
- value % sc -> mp -> m_sb . sb_rextsize > 0 )
229
+ xfs_extlen_to_rtxmod ( sc -> mp , value ) > 0 )
229
230
xchk_ino_set_warning (sc , ino );
230
231
}
231
232
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ xfs_bmap_rtalloc(
97
97
if (error )
98
98
return error ;
99
99
ASSERT (ap -> length );
100
- ASSERT (ap -> length % mp -> m_sb . sb_rextsize == 0 );
100
+ ASSERT (xfs_extlen_to_rtxmod ( mp , ap -> length ) == 0 );
101
101
102
102
/*
103
103
* If we shifted the file offset downward to satisfy an extent size
Original file line number Diff line number Diff line change 19
19
#include "xfs_log.h"
20
20
#include "xfs_log_priv.h"
21
21
#include "xfs_error.h"
22
+ #include "xfs_rtbitmap.h"
22
23
23
24
#include <linux/iversion.h>
24
25
@@ -107,7 +108,7 @@ xfs_inode_item_precommit(
107
108
*/
108
109
if ((ip -> i_diflags & XFS_DIFLAG_RTINHERIT ) &&
109
110
(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 ) {
111
112
ip -> i_diflags &= ~(XFS_DIFLAG_EXTSIZE |
112
113
XFS_DIFLAG_EXTSZINHERIT );
113
114
ip -> i_extsize = 0 ;
Original file line number Diff line number Diff line change 38
38
#include "xfs_reflink.h"
39
39
#include "xfs_ioctl.h"
40
40
#include "xfs_xattr.h"
41
+ #include "xfs_rtbitmap.h"
41
42
42
43
#include <linux/mount.h>
43
44
#include <linux/namei.h>
@@ -1004,7 +1005,7 @@ xfs_fill_fsxattr(
1004
1005
* later.
1005
1006
*/
1006
1007
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 ) {
1008
1009
fa -> fsx_xflags &= ~(FS_XFLAG_EXTSIZE |
1009
1010
FS_XFLAG_EXTSZINHERIT );
1010
1011
fa -> fsx_extsize = 0 ;
@@ -1130,7 +1131,7 @@ xfs_ioctl_setattr_xflags(
1130
1131
/* If realtime flag is set then must have realtime device */
1131
1132
if (fa -> fsx_xflags & FS_XFLAG_REALTIME ) {
1132
1133
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 ))
1134
1135
return - EINVAL ;
1135
1136
}
1136
1137
You can’t perform that action at this time.
0 commit comments