Re: GFS2 Filesystem [9/16]

From: James Morris
Date: Fri Feb 24 2006 - 16:03:20 EST


On Fri, 24 Feb 2006, Steven Whitehouse wrote:


> +/**
> + * gfs2_ea_name2type - get the type of the ea, and truncate type from the name
> + * @namep: ea name, possibly with type appended
> + *
> + * Returns: GFS2_EATYPE_XXX
> + */
> +
> +unsigned int gfs2_ea_name2type(const char *name, char **truncated_name)
> +{
> + unsigned int type;
> +
> + if (strncmp(name, "system.", 7) == 0) {
> + type = GFS2_EATYPE_SYS;
> + if (truncated_name)
> + *truncated_name = strchr(name, '.') + 1;
> + } else if (strncmp(name, "user.", 5) == 0) {
> + type = GFS2_EATYPE_USR;
> + if (truncated_name)
> + *truncated_name = strchr(name, '.') + 1;
> + } else {
> + type = GFS2_EATYPE_UNUSED;
> + if (truncated_name)
> + *truncated_name = NULL;
> + }
> +
> + return type;
> +}


Consider using the generic xattr infrastructure in the kernel (xattr.c),
e.g. generic_getxattr() and friends.



- James
--
James Morris
<jmorris@xxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/