Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312958
b: refs/heads/master
c: b593523
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and Al Viro committed Jul 22, 2012
1 parent 268c5a4 commit 4f6cf44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 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: 715189d836ab276b3d0fc114681f12b423686ffa
refs/heads/master: b59352359d6555aa8537d74ac9b15c1c6bcf3c68
12 changes: 10 additions & 2 deletions trunk/fs/hfs/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void hfs_mdb_commit(struct super_block *sb)
{
struct hfs_mdb *mdb = HFS_SB(sb)->mdb;

lock_super(sb);
lock_buffer(HFS_SB(sb)->mdb_bh);
if (test_and_clear_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags)) {
/* These parameters may have been modified, so write them back */
mdb->drLsMod = hfs_mtime();
Expand All @@ -284,9 +284,13 @@ void hfs_mdb_commit(struct super_block *sb)
&mdb->drXTFlSize, NULL);
hfs_inode_write_fork(HFS_SB(sb)->cat_tree->inode, mdb->drCTExtRec,
&mdb->drCTFlSize, NULL);

lock_buffer(HFS_SB(sb)->alt_mdb_bh);
memcpy(HFS_SB(sb)->alt_mdb, HFS_SB(sb)->mdb, HFS_SECTOR_SIZE);
HFS_SB(sb)->alt_mdb->drAtrb |= cpu_to_be16(HFS_SB_ATTRIB_UNMNT);
HFS_SB(sb)->alt_mdb->drAtrb &= cpu_to_be16(~HFS_SB_ATTRIB_INCNSTNT);
unlock_buffer(HFS_SB(sb)->alt_mdb_bh);

mark_buffer_dirty(HFS_SB(sb)->alt_mdb_bh);
sync_dirty_buffer(HFS_SB(sb)->alt_mdb_bh);
}
Expand All @@ -309,7 +313,11 @@ void hfs_mdb_commit(struct super_block *sb)
break;
}
len = min((int)sb->s_blocksize - off, size);

lock_buffer(bh);
memcpy(bh->b_data + off, ptr, len);
unlock_buffer(bh);

mark_buffer_dirty(bh);
brelse(bh);
block++;
Expand All @@ -318,7 +326,7 @@ void hfs_mdb_commit(struct super_block *sb)
size -= len;
}
}
unlock_super(sb);
unlock_buffer(HFS_SB(sb)->mdb_bh);
}

void hfs_mdb_close(struct super_block *sb)
Expand Down

0 comments on commit 4f6cf44

Please sign in to comment.