diff options
Diffstat (limited to 'fs/fat')
-rw-r--r-- | fs/fat/fatent.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c index 2e81ac0df7e2..e49d27463b67 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c | |||
@@ -308,6 +308,11 @@ void fat_ent_access_init(struct super_block *sb) | |||
308 | } | 308 | } |
309 | } | 309 | } |
310 | 310 | ||
311 | static void mark_fsinfo_dirty(struct super_block *sb) | ||
312 | { | ||
313 | sb->s_dirt = 1; | ||
314 | } | ||
315 | |||
311 | static inline int fat_ent_update_ptr(struct super_block *sb, | 316 | static inline int fat_ent_update_ptr(struct super_block *sb, |
312 | struct fat_entry *fatent, | 317 | struct fat_entry *fatent, |
313 | int offset, sector_t blocknr) | 318 | int offset, sector_t blocknr) |
@@ -498,7 +503,7 @@ int fat_alloc_clusters(struct inode *inode, int *cluster, int nr_cluster) | |||
498 | sbi->prev_free = entry; | 503 | sbi->prev_free = entry; |
499 | if (sbi->free_clusters != -1) | 504 | if (sbi->free_clusters != -1) |
500 | sbi->free_clusters--; | 505 | sbi->free_clusters--; |
501 | sb->s_dirt = 1; | 506 | mark_fsinfo_dirty(sb); |
502 | 507 | ||
503 | cluster[idx_clus] = entry; | 508 | cluster[idx_clus] = entry; |
504 | idx_clus++; | 509 | idx_clus++; |
@@ -520,7 +525,7 @@ int fat_alloc_clusters(struct inode *inode, int *cluster, int nr_cluster) | |||
520 | /* Couldn't allocate the free entries */ | 525 | /* Couldn't allocate the free entries */ |
521 | sbi->free_clusters = 0; | 526 | sbi->free_clusters = 0; |
522 | sbi->free_clus_valid = 1; | 527 | sbi->free_clus_valid = 1; |
523 | sb->s_dirt = 1; | 528 | mark_fsinfo_dirty(sb); |
524 | err = -ENOSPC; | 529 | err = -ENOSPC; |
525 | 530 | ||
526 | out: | 531 | out: |
@@ -587,7 +592,7 @@ int fat_free_clusters(struct inode *inode, int cluster) | |||
587 | ops->ent_put(&fatent, FAT_ENT_FREE); | 592 | ops->ent_put(&fatent, FAT_ENT_FREE); |
588 | if (sbi->free_clusters != -1) { | 593 | if (sbi->free_clusters != -1) { |
589 | sbi->free_clusters++; | 594 | sbi->free_clusters++; |
590 | sb->s_dirt = 1; | 595 | mark_fsinfo_dirty(sb); |
591 | } | 596 | } |
592 | 597 | ||
593 | if (nr_bhs + fatent.nr_bhs > MAX_BUF_PER_PAGE) { | 598 | if (nr_bhs + fatent.nr_bhs > MAX_BUF_PER_PAGE) { |
@@ -677,7 +682,7 @@ int fat_count_free_clusters(struct super_block *sb) | |||
677 | } | 682 | } |
678 | sbi->free_clusters = free; | 683 | sbi->free_clusters = free; |
679 | sbi->free_clus_valid = 1; | 684 | sbi->free_clus_valid = 1; |
680 | sb->s_dirt = 1; | 685 | mark_fsinfo_dirty(sb); |
681 | fatent_brelse(&fatent); | 686 | fatent_brelse(&fatent); |
682 | out: | 687 | out: |
683 | unlock_fat(sbi); | 688 | unlock_fat(sbi); |