Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[pandora-kernel.git] / fs / gfs2 / eaops.c
index 3b8749c..92c54e9 100644 (file)
 #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)
@@ -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;