lkml.org 
[lkml]   [2006]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: GFS2 Filesystem [9/16]
    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@namei.org>
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-02-24 22:07    [W:0.021 / U:92.668 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site