[JFFS2] Print correct node offset when complaining about broken data CRC
[powerpc.git] / fs / jffs2 / acl.c
index 9c2077e..65b3a1b 100644 (file)
@@ -1,16 +1,18 @@
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
- * Copyright (C) 2006  NEC Corporation
+ * Copyright © 2006  NEC Corporation
  *
  * Created by KaiGai Kohei <kaigai@ak.jp.nec.com>
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
  */
+
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
+#include <linux/sched.h>
 #include <linux/time.h>
 #include <linux/crc32.h>
 #include <linux/jffs2.h>
@@ -345,10 +347,8 @@ int jffs2_init_acl(struct inode *inode, struct inode *dir)
        return rc;
 }
 
-void jffs2_clear_acl(struct inode *inode)
+void jffs2_clear_acl(struct jffs2_inode_info *f)
 {
-       struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
-
        if (f->i_acl_access && f->i_acl_access != JFFS2_ACL_NOT_CACHED) {
                posix_acl_release(f->i_acl_access);
                f->i_acl_access = JFFS2_ACL_NOT_CACHED;
@@ -435,7 +435,7 @@ static int jffs2_acl_setxattr(struct inode *inode, int type, const void *value,
        struct posix_acl *acl;
        int rc;
 
-       if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+       if (!is_owner_or_cap(inode))
                return -EPERM;
 
        if (value) {