1. 12 7月, 2007 11 次提交
    • T
      sysfs: implement SYSFS_FLAG_REMOVED flag · 380e6fbb
      Tejun Heo 提交于
      Implement SYSFS_FLAG_REMOVED flag which currently is used only to
      improve sanity check in sysfs_deactivate().  The flag will be used to
      make directory entries reclamiable.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      380e6fbb
    • T
      sysfs: rename sysfs_dirent->s_type to s_flags and make room for flags · b402d72c
      Tejun Heo 提交于
      Rename sysfs_dirent->s_type to s_flags, pack type into lower eight
      bits and reserve the rest for flags.  sysfs_type() can used to access
      the type.  All existing sd->s_type accesses are converted to use
      sysfs_type().  While at it, type test is changed to equality test
      instead of bit-and test where appropriate.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b402d72c
    • T
      driver-core: make devt_attr and uevent_attr static · ad6a1e1c
      Tejun Heo 提交于
      devt_attr and uevent_attr are either allocated dynamically with or
      embedded in device and class_device as they needed their owner field
      set to the module implementing the driver.  Now that sysfs implements
      immediate disconnect and owner field removed from struct attribute,
      there is no reason to do this.  Remove these attributes from
      [class_]device and use static attribute structures instead.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ad6a1e1c
    • T
      sysfs: kill unnecessary attribute->owner · 7b595756
      Tejun Heo 提交于
      sysfs is now completely out of driver/module lifetime game.  After
      deletion, a sysfs node doesn't access anything outside sysfs proper,
      so there's no reason to hold onto the attribute owners.  Note that
      often the wrong modules were accounted for as owners leading to
      accessing removed modules.
      
      This patch kills now unnecessary attribute->owner.  Note that with
      this change, userland holding a sysfs node does not prevent the
      backing module from being unloaded.
      
      For more info regarding lifetime rule cleanup, please read the
      following message.
      
        http://article.gmane.org/gmane.linux.kernel/510293
      
      (tweaked by Greg to not delete the field just yet, to make it easier to
      merge things properly.)
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7b595756
    • T
      sysfs: add sysfs_dirent->s_name · 0c096b50
      Tejun Heo 提交于
      Add s_name to sysfs_dirent.  This is to further reduce dependency to
      the associated dentry.  Name is copied for directories and symlinks
      but not for attributes.
      
      Where possible, name dereferences are converted to use sd->s_name.
      sysfs_symlink->link_name and sysfs_get_name() are unused now and
      removed.
      
      This change allows symlink to be implemented using sysfs_dirent tree
      proper, which is the last remaining dentry-dependent sysfs walk.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0c096b50
    • T
      ida: implement idr based id allocator · 72dba584
      Tejun Heo 提交于
      Implement idr based id allocator.  ida is used the same way idr is
      used but lacks id -> ptr translation and thus consumes much less
      memory.  struct ida_bitmap is attached as leaf nodes to idr tree which
      is managed by the idr code.  Each ida_bitmap is 128bytes long and
      contains slightly less than a thousand slots.
      
      ida is more aggressive with releasing extra resources acquired using
      ida_pre_get().  After every successful id allocation, ida frees one
      reserved idr_layer if possible.  Reserved ida_bitmap is not freed
      automatically but only one ida_bitmap is reserved and it's almost
      always used right away.  Under most circumstances, ida won't hold on
      to memory for too long which isn't actively used.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      72dba584
    • R
      PM: Remove prev_state from struct dev_pm_info · 515c5357
      Rafael J. Wysocki 提交于
      The prev_state member of struct dev_pm_info (defined in include/linux/pm.h) is
      only used during a resume to check if the device's state before the suspend was
      'off', in which case the device is not resumed.  However, in such cases the
      decision whether or not to resume the device should be made on the driver level
      and the resume callbacks from the device's bus and class should be executed
      anyway (the may be needed for some things other than just powering on the
      device).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      515c5357
    • R
      PM: Remove saved_state from struct dev_pm_info · cc490069
      Rafael J. Wysocki 提交于
      The saved_state member of struct dev_pm_info, defined in include/linux/pm.h, is
      not used anywhere, so it can be removed.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cc490069
    • R
      PM: Remove pm_parent from struct dev_pm_info · 9cddad77
      Rafael J. Wysocki 提交于
      The pm_parent member of struct dev_pm_info (defined in include/linux/pm.h) is
      only used to check if the device's parent is in the right state while the
      device is being suspended or resumed.  However, this can be done just as well
      with the help of the parent pointer in struct device, so pm_parent can be
      removed along with some code that handles it.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9cddad77
    • L
      DMI-based module autoloading · 4f5c791a
      Lennart Poettering 提交于
      The patch below adds DMI/SMBIOS based module autoloading to the Linux
      kernel. The idea is to load laptop drivers automatically (and other
      drivers which cannot be autoloaded otherwise), based on the DMI system
      identification information of the BIOS.
      
      Right now most distros manually try to load all available laptop
      drivers on bootup in the hope that at least one of them loads
      successfully. This patch does away with all that, and uses udev to
      automatically load matching drivers on the right machines.
      
      Basically the patch just exports the DMI information that has been
      parsed by the kernel anyway to userspace via a sysfs device
      /sys/class/dmi/id and makes sure that proper modalias attributes are
      available. Besides adding the "modalias" attribute it also adds
      attributes for a few other DMI fields which might be useful for
      writing udev rules.
      
      This patch is not an attempt to export the entire DMI/SMBIOS data to
      userspace. We already have "dmidecode" which parses the complete DMI
      info from userspace. The purpose of this patch is machine model
      identification and good udev integration.
      
      To take advantage of DMI based module autoloading, a driver should
      export one or more MODULE_ALIAS fields similar to these:
      
      MODULE_ALIAS("dmi:*:svnMICRO-STARINT'LCO.,LTD:pnMS-1013:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
      MODULE_ALIAS("dmi:*:svnMicro-StarInternational:pnMS-1058:pvr0581:rvnMSI:rnMS-1058:*:ct10:*");
      MODULE_ALIAS("dmi:*:svnMicro-StarInternational:pnMS-1412:*:rvnMSI:rnMS-1412:*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
      MODULE_ALIAS("dmi:*:svnNOTEBOOK:pnSAM2000:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
      
      These lines are specific to my msi-laptop.c driver. They are basically
      just a concatenation of a few carefully selected DMI fields with all
      potentially bad characters stripped.
      
      Besides laptop drivers, modules like "hdaps", the i2c modules
      and the hwmon modules are good candidates for "dmi:" MODULE_ALIAS
      lines.
      
      Besides merely exporting the DMI data via sysfs the patch adds
      support for a few more DMI fields. Especially the CHASSIS fields are
      very useful to identify different laptop modules. The patch also adds
      working MODULE_ALIAS lines to my msi-laptop.c driver.
      
      I'd like to thank Kay Sievers for helping me to clean up this patch
      for posting it on lkml.
      
      Patch is against Linus' current GIT HEAD. Should probably apply to
      older kernels as well without modification.
      Signed-off-by: NLennart Poettering <mzxreary@0pointer.de>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      
      4f5c791a
    • J
      debugfs: add rename for debugfs files · cfc94cdf
      Jan Kara 提交于
      Implement debugfs_rename() to allow renaming files/directories in debugfs.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cfc94cdf
  2. 11 7月, 2007 3 次提交
  3. 10 7月, 2007 26 次提交