Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211575
b: refs/heads/master
c: b5080f7
h: refs/heads/master
i:
  211573: 81ac00c
  211571: 78b6b8d
  211567: 87b1bec
v: v3
  • Loading branch information
Christoph Hellwig authored and Christoph Hellwig committed Oct 1, 2010
1 parent 6613b72 commit 41706bd
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 44 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: fc4fff82104fa096eada73943fe5249500acd5fa
refs/heads/master: b5080f77ed2de3c8ac67a63044f8a781c75207d9
80 changes: 37 additions & 43 deletions trunk/fs/hfsplus/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,63 +89,57 @@ struct inode *hfsplus_iget(struct super_block *sb, unsigned long ino)
return inode;
}

static int hfsplus_write_inode(struct inode *inode,
struct writeback_control *wbc)
static int hfsplus_system_write_inode(struct inode *inode)
{
struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);
struct hfsplus_vh *vhdr;
int ret = 0;
struct hfsplus_vh *vhdr = sbi->s_vhdr;
struct hfsplus_fork_raw *fork;
struct hfs_btree *tree = NULL;

dprint(DBG_INODE, "hfsplus_write_inode: %lu\n", inode->i_ino);
hfsplus_ext_write_extent(inode);
if (inode->i_ino >= HFSPLUS_FIRSTUSER_CNID) {
return hfsplus_cat_write_inode(inode);
}
vhdr = sbi->s_vhdr;
switch (inode->i_ino) {
case HFSPLUS_ROOT_CNID:
ret = hfsplus_cat_write_inode(inode);
break;
case HFSPLUS_EXT_CNID:
if (vhdr->ext_file.total_size != cpu_to_be64(inode->i_size)) {
sbi->flags |= HFSPLUS_SB_WRITEBACKUP;
inode->i_sb->s_dirt = 1;
}
hfsplus_inode_write_fork(inode, &vhdr->ext_file);
hfs_btree_write(sbi->ext_tree);
fork = &vhdr->ext_file;
tree = sbi->ext_tree;
break;
case HFSPLUS_CAT_CNID:
if (vhdr->cat_file.total_size != cpu_to_be64(inode->i_size)) {
sbi->flags |= HFSPLUS_SB_WRITEBACKUP;
inode->i_sb->s_dirt = 1;
}
hfsplus_inode_write_fork(inode, &vhdr->cat_file);
hfs_btree_write(sbi->cat_tree);
fork = &vhdr->cat_file;
tree = sbi->cat_tree;
break;
case HFSPLUS_ALLOC_CNID:
if (vhdr->alloc_file.total_size != cpu_to_be64(inode->i_size)) {
sbi->flags |= HFSPLUS_SB_WRITEBACKUP;
inode->i_sb->s_dirt = 1;
}
hfsplus_inode_write_fork(inode, &vhdr->alloc_file);
fork = &vhdr->alloc_file;
break;
case HFSPLUS_START_CNID:
if (vhdr->start_file.total_size != cpu_to_be64(inode->i_size)) {
sbi->flags |= HFSPLUS_SB_WRITEBACKUP;
inode->i_sb->s_dirt = 1;
}
hfsplus_inode_write_fork(inode, &vhdr->start_file);
fork = &vhdr->start_file;
break;
case HFSPLUS_ATTR_CNID:
if (vhdr->attr_file.total_size != cpu_to_be64(inode->i_size)) {
sbi->flags |= HFSPLUS_SB_WRITEBACKUP;
inode->i_sb->s_dirt = 1;
}
hfsplus_inode_write_fork(inode, &vhdr->attr_file);
hfs_btree_write(sbi->attr_tree);
break;
fork = &vhdr->attr_file;
tree = sbi->attr_tree;
default:
return -EIO;
}

if (fork->total_size != cpu_to_be64(inode->i_size)) {
sbi->flags |= HFSPLUS_SB_WRITEBACKUP;
inode->i_sb->s_dirt = 1;
}
return ret;
hfsplus_inode_write_fork(inode, fork);
if (tree)
hfs_btree_write(tree);
return 0;
}

static int hfsplus_write_inode(struct inode *inode,
struct writeback_control *wbc)
{
dprint(DBG_INODE, "hfsplus_write_inode: %lu\n", inode->i_ino);

hfsplus_ext_write_extent(inode);

if (inode->i_ino >= HFSPLUS_FIRSTUSER_CNID ||
inode->i_ino == HFSPLUS_ROOT_CNID)
return hfsplus_cat_write_inode(inode);
else
return hfsplus_system_write_inode(inode);
}

static void hfsplus_evict_inode(struct inode *inode)
Expand Down

0 comments on commit 41706bd

Please sign in to comment.