@@ -64,7 +64,6 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent
64
64
{
65
65
int i , dentries_per_clu , dentries_per_clu_bits = 0 , num_ext ;
66
66
unsigned int type , clu_offset , max_dentries ;
67
- sector_t sector ;
68
67
struct exfat_chain dir , clu ;
69
68
struct exfat_uni_name uni_name ;
70
69
struct exfat_dentry * ep ;
@@ -115,7 +114,7 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent
115
114
i = dentry & (dentries_per_clu - 1 );
116
115
117
116
for ( ; i < dentries_per_clu ; i ++ , dentry ++ ) {
118
- ep = exfat_get_dentry (sb , & clu , i , & bh , & sector );
117
+ ep = exfat_get_dentry (sb , & clu , i , & bh );
119
118
if (!ep )
120
119
return - EIO ;
121
120
@@ -156,7 +155,7 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent
156
155
dir_entry -> namebuf .lfnbuf_len );
157
156
brelse (bh );
158
157
159
- ep = exfat_get_dentry (sb , & clu , i + 1 , & bh , NULL );
158
+ ep = exfat_get_dentry (sb , & clu , i + 1 , & bh );
160
159
if (!ep )
161
160
return - EIO ;
162
161
dir_entry -> size =
@@ -445,15 +444,14 @@ int exfat_init_dir_entry(struct inode *inode, struct exfat_chain *p_dir,
445
444
struct super_block * sb = inode -> i_sb ;
446
445
struct exfat_sb_info * sbi = EXFAT_SB (sb );
447
446
struct timespec64 ts = current_time (inode );
448
- sector_t sector ;
449
447
struct exfat_dentry * ep ;
450
448
struct buffer_head * bh ;
451
449
452
450
/*
453
451
* We cannot use exfat_get_dentry_set here because file ep is not
454
452
* initialized yet.
455
453
*/
456
- ep = exfat_get_dentry (sb , p_dir , entry , & bh , & sector );
454
+ ep = exfat_get_dentry (sb , p_dir , entry , & bh );
457
455
if (!ep )
458
456
return - EIO ;
459
457
@@ -477,7 +475,7 @@ int exfat_init_dir_entry(struct inode *inode, struct exfat_chain *p_dir,
477
475
exfat_update_bh (bh , IS_DIRSYNC (inode ));
478
476
brelse (bh );
479
477
480
- ep = exfat_get_dentry (sb , p_dir , entry + 1 , & bh , & sector );
478
+ ep = exfat_get_dentry (sb , p_dir , entry + 1 , & bh );
481
479
if (!ep )
482
480
return - EIO ;
483
481
@@ -496,20 +494,19 @@ int exfat_update_dir_chksum(struct inode *inode, struct exfat_chain *p_dir,
496
494
struct super_block * sb = inode -> i_sb ;
497
495
int ret = 0 ;
498
496
int i , num_entries ;
499
- sector_t sector ;
500
497
u16 chksum ;
501
498
struct exfat_dentry * ep , * fep ;
502
499
struct buffer_head * fbh , * bh ;
503
500
504
- fep = exfat_get_dentry (sb , p_dir , entry , & fbh , & sector );
501
+ fep = exfat_get_dentry (sb , p_dir , entry , & fbh );
505
502
if (!fep )
506
503
return - EIO ;
507
504
508
505
num_entries = fep -> dentry .file .num_ext + 1 ;
509
506
chksum = exfat_calc_chksum16 (fep , DENTRY_SIZE , 0 , CS_DIR_ENTRY );
510
507
511
508
for (i = 1 ; i < num_entries ; i ++ ) {
512
- ep = exfat_get_dentry (sb , p_dir , entry + i , & bh , NULL );
509
+ ep = exfat_get_dentry (sb , p_dir , entry + i , & bh );
513
510
if (!ep ) {
514
511
ret = - EIO ;
515
512
goto release_fbh ;
@@ -531,21 +528,20 @@ int exfat_init_ext_entry(struct inode *inode, struct exfat_chain *p_dir,
531
528
{
532
529
struct super_block * sb = inode -> i_sb ;
533
530
int i ;
534
- sector_t sector ;
535
531
unsigned short * uniname = p_uniname -> name ;
536
532
struct exfat_dentry * ep ;
537
533
struct buffer_head * bh ;
538
534
int sync = IS_DIRSYNC (inode );
539
535
540
- ep = exfat_get_dentry (sb , p_dir , entry , & bh , & sector );
536
+ ep = exfat_get_dentry (sb , p_dir , entry , & bh );
541
537
if (!ep )
542
538
return - EIO ;
543
539
544
540
ep -> dentry .file .num_ext = (unsigned char )(num_entries - 1 );
545
541
exfat_update_bh (bh , sync );
546
542
brelse (bh );
547
543
548
- ep = exfat_get_dentry (sb , p_dir , entry + 1 , & bh , & sector );
544
+ ep = exfat_get_dentry (sb , p_dir , entry + 1 , & bh );
549
545
if (!ep )
550
546
return - EIO ;
551
547
@@ -555,7 +551,7 @@ int exfat_init_ext_entry(struct inode *inode, struct exfat_chain *p_dir,
555
551
brelse (bh );
556
552
557
553
for (i = EXFAT_FIRST_CLUSTER ; i < num_entries ; i ++ ) {
558
- ep = exfat_get_dentry (sb , p_dir , entry + i , & bh , & sector );
554
+ ep = exfat_get_dentry (sb , p_dir , entry + i , & bh );
559
555
if (!ep )
560
556
return - EIO ;
561
557
@@ -574,12 +570,11 @@ int exfat_remove_entries(struct inode *inode, struct exfat_chain *p_dir,
574
570
{
575
571
struct super_block * sb = inode -> i_sb ;
576
572
int i ;
577
- sector_t sector ;
578
573
struct exfat_dentry * ep ;
579
574
struct buffer_head * bh ;
580
575
581
576
for (i = order ; i < num_entries ; i ++ ) {
582
- ep = exfat_get_dentry (sb , p_dir , entry + i , & bh , & sector );
577
+ ep = exfat_get_dentry (sb , p_dir , entry + i , & bh );
583
578
if (!ep )
584
579
return - EIO ;
585
580
@@ -656,8 +651,8 @@ static int exfat_walk_fat_chain(struct super_block *sb,
656
651
return 0 ;
657
652
}
658
653
659
- int exfat_find_location (struct super_block * sb , struct exfat_chain * p_dir ,
660
- int entry , sector_t * sector , int * offset )
654
+ static int exfat_find_location (struct super_block * sb , struct exfat_chain * p_dir ,
655
+ int entry , sector_t * sector , int * offset )
661
656
{
662
657
int ret ;
663
658
unsigned int off , clu = 0 ;
@@ -717,8 +712,7 @@ static int exfat_dir_readahead(struct super_block *sb, sector_t sec)
717
712
}
718
713
719
714
struct exfat_dentry * exfat_get_dentry (struct super_block * sb ,
720
- struct exfat_chain * p_dir , int entry , struct buffer_head * * bh ,
721
- sector_t * sector )
715
+ struct exfat_chain * p_dir , int entry , struct buffer_head * * bh )
722
716
{
723
717
unsigned int dentries_per_page = EXFAT_B_TO_DEN (PAGE_SIZE );
724
718
int off ;
@@ -740,8 +734,6 @@ struct exfat_dentry *exfat_get_dentry(struct super_block *sb,
740
734
if (!* bh )
741
735
return NULL ;
742
736
743
- if (sector )
744
- * sector = sec ;
745
737
return (struct exfat_dentry * )((* bh )-> b_data + off );
746
738
}
747
739
@@ -892,7 +884,7 @@ struct exfat_entry_set_cache *exfat_get_dentry_set(struct super_block *sb,
892
884
es -> bh [es -> num_bh ++ ] = bh ;
893
885
}
894
886
895
- /* validiate cached dentries */
887
+ /* validate cached dentries */
896
888
for (i = 1 ; i < num_entries ; i ++ ) {
897
889
ep = exfat_get_dentry_cached (es , i );
898
890
if (!exfat_validate_entry (exfat_get_entry_type (ep ), & mode ))
@@ -960,7 +952,7 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
960
952
if (rewind && dentry == end_eidx )
961
953
goto not_found ;
962
954
963
- ep = exfat_get_dentry (sb , & clu , i , & bh , NULL );
955
+ ep = exfat_get_dentry (sb , & clu , i , & bh );
964
956
if (!ep )
965
957
return - EIO ;
966
958
@@ -1145,7 +1137,7 @@ int exfat_count_ext_entries(struct super_block *sb, struct exfat_chain *p_dir,
1145
1137
struct buffer_head * bh ;
1146
1138
1147
1139
for (i = 0 , entry ++ ; i < ep -> dentry .file .num_ext ; i ++ , entry ++ ) {
1148
- ext_ep = exfat_get_dentry (sb , p_dir , entry , & bh , NULL );
1140
+ ext_ep = exfat_get_dentry (sb , p_dir , entry , & bh );
1149
1141
if (!ext_ep )
1150
1142
return - EIO ;
1151
1143
@@ -1175,7 +1167,7 @@ int exfat_count_dir_entries(struct super_block *sb, struct exfat_chain *p_dir)
1175
1167
1176
1168
while (clu .dir != EXFAT_EOF_CLUSTER ) {
1177
1169
for (i = 0 ; i < dentries_per_clu ; i ++ ) {
1178
- ep = exfat_get_dentry (sb , & clu , i , & bh , NULL );
1170
+ ep = exfat_get_dentry (sb , & clu , i , & bh );
1179
1171
if (!ep )
1180
1172
return - EIO ;
1181
1173
entry_type = exfat_get_entry_type (ep );
0 commit comments