Merge master.kernel.org:/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
[pandora-kernel.git] / fs / gfs2 / eaops.c
index 3ace242..cd747c0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU General Public License v.2.
+ * of the GNU General Public License version 2.
  */
 
 #include <linux/sched.h>
 #include <linux/buffer_head.h>
 #include <linux/xattr.h>
 #include <linux/gfs2_ondisk.h>
+#include <linux/lm_interface.h>
 #include <asm/uaccess.h>
 
 #include "gfs2.h"
-#include "lm_interface.h"
 #include "incore.h"
 #include "acl.h"
 #include "eaops.h"
  * Returns: GFS2_EATYPE_XXX
  */
 
-unsigned int gfs2_ea_name2type(const char *name, char **truncated_name)
+unsigned int gfs2_ea_name2type(const char *name, const char **truncated_name)
 {
        unsigned int type;
 
        if (strncmp(name, "system.", 7) == 0) {
                type = GFS2_EATYPE_SYS;
                if (truncated_name)
-                       *truncated_name = strchr(name, '.') + 1;
+                       *truncated_name = name + sizeof("system.") - 1;
        } else if (strncmp(name, "user.", 5) == 0) {
                type = GFS2_EATYPE_USR;
                if (truncated_name)
-                       *truncated_name = strchr(name, '.') + 1;
+                       *truncated_name = name + sizeof("user.") - 1;
        } else if (strncmp(name, "security.", 9) == 0) {
                type = GFS2_EATYPE_SECURITY;
                if (truncated_name)
-                       *truncated_name = strchr(name, '.') + 1;
+                       *truncated_name = name + sizeof("security.") - 1;
        } else {
                type = GFS2_EATYPE_UNUSED;
                if (truncated_name)
@@ -120,7 +120,7 @@ static int system_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er)
 
        if (GFS2_ACL_IS_ACCESS(er->er_name, er->er_name_len)) {
                if (!(er->er_flags & GFS2_ERF_MODE)) {
-                       er->er_mode = ip->i_di.di_mode;
+                       er->er_mode = ip->i_inode.i_mode;
                        er->er_flags |= GFS2_ERF_MODE;
                }
                error = gfs2_acl_validate_set(ip, 1, er,
@@ -146,7 +146,7 @@ static int system_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er)
                        if (error == -ENODATA)
                                error = 0;
                }
-               return error;   
+               return error;
        }
 
        return -EPERM;