]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/hfsplus/inode.c
Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / fs / hfsplus / inode.c
index 799b336b59f977ea7219b33f07f50efaff51c340..160ccc9cdb4be2da98633eee6c7e5d94116e5c43 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "hfsplus_fs.h"
 #include "hfsplus_raw.h"
+#include "xattr.h"
 
 static int hfsplus_readpage(struct file *file, struct page *page)
 {
@@ -124,7 +125,7 @@ static ssize_t hfsplus_direct_IO(int rw, struct kiocb *iocb,
 {
        struct file *file = iocb->ki_filp;
        struct address_space *mapping = file->f_mapping;
-       struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host;
+       struct inode *inode = file_inode(file)->i_mapping->host;
        ssize_t ret;
 
        ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs,
@@ -348,6 +349,18 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
                        error = error2;
        }
 
+       if (test_and_clear_bit(HFSPLUS_I_ATTR_DIRTY, &hip->flags)) {
+               if (sbi->attr_tree) {
+                       error2 =
+                               filemap_write_and_wait(
+                                           sbi->attr_tree->inode->i_mapping);
+                       if (!error)
+                               error = error2;
+               } else {
+                       printk(KERN_ERR "hfs: sync non-existent attributes tree\n");
+               }
+       }
+
        if (test_and_clear_bit(HFSPLUS_I_ALLOC_DIRTY, &hip->flags)) {
                error2 = filemap_write_and_wait(sbi->alloc_file->i_mapping);
                if (!error)
@@ -365,9 +378,10 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
 static const struct inode_operations hfsplus_file_inode_operations = {
        .lookup         = hfsplus_file_lookup,
        .setattr        = hfsplus_setattr,
-       .setxattr       = hfsplus_setxattr,
-       .getxattr       = hfsplus_getxattr,
+       .setxattr       = generic_setxattr,
+       .getxattr       = generic_getxattr,
        .listxattr      = hfsplus_listxattr,
+       .removexattr    = hfsplus_removexattr,
 };
 
 static const struct file_operations hfsplus_file_operations = {