aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-31 19:26:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-31 20:49:27 -0400
commit90b436657efb1a6d73bf0677fedee8a8c77032f6 (patch)
treeee7e433e5cc1817dd4b9d6fda0a692c0d0ac033f /fs/fat
parent020ac5b6bef15785f9dde9de89d2734ff97da733 (diff)
fat: introduce mark_fsinfo_dirty helper
A preparation patch which introduces a 'mark_fsinfo_dirty()' helper function which just sets the 's_dirt' flag to 1 so far. I'll add more code to this helper later, so I do not mark it as 'inline'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/fatent.c13
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
311static void mark_fsinfo_dirty(struct super_block *sb)
312{
313 sb->s_dirt = 1;
314}
315
311static inline int fat_ent_update_ptr(struct super_block *sb, 316static 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
526out: 531out:
@@ -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);
682out: 687out:
683 unlock_fat(sbi); 688 unlock_fat(sbi);