47
47
* Each contiguous block has a header, so it is not just a simple attribute
48
48
* length to FSB conversion.
49
49
*/
50
- int
50
+ unsigned int
51
51
xfs_attr3_rmt_blocks (
52
- struct xfs_mount * mp ,
53
- int attrlen )
52
+ struct xfs_mount * mp ,
53
+ unsigned int attrlen )
54
54
{
55
55
if (xfs_has_crc (mp )) {
56
- int buflen = XFS_ATTR3_RMT_BUF_SPACE (mp , mp -> m_sb .sb_blocksize );
56
+ unsigned int buflen = XFS_ATTR3_RMT_BUF_SPACE (mp , mp -> m_sb .sb_blocksize );
57
57
return (attrlen + buflen - 1 ) / buflen ;
58
58
}
59
59
return XFS_B_TO_FSB (mp , attrlen );
@@ -92,7 +92,6 @@ xfs_attr3_rmt_verify(
92
92
struct xfs_mount * mp ,
93
93
struct xfs_buf * bp ,
94
94
void * ptr ,
95
- int fsbsize ,
96
95
xfs_daddr_t bno )
97
96
{
98
97
struct xfs_attr3_rmt_hdr * rmt = ptr ;
@@ -103,7 +102,7 @@ xfs_attr3_rmt_verify(
103
102
return __this_address ;
104
103
if (be64_to_cpu (rmt -> rm_blkno ) != bno )
105
104
return __this_address ;
106
- if (be32_to_cpu (rmt -> rm_bytes ) > fsbsize - sizeof (* rmt ))
105
+ if (be32_to_cpu (rmt -> rm_bytes ) > mp -> m_attr_geo -> blksize - sizeof (* rmt ))
107
106
return __this_address ;
108
107
if (be32_to_cpu (rmt -> rm_offset ) +
109
108
be32_to_cpu (rmt -> rm_bytes ) > XFS_XATTR_SIZE_MAX )
@@ -122,9 +121,9 @@ __xfs_attr3_rmt_read_verify(
122
121
{
123
122
struct xfs_mount * mp = bp -> b_mount ;
124
123
char * ptr ;
125
- int len ;
124
+ unsigned int len ;
126
125
xfs_daddr_t bno ;
127
- int blksize = mp -> m_attr_geo -> blksize ;
126
+ unsigned int blksize = mp -> m_attr_geo -> blksize ;
128
127
129
128
/* no verification of non-crc buffers */
130
129
if (!xfs_has_crc (mp ))
@@ -141,7 +140,7 @@ __xfs_attr3_rmt_read_verify(
141
140
* failaddr = __this_address ;
142
141
return - EFSBADCRC ;
143
142
}
144
- * failaddr = xfs_attr3_rmt_verify (mp , bp , ptr , blksize , bno );
143
+ * failaddr = xfs_attr3_rmt_verify (mp , bp , ptr , bno );
145
144
if (* failaddr )
146
145
return - EFSCORRUPTED ;
147
146
len -= blksize ;
@@ -186,7 +185,7 @@ xfs_attr3_rmt_write_verify(
186
185
{
187
186
struct xfs_mount * mp = bp -> b_mount ;
188
187
xfs_failaddr_t fa ;
189
- int blksize = mp -> m_attr_geo -> blksize ;
188
+ unsigned int blksize = mp -> m_attr_geo -> blksize ;
190
189
char * ptr ;
191
190
int len ;
192
191
xfs_daddr_t bno ;
@@ -203,7 +202,7 @@ xfs_attr3_rmt_write_verify(
203
202
while (len > 0 ) {
204
203
struct xfs_attr3_rmt_hdr * rmt = (struct xfs_attr3_rmt_hdr * )ptr ;
205
204
206
- fa = xfs_attr3_rmt_verify (mp , bp , ptr , blksize , bno );
205
+ fa = xfs_attr3_rmt_verify (mp , bp , ptr , bno );
207
206
if (fa ) {
208
207
xfs_verifier_error (bp , - EFSCORRUPTED , fa );
209
208
return ;
@@ -281,20 +280,20 @@ xfs_attr_rmtval_copyout(
281
280
struct xfs_buf * bp ,
282
281
struct xfs_inode * dp ,
283
282
xfs_ino_t owner ,
284
- int * offset ,
285
- int * valuelen ,
283
+ unsigned int * offset ,
284
+ unsigned int * valuelen ,
286
285
uint8_t * * dst )
287
286
{
288
287
char * src = bp -> b_addr ;
289
288
xfs_daddr_t bno = xfs_buf_daddr (bp );
290
- int len = BBTOB (bp -> b_length );
291
- int blksize = mp -> m_attr_geo -> blksize ;
289
+ unsigned int len = BBTOB (bp -> b_length );
290
+ unsigned int blksize = mp -> m_attr_geo -> blksize ;
292
291
293
292
ASSERT (len >= blksize );
294
293
295
294
while (len > 0 && * valuelen > 0 ) {
296
- int hdr_size = 0 ;
297
- int byte_cnt = XFS_ATTR3_RMT_BUF_SPACE (mp , blksize );
295
+ unsigned int hdr_size = 0 ;
296
+ unsigned int byte_cnt = XFS_ATTR3_RMT_BUF_SPACE (mp , blksize );
298
297
299
298
byte_cnt = min (* valuelen , byte_cnt );
300
299
@@ -330,20 +329,20 @@ xfs_attr_rmtval_copyin(
330
329
struct xfs_mount * mp ,
331
330
struct xfs_buf * bp ,
332
331
xfs_ino_t ino ,
333
- int * offset ,
334
- int * valuelen ,
332
+ unsigned int * offset ,
333
+ unsigned int * valuelen ,
335
334
uint8_t * * src )
336
335
{
337
336
char * dst = bp -> b_addr ;
338
337
xfs_daddr_t bno = xfs_buf_daddr (bp );
339
- int len = BBTOB (bp -> b_length );
340
- int blksize = mp -> m_attr_geo -> blksize ;
338
+ unsigned int len = BBTOB (bp -> b_length );
339
+ unsigned int blksize = mp -> m_attr_geo -> blksize ;
341
340
342
341
ASSERT (len >= blksize );
343
342
344
343
while (len > 0 && * valuelen > 0 ) {
345
- int hdr_size ;
346
- int byte_cnt = XFS_ATTR3_RMT_BUF_SPACE (mp , blksize );
344
+ unsigned int hdr_size ;
345
+ unsigned int byte_cnt = XFS_ATTR3_RMT_BUF_SPACE (mp , blksize );
347
346
348
347
byte_cnt = min (* valuelen , byte_cnt );
349
348
hdr_size = xfs_attr3_rmt_hdr_set (mp , dst , ino , * offset ,
@@ -389,12 +388,12 @@ xfs_attr_rmtval_get(
389
388
struct xfs_buf * bp ;
390
389
xfs_dablk_t lblkno = args -> rmtblkno ;
391
390
uint8_t * dst = args -> value ;
392
- int valuelen ;
391
+ unsigned int valuelen ;
393
392
int nmap ;
394
393
int error ;
395
- int blkcnt = args -> rmtblkcnt ;
394
+ unsigned int blkcnt = args -> rmtblkcnt ;
396
395
int i ;
397
- int offset = 0 ;
396
+ unsigned int offset = 0 ;
398
397
399
398
trace_xfs_attr_rmtval_get (args );
400
399
@@ -452,7 +451,7 @@ xfs_attr_rmt_find_hole(
452
451
struct xfs_inode * dp = args -> dp ;
453
452
struct xfs_mount * mp = dp -> i_mount ;
454
453
int error ;
455
- int blkcnt ;
454
+ unsigned int blkcnt ;
456
455
xfs_fileoff_t lfileoff = 0 ;
457
456
458
457
/*
@@ -481,11 +480,11 @@ xfs_attr_rmtval_set_value(
481
480
struct xfs_bmbt_irec map ;
482
481
xfs_dablk_t lblkno ;
483
482
uint8_t * src = args -> value ;
484
- int blkcnt ;
485
- int valuelen ;
483
+ unsigned int blkcnt ;
484
+ unsigned int valuelen ;
486
485
int nmap ;
487
486
int error ;
488
- int offset = 0 ;
487
+ unsigned int offset = 0 ;
489
488
490
489
/*
491
490
* Roll through the "value", copying the attribute value to the
@@ -644,7 +643,7 @@ xfs_attr_rmtval_invalidate(
644
643
struct xfs_da_args * args )
645
644
{
646
645
xfs_dablk_t lblkno ;
647
- int blkcnt ;
646
+ unsigned int blkcnt ;
648
647
int error ;
649
648
650
649
/*
0 commit comments