Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309725
b: refs/heads/master
c: 330fe3c
h: refs/heads/master
i:
  309723: bc8c33c
v: v3
  • Loading branch information
Artem Bityutskiy authored and Linus Torvalds committed Jun 1, 2012
1 parent 51640ef commit a8d02e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90b436657efb1a6d73bf0677fedee8a8c77032f6
refs/heads/master: 330fe3c4c6509e0418c434b5bcf80e65cffab477
9 changes: 5 additions & 4 deletions trunk/fs/fat/fatent.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ int fat_alloc_clusters(struct inode *inode, int *cluster, int nr_cluster)
sbi->prev_free = entry;
if (sbi->free_clusters != -1)
sbi->free_clusters--;
mark_fsinfo_dirty(sb);

cluster[idx_clus] = entry;
idx_clus++;
Expand All @@ -525,11 +524,11 @@ int fat_alloc_clusters(struct inode *inode, int *cluster, int nr_cluster)
/* Couldn't allocate the free entries */
sbi->free_clusters = 0;
sbi->free_clus_valid = 1;
mark_fsinfo_dirty(sb);
err = -ENOSPC;

out:
unlock_fat(sbi);
mark_fsinfo_dirty(sb);
fatent_brelse(&fatent);
if (!err) {
if (inode_needs_sync(inode))
Expand All @@ -554,7 +553,7 @@ int fat_free_clusters(struct inode *inode, int cluster)
struct fat_entry fatent;
struct buffer_head *bhs[MAX_BUF_PER_PAGE];
int i, err, nr_bhs;
int first_cl = cluster;
int first_cl = cluster, dirty_fsinfo = 0;

nr_bhs = 0;
fatent_init(&fatent);
Expand Down Expand Up @@ -592,7 +591,7 @@ int fat_free_clusters(struct inode *inode, int cluster)
ops->ent_put(&fatent, FAT_ENT_FREE);
if (sbi->free_clusters != -1) {
sbi->free_clusters++;
mark_fsinfo_dirty(sb);
dirty_fsinfo = 1;
}

if (nr_bhs + fatent.nr_bhs > MAX_BUF_PER_PAGE) {
Expand Down Expand Up @@ -622,6 +621,8 @@ int fat_free_clusters(struct inode *inode, int cluster)
for (i = 0; i < nr_bhs; i++)
brelse(bhs[i]);
unlock_fat(sbi);
if (dirty_fsinfo)
mark_fsinfo_dirty(sb);

return err;
}
Expand Down

0 comments on commit a8d02e7

Please sign in to comment.