@@ -64,7 +64,6 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent
6464{
6565 int i , dentries_per_clu , dentries_per_clu_bits = 0 , num_ext ;
6666 unsigned int type , clu_offset , max_dentries ;
67- sector_t sector ;
6867 struct exfat_chain dir , clu ;
6968 struct exfat_uni_name uni_name ;
7069 struct exfat_dentry * ep ;
@@ -115,7 +114,7 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent
115114 i = dentry & (dentries_per_clu - 1 );
116115
117116 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 );
119118 if (!ep )
120119 return - EIO ;
121120
@@ -156,7 +155,7 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent
156155 dir_entry -> namebuf .lfnbuf_len );
157156 brelse (bh );
158157
159- ep = exfat_get_dentry (sb , & clu , i + 1 , & bh , NULL );
158+ ep = exfat_get_dentry (sb , & clu , i + 1 , & bh );
160159 if (!ep )
161160 return - EIO ;
162161 dir_entry -> size =
@@ -445,15 +444,14 @@ int exfat_init_dir_entry(struct inode *inode, struct exfat_chain *p_dir,
445444 struct super_block * sb = inode -> i_sb ;
446445 struct exfat_sb_info * sbi = EXFAT_SB (sb );
447446 struct timespec64 ts = current_time (inode );
448- sector_t sector ;
449447 struct exfat_dentry * ep ;
450448 struct buffer_head * bh ;
451449
452450 /*
453451 * We cannot use exfat_get_dentry_set here because file ep is not
454452 * initialized yet.
455453 */
456- ep = exfat_get_dentry (sb , p_dir , entry , & bh , & sector );
454+ ep = exfat_get_dentry (sb , p_dir , entry , & bh );
457455 if (!ep )
458456 return - EIO ;
459457
@@ -477,7 +475,7 @@ int exfat_init_dir_entry(struct inode *inode, struct exfat_chain *p_dir,
477475 exfat_update_bh (bh , IS_DIRSYNC (inode ));
478476 brelse (bh );
479477
480- ep = exfat_get_dentry (sb , p_dir , entry + 1 , & bh , & sector );
478+ ep = exfat_get_dentry (sb , p_dir , entry + 1 , & bh );
481479 if (!ep )
482480 return - EIO ;
483481
@@ -496,20 +494,19 @@ int exfat_update_dir_chksum(struct inode *inode, struct exfat_chain *p_dir,
496494 struct super_block * sb = inode -> i_sb ;
497495 int ret = 0 ;
498496 int i , num_entries ;
499- sector_t sector ;
500497 u16 chksum ;
501498 struct exfat_dentry * ep , * fep ;
502499 struct buffer_head * fbh , * bh ;
503500
504- fep = exfat_get_dentry (sb , p_dir , entry , & fbh , & sector );
501+ fep = exfat_get_dentry (sb , p_dir , entry , & fbh );
505502 if (!fep )
506503 return - EIO ;
507504
508505 num_entries = fep -> dentry .file .num_ext + 1 ;
509506 chksum = exfat_calc_chksum16 (fep , DENTRY_SIZE , 0 , CS_DIR_ENTRY );
510507
511508 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 );
513510 if (!ep ) {
514511 ret = - EIO ;
515512 goto release_fbh ;
@@ -531,21 +528,20 @@ int exfat_init_ext_entry(struct inode *inode, struct exfat_chain *p_dir,
531528{
532529 struct super_block * sb = inode -> i_sb ;
533530 int i ;
534- sector_t sector ;
535531 unsigned short * uniname = p_uniname -> name ;
536532 struct exfat_dentry * ep ;
537533 struct buffer_head * bh ;
538534 int sync = IS_DIRSYNC (inode );
539535
540- ep = exfat_get_dentry (sb , p_dir , entry , & bh , & sector );
536+ ep = exfat_get_dentry (sb , p_dir , entry , & bh );
541537 if (!ep )
542538 return - EIO ;
543539
544540 ep -> dentry .file .num_ext = (unsigned char )(num_entries - 1 );
545541 exfat_update_bh (bh , sync );
546542 brelse (bh );
547543
548- ep = exfat_get_dentry (sb , p_dir , entry + 1 , & bh , & sector );
544+ ep = exfat_get_dentry (sb , p_dir , entry + 1 , & bh );
549545 if (!ep )
550546 return - EIO ;
551547
@@ -555,7 +551,7 @@ int exfat_init_ext_entry(struct inode *inode, struct exfat_chain *p_dir,
555551 brelse (bh );
556552
557553 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 );
559555 if (!ep )
560556 return - EIO ;
561557
@@ -574,12 +570,11 @@ int exfat_remove_entries(struct inode *inode, struct exfat_chain *p_dir,
574570{
575571 struct super_block * sb = inode -> i_sb ;
576572 int i ;
577- sector_t sector ;
578573 struct exfat_dentry * ep ;
579574 struct buffer_head * bh ;
580575
581576 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 );
583578 if (!ep )
584579 return - EIO ;
585580
@@ -656,8 +651,8 @@ static int exfat_walk_fat_chain(struct super_block *sb,
656651 return 0 ;
657652}
658653
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 )
661656{
662657 int ret ;
663658 unsigned int off , clu = 0 ;
@@ -717,8 +712,7 @@ static int exfat_dir_readahead(struct super_block *sb, sector_t sec)
717712}
718713
719714struct 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 )
722716{
723717 unsigned int dentries_per_page = EXFAT_B_TO_DEN (PAGE_SIZE );
724718 int off ;
@@ -740,8 +734,6 @@ struct exfat_dentry *exfat_get_dentry(struct super_block *sb,
740734 if (!* bh )
741735 return NULL ;
742736
743- if (sector )
744- * sector = sec ;
745737 return (struct exfat_dentry * )((* bh )-> b_data + off );
746738}
747739
@@ -892,7 +884,7 @@ struct exfat_entry_set_cache *exfat_get_dentry_set(struct super_block *sb,
892884 es -> bh [es -> num_bh ++ ] = bh ;
893885 }
894886
895- /* validiate cached dentries */
887+ /* validate cached dentries */
896888 for (i = 1 ; i < num_entries ; i ++ ) {
897889 ep = exfat_get_dentry_cached (es , i );
898890 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,
960952 if (rewind && dentry == end_eidx )
961953 goto not_found ;
962954
963- ep = exfat_get_dentry (sb , & clu , i , & bh , NULL );
955+ ep = exfat_get_dentry (sb , & clu , i , & bh );
964956 if (!ep )
965957 return - EIO ;
966958
@@ -1145,7 +1137,7 @@ int exfat_count_ext_entries(struct super_block *sb, struct exfat_chain *p_dir,
11451137 struct buffer_head * bh ;
11461138
11471139 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 );
11491141 if (!ext_ep )
11501142 return - EIO ;
11511143
@@ -1175,7 +1167,7 @@ int exfat_count_dir_entries(struct super_block *sb, struct exfat_chain *p_dir)
11751167
11761168 while (clu .dir != EXFAT_EOF_CLUSTER ) {
11771169 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 );
11791171 if (!ep )
11801172 return - EIO ;
11811173 entry_type = exfat_get_entry_type (ep );
0 commit comments