[lkml]   [2007]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subject[PATCH 0/1] [RFC] New mode for path_lookup (V1)
    Stackable file systems frequently need to lookup paths or path components
    starting from an arbitrary point in the namespace (identified by a dentry
    and a vfsmount). Currently, such file systems use lookup_one_len, which is
    frowned upon [1] as it does not pass the lookup intent along; not passing a
    lookup intent, for example, can trigger BUG_ON's when stacking on top of

    The following patch introduces a new mode to path_lookup to allow lookup to
    start from an arbitrary point in the namespace. This approach has been
    suggested by Christoph Hellwig at the Linux Storage & Filesystem workshop in
    February of this year.

    One indicates that the lookup should be relative to a dentry-vfsmnt pair by
    using the LOOKUP_ONE flag. For example, the following snippet of code,
    looks up "pathcomponent" in a directory pointed to by

    nd.dentry = parent_dentry;
    nd.mnt = parent_vfsmnt;

    err = path_lookup("pathcomponent", LOOKUP_ONE, &nd);
    if (!err) {
    /* exits */


    /* once done, release the references */
    } else if (err == -ENOENT) {
    /* doesn't exits */
    } else {
    /* other error */

    VFS functions such as lookup_create can be used on the nameidata structure
    to pass the create intent to the file system.

    Currently, there is no easy way to pass the LOOKUP_OPEN intent. The proper
    way would be to call open_namei.

    We'd like to get comments about what's necessary to make stackable file
    systems do lookups right - this includes potential changes to open_namei.

    Josef 'Jeff' Sipek.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2007-04-30 05:31    [W:0.032 / U:9.196 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site