u8 *tz, __le16 *time, __le16 *date, u8 *time_cs);
u16 exfat_calc_chksum16(void *data, int len, u16 chksum, int type);
u32 exfat_calc_chksum32(void *data, int len, u32 chksum, int type);
-void exfat_update_bh(struct buffer_head *bh, int sync);
+int exfat_update_bh(struct buffer_head *bh, int sync);
int exfat_update_bhs(struct buffer_head **bhs, int nr_bhs, int sync);
void exfat_chain_set(struct exfat_chain *ec, unsigned int dir,
unsigned int size, unsigned char flags);
if (!c_bh)
return -ENOMEM;
memcpy(c_bh->b_data, bh->b_data, sb->s_blocksize);
- exfat_update_bh(c_bh, sb->s_flags & SB_SYNCHRONOUS);
+ err = exfat_update_bh(c_bh, sb->s_flags & SB_SYNCHRONOUS);
brelse(c_bh);
}
{
int err;
- exfat_update_bh(bh, sb->s_flags & SB_SYNCHRONOUS);
- err = exfat_mirror_bh(sb, bh);
+ err = exfat_update_bh(bh, sb->s_flags & SB_SYNCHRONOUS);
+ if (!err)
+ err = exfat_mirror_bh(sb, bh);
brelse(bh);
-
return err;
}
* so fat-chain should be synced with
* alloc-bitmap
*/
- exfat_chain_cont_cluster(sb, ei->start_clu,
- num_clusters);
+ if (exfat_chain_cont_cluster(sb, ei->start_clu,
+ num_clusters))
+ return -EIO;
ei->flags = ALLOC_FAT_CHAIN;
}
if (new_clu.flags == ALLOC_FAT_CHAIN)
return chksum;
}
-void exfat_update_bh(struct buffer_head *bh, int sync)
+int exfat_update_bh(struct buffer_head *bh, int sync)
{
+ int err = 0;
+
set_buffer_uptodate(bh);
mark_buffer_dirty(bh);
if (sync)
- sync_dirty_buffer(bh);
+ err = sync_dirty_buffer(bh);
+
+ return err;
}
int exfat_update_bhs(struct buffer_head **bhs, int nr_bhs, int sync)
/* no-fat-chain bit is disabled,
* so fat-chain should be synced with alloc-bitmap
*/
- exfat_chain_cont_cluster(sb, p_dir->dir, p_dir->size);
+ if (exfat_chain_cont_cluster(sb, p_dir->dir, p_dir->size))
+ return -EIO;
p_dir->flags = ALLOC_FAT_CHAIN;
hint_femp.cur.flags = ALLOC_FAT_CHAIN;
}