lkml.org 
[lkml]   [2003]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC 2/5] sysfs-dir.patch
    On Wed, Nov 12, 2003 at 05:55:29PM +0530, Maneesh Soni wrote:
    > @@ -110,10 +231,15 @@ void sysfs_remove_subdir(struct dentry *
    > void sysfs_remove_dir(struct kobject * kobj)
    > {
    > struct list_head * node;
    > - struct dentry * dentry = dget(kobj->dentry);
    > + struct dentry * dentry = kobj->s_dirent->s_dentry;
    > + struct sysfs_dirent * parent_sd;
    >
    > if (!dentry)
    > - return;
    > + goto exit;
    > +
    > + spin_lock(&dcache_lock);
    > + dentry = dget_locked(dentry);
    > + spin_unlock(&dcache_lock);

    Racy. Directory might've been looked up just as you've decided that it
    had no dentry.

    > void sysfs_rename_dir(struct kobject * kobj, const char *new_name)
    > @@ -162,14 +292,170 @@ void sysfs_rename_dir(struct kobject * k
    > if (!kobj->parent)
    > return;
    >
    > - parent = kobj->parent->dentry;
    > + parent = kobj->parent->s_dirent->s_dentry;
    > + if (parent) {

    Ditto.

    Look, the *only* benefit of ramfs as a backing store for sysfs was that we
    could easily get locking right. You want second tree - you get to fight
    for coherency.
    -
    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: 2005-03-22 13:58    [W:0.029 / U:64.204 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site