diff options
author | Vyacheslav Dubeyko <slava@dubeyko.com> | 2013-02-27 20:03:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-27 22:10:10 -0500 |
commit | 324ef39a8a4f693035d63527f16100ed27310ecc (patch) | |
tree | 1814515cf6139fe1b4ebae8d6641c9ec6293d396 /fs/hfsplus/inode.c | |
parent | 127e5f5ae51eff44c9bff673f24e8587caa4e29f (diff) |
hfsplus: add support of manipulation by attributes file
Add support of manipulation by attributes file.
Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Reported-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfsplus/inode.c')
-rw-r--r-- | fs/hfsplus/inode.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index dcd05be5344b..160ccc9cdb4b 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include "hfsplus_fs.h" | 18 | #include "hfsplus_fs.h" |
19 | #include "hfsplus_raw.h" | 19 | #include "hfsplus_raw.h" |
20 | #include "xattr.h" | ||
20 | 21 | ||
21 | static int hfsplus_readpage(struct file *file, struct page *page) | 22 | static int hfsplus_readpage(struct file *file, struct page *page) |
22 | { | 23 | { |
@@ -348,6 +349,18 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, | |||
348 | error = error2; | 349 | error = error2; |
349 | } | 350 | } |
350 | 351 | ||
352 | if (test_and_clear_bit(HFSPLUS_I_ATTR_DIRTY, &hip->flags)) { | ||
353 | if (sbi->attr_tree) { | ||
354 | error2 = | ||
355 | filemap_write_and_wait( | ||
356 | sbi->attr_tree->inode->i_mapping); | ||
357 | if (!error) | ||
358 | error = error2; | ||
359 | } else { | ||
360 | printk(KERN_ERR "hfs: sync non-existent attributes tree\n"); | ||
361 | } | ||
362 | } | ||
363 | |||
351 | if (test_and_clear_bit(HFSPLUS_I_ALLOC_DIRTY, &hip->flags)) { | 364 | if (test_and_clear_bit(HFSPLUS_I_ALLOC_DIRTY, &hip->flags)) { |
352 | error2 = filemap_write_and_wait(sbi->alloc_file->i_mapping); | 365 | error2 = filemap_write_and_wait(sbi->alloc_file->i_mapping); |
353 | if (!error) | 366 | if (!error) |
@@ -365,9 +378,10 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, | |||
365 | static const struct inode_operations hfsplus_file_inode_operations = { | 378 | static const struct inode_operations hfsplus_file_inode_operations = { |
366 | .lookup = hfsplus_file_lookup, | 379 | .lookup = hfsplus_file_lookup, |
367 | .setattr = hfsplus_setattr, | 380 | .setattr = hfsplus_setattr, |
368 | .setxattr = hfsplus_setxattr, | 381 | .setxattr = generic_setxattr, |
369 | .getxattr = hfsplus_getxattr, | 382 | .getxattr = generic_getxattr, |
370 | .listxattr = hfsplus_listxattr, | 383 | .listxattr = hfsplus_listxattr, |
384 | .removexattr = hfsplus_removexattr, | ||
371 | }; | 385 | }; |
372 | 386 | ||
373 | static const struct file_operations hfsplus_file_operations = { | 387 | static const struct file_operations hfsplus_file_operations = { |