Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

exfat: remove NULL cache pointer case in exfat_ent_get

Since exfat_get_next_cluster has been updated, no callers pass a NULL
pointer to exfat_ent_get, so remove the handling logic for this case.

Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>

authored by

Chi Zhiling and committed by
Namjae Jeon
f764c589 6f2cbe45

+9 -14
+9 -14
fs/exfat/fatent.c
··· 44 44 } 45 45 46 46 static int __exfat_ent_get(struct super_block *sb, unsigned int loc, 47 - unsigned int *content, struct buffer_head **last) 47 + unsigned int *content, struct buffer_head **cache) 48 48 { 49 49 unsigned int off; 50 50 sector_t sec; 51 - struct buffer_head *bh = last ? *last : NULL; 51 + struct buffer_head *bh = *cache; 52 52 53 53 sec = FAT_ENT_OFFSET_SECTOR(sb, loc); 54 54 off = FAT_ENT_OFFSET_BYTE_IN_SECTOR(sb, loc); ··· 56 56 if (!bh || bh->b_blocknr != sec || !buffer_uptodate(bh)) { 57 57 brelse(bh); 58 58 bh = sb_bread(sb, sec); 59 - if (last) 60 - *last = bh; 59 + *cache = bh; 61 60 if (unlikely(!bh)) 62 61 return -EIO; 63 62 } ··· 67 68 if (*content > EXFAT_BAD_CLUSTER) 68 69 *content = EXFAT_EOF_CLUSTER; 69 70 70 - if (!last) 71 - brelse(bh); 72 71 return 0; 73 72 } 74 73 ··· 108 111 * Caller must release the buffer_head if no error return. 109 112 */ 110 113 int exfat_ent_get(struct super_block *sb, unsigned int loc, 111 - unsigned int *content, struct buffer_head **last) 114 + unsigned int *content, struct buffer_head **cache) 112 115 { 113 116 struct exfat_sb_info *sbi = EXFAT_SB(sb); 114 117 ··· 119 122 goto err; 120 123 } 121 124 122 - if (unlikely(__exfat_ent_get(sb, loc, content, last))) { 125 + if (unlikely(__exfat_ent_get(sb, loc, content, cache))) { 123 126 exfat_fs_error_ratelimit(sb, 124 127 "failed to access to FAT (entry 0x%08x)", 125 128 loc); ··· 148 151 } 149 152 150 153 return 0; 151 - err: 152 - if (last) { 153 - brelse(*last); 154 154 155 - /* Avoid double release */ 156 - *last = NULL; 157 - } 155 + err: 156 + /* Avoid double release */ 157 + brelse(*cache); 158 + *cache = NULL; 158 159 return -EIO; 159 160 } 160 161