• Andrew Morton's avatar
    [PATCH] sysfs backing store: stop pinning dentries/inodes for leaf entries · 2fcff040
    Andrew Morton authored
    From: Maneesh Soni <maneesh@in.ibm.com>
    
    o This patch stops the pinning of non-directory or leaf dentries and inodes.
      The leaf dentries and inodes are created during lookup based on the
      entries on sysfs_dirent tree. These leaves are removed from the dcache
      through the VFS dentry ageing process during shrink dcache operations. Thus
      reducing about 80% of sysfs lowmem needs.
    
    o This implments the ->lookup() for sysfs directory inodes and allocates
      dentry and inode if the lookup is successful and avoids the need of
      allocating and pinning of dentry and inodes during the creation of
      corresponding sysfs leaf entry. As of now the implementation has not
      required negative dentry creation on failed lookup. As sysfs is still a
      RAM based filesystem, negative dentries are not of any use IMO.
    
    o The leaf dentry allocated after successful lookup is connected to the
      existing corresponding sysfs_dirent through the d_fsdata field.
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
    2fcff040
sysfs.h 2.73 KB