diff options
author | Christoph Hellwig <hch@tuxera.com> | 2010-11-23 08:38:15 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2010-11-23 08:38:15 -0500 |
commit | e34947056076ca5467ee8256d2d9cbc594a79b37 (patch) | |
tree | c1b70f51c1e4bc38e0b0389224862afe26c5720f /fs/hfsplus/ioctl.c | |
parent | b33b7921db14abcd10c30d0ccfc68e364f5ef7fe (diff) |
hfsplus: optimize fsync
Avoid doing unessecary work in fsync. Do nothing unless the inode
was marked dirty, and only write the various metadata inodes out if
they contain any dirty state from this inode. This is archived by
adding three new dirty bits to the hfsplus-specific inode which are
set in the correct places.
Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus/ioctl.c')
-rw-r--r-- | fs/hfsplus/ioctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c index 40a85a3ded6e..f5a7224f4cbb 100644 --- a/fs/hfsplus/ioctl.c +++ b/fs/hfsplus/ioctl.c | |||
@@ -147,9 +147,11 @@ int hfsplus_setxattr(struct dentry *dentry, const char *name, | |||
147 | res = -ERANGE; | 147 | res = -ERANGE; |
148 | } else | 148 | } else |
149 | res = -EOPNOTSUPP; | 149 | res = -EOPNOTSUPP; |
150 | if (!res) | 150 | if (!res) { |
151 | hfs_bnode_write(fd.bnode, &entry, fd.entryoffset, | 151 | hfs_bnode_write(fd.bnode, &entry, fd.entryoffset, |
152 | sizeof(struct hfsplus_cat_file)); | 152 | sizeof(struct hfsplus_cat_file)); |
153 | hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY); | ||
154 | } | ||
153 | out: | 155 | out: |
154 | hfs_find_exit(&fd); | 156 | hfs_find_exit(&fd); |
155 | return res; | 157 | return res; |