@@ -1332,8 +1332,14 @@ struct dentry_info_args {
1332
1332
char * dname ;
1333
1333
};
1334
1334
1335
+ /* Same as struct ext4_fc_tl, but uses native endianness fields */
1336
+ struct ext4_fc_tl_mem {
1337
+ u16 fc_tag ;
1338
+ u16 fc_len ;
1339
+ };
1340
+
1335
1341
static inline void tl_to_darg (struct dentry_info_args * darg ,
1336
- struct ext4_fc_tl * tl , u8 * val )
1342
+ struct ext4_fc_tl_mem * tl , u8 * val )
1337
1343
{
1338
1344
struct ext4_fc_dentry_info fcd ;
1339
1345
@@ -1345,16 +1351,18 @@ static inline void tl_to_darg(struct dentry_info_args *darg,
1345
1351
darg -> dname_len = tl -> fc_len - sizeof (struct ext4_fc_dentry_info );
1346
1352
}
1347
1353
1348
- static inline void ext4_fc_get_tl (struct ext4_fc_tl * tl , u8 * val )
1354
+ static inline void ext4_fc_get_tl (struct ext4_fc_tl_mem * tl , u8 * val )
1349
1355
{
1350
- memcpy (tl , val , EXT4_FC_TAG_BASE_LEN );
1351
- tl -> fc_len = le16_to_cpu (tl -> fc_len );
1352
- tl -> fc_tag = le16_to_cpu (tl -> fc_tag );
1356
+ struct ext4_fc_tl tl_disk ;
1357
+
1358
+ memcpy (& tl_disk , val , EXT4_FC_TAG_BASE_LEN );
1359
+ tl -> fc_len = le16_to_cpu (tl_disk .fc_len );
1360
+ tl -> fc_tag = le16_to_cpu (tl_disk .fc_tag );
1353
1361
}
1354
1362
1355
1363
/* Unlink replay function */
1356
- static int ext4_fc_replay_unlink (struct super_block * sb , struct ext4_fc_tl * tl ,
1357
- u8 * val )
1364
+ static int ext4_fc_replay_unlink (struct super_block * sb ,
1365
+ struct ext4_fc_tl_mem * tl , u8 * val )
1358
1366
{
1359
1367
struct inode * inode , * old_parent ;
1360
1368
struct qstr entry ;
@@ -1451,8 +1459,8 @@ static int ext4_fc_replay_link_internal(struct super_block *sb,
1451
1459
}
1452
1460
1453
1461
/* Link replay function */
1454
- static int ext4_fc_replay_link (struct super_block * sb , struct ext4_fc_tl * tl ,
1455
- u8 * val )
1462
+ static int ext4_fc_replay_link (struct super_block * sb ,
1463
+ struct ext4_fc_tl_mem * tl , u8 * val )
1456
1464
{
1457
1465
struct inode * inode ;
1458
1466
struct dentry_info_args darg ;
@@ -1506,8 +1514,8 @@ static int ext4_fc_record_modified_inode(struct super_block *sb, int ino)
1506
1514
/*
1507
1515
* Inode replay function
1508
1516
*/
1509
- static int ext4_fc_replay_inode (struct super_block * sb , struct ext4_fc_tl * tl ,
1510
- u8 * val )
1517
+ static int ext4_fc_replay_inode (struct super_block * sb ,
1518
+ struct ext4_fc_tl_mem * tl , u8 * val )
1511
1519
{
1512
1520
struct ext4_fc_inode fc_inode ;
1513
1521
struct ext4_inode * raw_inode ;
@@ -1609,8 +1617,8 @@ static int ext4_fc_replay_inode(struct super_block *sb, struct ext4_fc_tl *tl,
1609
1617
* inode for which we are trying to create a dentry here, should already have
1610
1618
* been replayed before we start here.
1611
1619
*/
1612
- static int ext4_fc_replay_create (struct super_block * sb , struct ext4_fc_tl * tl ,
1613
- u8 * val )
1620
+ static int ext4_fc_replay_create (struct super_block * sb ,
1621
+ struct ext4_fc_tl_mem * tl , u8 * val )
1614
1622
{
1615
1623
int ret = 0 ;
1616
1624
struct inode * inode = NULL ;
@@ -1708,7 +1716,7 @@ int ext4_fc_record_regions(struct super_block *sb, int ino,
1708
1716
1709
1717
/* Replay add range tag */
1710
1718
static int ext4_fc_replay_add_range (struct super_block * sb ,
1711
- struct ext4_fc_tl * tl , u8 * val )
1719
+ struct ext4_fc_tl_mem * tl , u8 * val )
1712
1720
{
1713
1721
struct ext4_fc_add_range fc_add_ex ;
1714
1722
struct ext4_extent newex , * ex ;
@@ -1828,8 +1836,8 @@ static int ext4_fc_replay_add_range(struct super_block *sb,
1828
1836
1829
1837
/* Replay DEL_RANGE tag */
1830
1838
static int
1831
- ext4_fc_replay_del_range (struct super_block * sb , struct ext4_fc_tl * tl ,
1832
- u8 * val )
1839
+ ext4_fc_replay_del_range (struct super_block * sb ,
1840
+ struct ext4_fc_tl_mem * tl , u8 * val )
1833
1841
{
1834
1842
struct inode * inode ;
1835
1843
struct ext4_fc_del_range lrange ;
@@ -2025,7 +2033,7 @@ static int ext4_fc_replay_scan(journal_t *journal,
2025
2033
struct ext4_fc_replay_state * state ;
2026
2034
int ret = JBD2_FC_REPLAY_CONTINUE ;
2027
2035
struct ext4_fc_add_range ext ;
2028
- struct ext4_fc_tl tl ;
2036
+ struct ext4_fc_tl_mem tl ;
2029
2037
struct ext4_fc_tail tail ;
2030
2038
__u8 * start , * end , * cur , * val ;
2031
2039
struct ext4_fc_head head ;
@@ -2144,7 +2152,7 @@ static int ext4_fc_replay(journal_t *journal, struct buffer_head *bh,
2144
2152
{
2145
2153
struct super_block * sb = journal -> j_private ;
2146
2154
struct ext4_sb_info * sbi = EXT4_SB (sb );
2147
- struct ext4_fc_tl tl ;
2155
+ struct ext4_fc_tl_mem tl ;
2148
2156
__u8 * start , * end , * cur , * val ;
2149
2157
int ret = JBD2_FC_REPLAY_CONTINUE ;
2150
2158
struct ext4_fc_replay_state * state = & sbi -> s_fc_replay_state ;
0 commit comments