14 Nov, 2015

1 commit

  • …/olof/chrome-platform

    Pull chrome platform updates from Olof Johansson:
    "Here's the branch of chrome platform changes for v4.4. Some have been
    queued up for the full 4.3 release cycle since I forgot to send them
    in for that round (rebased early on to deal with fixes conflicts).

    Most of these enable EC communication stuff -- Pixel 2015 support,
    enabling building for ARM64 platforms, and a few fixes for memory
    leaks.

    There's also a patch in here to allow reading/writing the verified
    boot context, which depends on a sysfs patch acked by Greg"

    * tag 'chrome-platform-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform:
    platform/chrome: Fix i2c-designware adapter name
    platform/chrome: Support reading/writing the vboot context
    sysfs: Support is_visible() on binary attributes
    platform/chrome: cros_ec: Fix possible leak in led_rgb_store()
    platform/chrome: cros_ec: Fix leak in sequence_store()
    platform/chrome: Enable Chrome platforms on 64-bit ARM
    platform/chrome: cros_ec_dev - Add a platform device ID table
    platform/chrome: cros_ec_lpc - Add support for Google Pixel 2
    platform/chrome: cros_ec_lpc - Use existing function to check EC result
    platform/chrome: Make depends on MFD_CROS_EC instead CROS_EC_PROTO
    Revert "platform/chrome: Don't make CHROME_PLATFORMS depends on X86 || ARM"

    Linus Torvalds
     

19 Oct, 2015

1 commit


08 Oct, 2015

1 commit

  • According to the sysfs header file:

    "The returned value will replace static permissions defined in
    struct attribute or struct bin_attribute."

    but this isn't the case, as is_visible is only called on struct attribute
    only. This patch introduces a new is_bin_visible() function to implement
    the same functionality for binary attributes, and updates documentation
    accordingly.

    Note that to keep functionality and code similar to that of normal
    attributes, the mode is now checked as well to ensure it contains only
    read/write permissions or SYSFS_PREALLOC.

    Reviewed-by: Guenter Roeck
    Signed-off-by: Emilio López
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Olof Johansson

    Emilio López
     

01 Jul, 2015

1 commit


25 Mar, 2015

1 commit


08 Nov, 2014

1 commit

  • md/raid allows metadata management to be performed in user-space.
    A various times, particularly on device failure, the metadata needs
    to be updated before further writes can be permitted.
    This means that the user-space program which updates metadata much
    not block on writeout, and so must not allocate memory.

    mlockall(MCL_CURRENT|MCL_FUTURE) and pre-allocation can avoid all
    memory allocation issues for user-memory, but that does not help
    kernel memory.
    Several kernel objects can be pre-allocated. e.g. files opened before
    any writes to the array are permitted.
    However some kernel allocation happens in places that cannot be
    pre-allocated.
    In particular, writes to sysfs files (to tell md that it can now
    allow writes to the array) allocate a buffer using GFP_KERNEL.

    This patch allows attributes to be marked as "PREALLOC". In that case
    the maximal buffer is allocated when the file is opened, and then used
    on each write instead of allocating a new buffer.

    As the same buffer is now shared for all writes on the same file
    description, the mutex is extended to cover full use of the buffer
    including the copy_from_user().

    The new __ATTR_PREALLOC() 'or's a new flag in to the 'mode', which is
    inspected by sysfs_add_file_mode_ns() to determine if the file should be
    marked as requiring prealloc.

    Despite the comment, we *do* use ->seq_show together with ->prealloc
    in this patch. The next patch fixes that.

    Signed-off-by: NeilBrown
    Reviewed-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    NeilBrown
     

28 May, 2014

1 commit


17 Apr, 2014

1 commit


07 Apr, 2014

1 commit

  • Pull module updates from Rusty Russell:
    "Nothing major: the stricter permissions checking for sysfs broke a
    staging driver; fix included. Greg KH said he'd take the patch but
    hadn't as the merge window opened, so it's included here to avoid
    breaking build"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    staging: fix up speakup kobject mode
    Use 'E' instead of 'X' for unsigned module taint flag.
    VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms.
    kallsyms: fix percpu vars on x86-64 with relocation.
    kallsyms: generalize address range checking
    module: LLVMLinux: Remove unused function warning from __param_check macro
    Fix: module signature vs tracepoints: add new TAINT_UNSIGNED_MODULE
    module: remove MODULE_GENERIC_TABLE
    module: allow multiple calls to MODULE_DEVICE_TABLE() per module
    module: use pr_cont

    Linus Torvalds
     

26 Mar, 2014

1 commit


24 Mar, 2014

1 commit

  • Summary of http://lkml.org/lkml/2014/3/14/363 :

    Ted: module_param(queue_depth, int, 444)
    Joe: 0444!
    Rusty: User perms >= group perms >= other perms?
    Joe: CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2?

    Side effect of stricter permissions means removing the unnecessary
    S_IFREG from several callers.

    Note that the BUILD_BUG_ON_ZERO((perm) & 2) test was removed: a fair
    number of drivers fail this test, so that will be the debate for a
    future patch.

    Suggested-by: Joe Perches
    Acked-by: Bjorn Helgaas for drivers/pci/slot.c
    Acked-by: Greg Kroah-Hartman
    Cc: Miklos Szeredi
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Rusty Russell

    Rusty Russell
     

08 Feb, 2014

3 commits

  • Currently, kobject is invoking kernfs_enable_ns() directly. This is
    fine now as sysfs and kernfs are enabled and disabled together. If
    sysfs is disabled, kernfs_enable_ns() is switched to dummy
    implementation too and everything is fine; however, kernfs will soon
    have its own config option CONFIG_KERNFS and !SYSFS && KERNFS will be
    possible, which can make kobject call into non-dummy
    kernfs_enable_ns() with NULL kernfs_node pointers leading to an oops.

    Introduce sysfs_enable_ns() which is a wrapper around
    kernfs_enable_ns() so that it can be made a noop depending only on
    CONFIG_SYSFS regardless of the planned CONFIG_KERNFS.

    Signed-off-by: Tejun Heo
    Reported-by: Fengguang Wu
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • All device_schedule_callback_owner() users are converted to use
    device_remove_file_self(). Remove now unused
    {sysfs|device}_schedule_callback_owner().

    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • Sometimes it's necessary to implement a node which wants to delete
    nodes including itself. This isn't straightforward because of kernfs
    active reference. While a file operation is in progress, an active
    reference is held and kernfs_remove() waits for all such references to
    drain before completing. For a self-deleting node, this is a deadlock
    as kernfs_remove() ends up waiting for an active reference that itself
    is sitting on top of.

    This currently is worked around in the sysfs layer using
    sysfs_schedule_callback() which makes such removals asynchronous.
    While it works, it's rather cumbersome and inherently breaks
    synchronicity of the operation - the file operation which triggered
    the operation may complete before the removal is finished (or even
    started) and the removal may fail asynchronously. If a removal
    operation is immmediately followed by another operation which expects
    the specific name to be available (e.g. removal followed by rename
    onto the same name), there's no way to make the latter operation
    reliable.

    The thing is there's no inherent reason for this to be asynchrnous.
    All that's necessary to do this synchronous is a dedicated operation
    which drops its own active ref and deactivates self. This patch
    implements kernfs_remove_self() and its wrappers in sysfs and driver
    core. kernfs_remove_self() is to be called from one of the file
    operations, drops the active ref the task is holding, removes the self
    node, and restores active ref to the dead node so that the ref is
    balanced afterwards. __kernfs_remove() is updated so that it takes an
    early exit if the target node is already fully removed so that the
    active ref restored by kernfs_remove_self() after removal doesn't
    confuse the deactivation path.

    This makes implementing self-deleting nodes very easy. The normal
    removal path doesn't even need to be changed to use
    kernfs_remove_self() for the self-deleting node. The method can
    invoke kernfs_remove_self() on itself before proceeding the normal
    removal path. kernfs_remove() invoked on the node by the normal
    deletion path will simply be ignored.

    This will replace sysfs_schedule_callback(). A subtle feature of
    sysfs_schedule_callback() is that it collapses multiple invocations -
    even if multiple removals are triggered, the removal callback is run
    only once. An equivalent effect can be achieved by testing the return
    value of kernfs_remove_self() - only the one which gets %true return
    value should proceed with actual deletion. All other instances of
    kernfs_remove_self() will wait till the enclosing kernfs operation
    which invoked the winning instance of kernfs_remove_self() finishes
    and then return %false. This trivially makes all users of
    kernfs_remove_self() automatically show correct synchronous behavior
    even when there are multiple concurrent operations - all "echo 1 >
    delete" instances will finish only after the whole operation is
    completed by one of the instances.

    Note that manipulation of active ref is implemented in separate public
    functions - kernfs_[un]break_active_protection().
    kernfs_remove_self() is the only user at the moment but this will be
    used to cater to more complex cases.

    v2: For !CONFIG_SYSFS, dummy version kernfs_remove_self() was missing
    and sysfs_remove_file_self() had incorrect return type. Fix it.
    Reported by kbuild test bot.

    v3: kernfs_[un]break_active_protection() separated out from
    kernfs_remove_self() and exposed as public API.

    Signed-off-by: Tejun Heo
    Cc: Alan Stern
    Cc: kbuild test robot
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

14 Jan, 2014

2 commits

  • This reverts commit 1ae06819c77cff1ea2833c94f8c093fe8a5c79db.

    Tejun writes:
    I'm sorry but can you please revert the whole series?
    get_active() waiting while a node is deactivated has potential
    to lead to deadlock and that deactivate/reactivate interface is
    something fundamentally flawed and that cgroup will have to work
    with the remove_self() like everybody else. IOW, I think the
    first posting was correct.

    Cc: Tejun Heo
    Cc: Alan Stern
    Cc: kbuild test robot
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This reverts commit d1ba277e79889085a2faec3b68b91ce89c63f888.

    Tejun writes:
    I'm sorry but can you please revert the whole series?
    get_active() waiting while a node is deactivated has potential
    to lead to deadlock and that deactivate/reactivate interface is
    something fundamentally flawed and that cgroup will have to work
    with the remove_self() like everybody else. IOW, I think the
    first posting was correct.

    Cc: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

11 Jan, 2014

2 commits

  • All device_schedule_callback_owner() users are converted to use
    device_remove_file_self(). Remove now unused
    {sysfs|device}_schedule_callback_owner().

    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • Sometimes it's necessary to implement a node which wants to delete
    nodes including itself. This isn't straightforward because of kernfs
    active reference. While a file operation is in progress, an active
    reference is held and kernfs_remove() waits for all such references to
    drain before completing. For a self-deleting node, this is a deadlock
    as kernfs_remove() ends up waiting for an active reference that itself
    is sitting on top of.

    This currently is worked around in the sysfs layer using
    sysfs_schedule_callback() which makes such removals asynchronous.
    While it works, it's rather cumbersome and inherently breaks
    synchronicity of the operation - the file operation which triggered
    the operation may complete before the removal is finished (or even
    started) and the removal may fail asynchronously. If a removal
    operation is immmediately followed by another operation which expects
    the specific name to be available (e.g. removal followed by rename
    onto the same name), there's no way to make the latter operation
    reliable.

    The thing is there's no inherent reason for this to be asynchrnous.
    All that's necessary to do this synchronous is a dedicated operation
    which drops its own active ref and deactivates self. This patch
    implements kernfs_remove_self() and its wrappers in sysfs and driver
    core. kernfs_remove_self() is to be called from one of the file
    operations, drops the active ref and deactivates using
    __kernfs_deactivate_self(), removes the self node, and restores active
    ref to the dead node using __kernfs_reactivate_self() so that the ref
    is balanced afterwards. __kernfs_remove() is updated so that it takes
    an early exit if the target node is already fully removed so that the
    active ref restored by kernfs_remove_self() after removal doesn't
    confuse the deactivation path.

    This makes implementing self-deleting nodes very easy. The normal
    removal path doesn't even need to be changed to use
    kernfs_remove_self() for the self-deleting node. The method can
    invoke kernfs_remove_self() on itself before proceeding the normal
    removal path. kernfs_remove() invoked on the node by the normal
    deletion path will simply be ignored.

    This will replace sysfs_schedule_callback(). A subtle feature of
    sysfs_schedule_callback() is that it collapses multiple invocations -
    even if multiple removals are triggered, the removal callback is run
    only once. An equivalent effect can be achieved by testing the return
    value of kernfs_remove_self() - only the one which gets %true return
    value should proceed with actual deletion. All other instances of
    kernfs_remove_self() will wait till the enclosing kernfs operation
    which invoked the winning instance of kernfs_remove_self() finishes
    and then return %false. This trivially makes all users of
    kernfs_remove_self() automatically show correct synchronous behavior
    even when there are multiple concurrent operations - all "echo 1 >
    delete" instances will finish only after the whole operation is
    completed by one of the instances.

    v2: For !CONFIG_SYSFS, dummy version kernfs_remove_self() was missing
    and sysfs_remove_file_self() had incorrect return type. Fix it.
    Reported by kbuild test bot.

    v3: Updated to use __kernfs_{de|re}activate_self().

    Signed-off-by: Tejun Heo
    Cc: Alan Stern
    Cc: kbuild test robot
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

12 Dec, 2013

1 commit

  • kernfs has just been separated out from sysfs and we're already in
    full conflict mode. Nothing can make the situation any worse. Let's
    take the chance to name things properly.

    This patch performs the following renames.

    * s/sysfs_elem_dir/kernfs_elem_dir/
    * s/sysfs_elem_symlink/kernfs_elem_symlink/
    * s/sysfs_elem_attr/kernfs_elem_file/
    * s/sysfs_dirent/kernfs_node/
    * s/sd/kn/ in kernfs proper
    * s/parent_sd/parent/
    * s/target_sd/target/
    * s/dir_sd/parent/
    * s/to_sysfs_dirent()/rb_to_kn()/
    * misc renames of local vars when they conflict with the above

    Because md, mic and gpio dig into sysfs details, this patch ends up
    modifying them. All are sysfs_dirent renames and trivial. While we
    can avoid these by introducing a dummy wrapping struct sysfs_dirent
    around kernfs_node, given the limited usage outside kernfs and sysfs
    proper, I don't think such workaround is called for.

    This patch is strictly rename only and doesn't introduce any
    functional difference.

    - mic / gpio renames were missing. Spotted by kbuild test robot.

    Signed-off-by: Tejun Heo
    Cc: Neil Brown
    Cc: Linus Walleij
    Cc: Ashutosh Dixit
    Cc: kbuild test robot
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

30 Nov, 2013

3 commits

  • Introduce kernfs interface for finding, getting and putting
    sysfs_dirents.

    * sysfs_find_dirent() is renamed to kernfs_find_ns() and lockdep
    assertion for sysfs_mutex is added.

    * sysfs_get_dirent_ns() is renamed to kernfs_find_and_get().

    * Macro inline dancing around __sysfs_get/put() are removed and
    kernfs_get/put() are made proper functions implemented in
    fs/sysfs/dir.c.

    While the conversions are mostly equivalent, there's one difference -
    kernfs_get() doesn't return the input param as its return value. This
    change is intentional. While passing through the input increases
    writability in some areas, it is unnecessary and has been shown to
    cause confusion regarding how the last ref is handled.

    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • Introduce kernfs interface to wake up poll(2) which takes and returns
    sysfs_dirents.

    sysfs_notify_dirent() is renamed to kernfs_notify() and sysfs_notify()
    is updated so that it doesn't directly grab sysfs_mutex but acquires
    the target sysfs_dirents using sysfs_get_dirent().
    sysfs_notify_dirent() is reimplemented as a dumb inline wrapper around
    kernfs_notify().

    This patch doesn't introduce any behavior changes.

    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • Introduce kernfs interface to manipulate a directory which takes and
    returns sysfs_dirents.

    create_dir() is renamed to kernfs_create_dir_ns() and its argumantes
    and return value are updated. create_dir() usages are replaced with
    kernfs_create_dir_ns() and sysfs_create_subdir() usages are replaced
    with kernfs_create_dir(). Dup warnings are handled explicitly by
    sysfs users of the kernfs interface.

    sysfs_enable_ns() is renamed to kernfs_enable_ns().

    This patch doesn't introduce any behavior changes.

    v2: Dummy implementation for !CONFIG_SYSFS updated to return -ENOSYS.

    v3: kernfs_enable_ns() added.

    v4: Refreshed on top of "sysfs: drop kobj_ns_type handling, take #2"
    so that this patch removes sysfs_enable_ns().

    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

28 Nov, 2013

2 commits

  • Core sysfs implementation will be separated into kernfs so that it can
    be used by other non-kobject users.

    This patch creates fs/kernfs/ directory and makes boilerplate changes.
    kernfs interface will be directly based on sysfs_dirent and its
    forward declaration is moved to include/linux/kernfs.h which is
    included from include/linux/sysfs.h. sysfs core implementation will
    be gradually separated out and moved to kernfs.

    This patch doesn't introduce any functional changes.

    v2: mount.c added.

    Signed-off-by: Tejun Heo
    Cc: linux-fsdevel@vger.kernel.org
    Cc: Christoph Hellwig
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • The way namespace tags are implemented in sysfs is more complicated
    than necessary. As each tag is a pointer value and required to be
    non-NULL under a namespace enabled parent, there's no need to record
    separately what type each tag is. If multiple namespace types are
    needed, which currently aren't, we can simply compare the tag to a set
    of allowed tags in the superblock assuming that the tags, being
    pointers, won't have the same value across multiple types.

    This patch rips out kobj_ns_type handling from sysfs. sysfs now has
    an enable switch to turn on namespace under a node. If enabled, all
    children are required to have non-NULL namespace tags and filtered
    against the super_block's tag.

    kobject namespace determination is now performed in
    lib/kobject.c::create_dir() making sysfs_read_ns_type() unnecessary.
    The sanity checks are also moved. create_dir() is restructured to
    ease such addition. This removes most kobject namespace knowledge
    from sysfs proper which will enable proper separation and layering of
    sysfs.

    This is the second try. The first one was cb26a311578e ("sysfs: drop
    kobj_ns_type handling") which tried to automatically enable namespace
    if there are children with non-NULL namespace tags; however, it was
    broken for symlinks as they should inherit the target's tag iff
    namespace is enabled in the parent. This led to namespace filtering
    enabled incorrectly for wireless net class devices through phy80211
    symlinks and thus network configuration failure. a1212d278c05
    ("Revert "sysfs: drop kobj_ns_type handling"") reverted the commit.

    This shouldn't introduce any behavior changes, for real.

    v2: Dummy implementation of sysfs_enable_ns() for !CONFIG_SYSFS was
    missing and caused build failure. Reported by kbuild test robot.

    Signed-off-by: Tejun Heo
    Reported-by: Linus Torvalds
    Cc: Eric W. Biederman
    Cc: Kay Sievers
    Cc: Greg Kroah-Hartman
    Cc: kbuild test robot
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

27 Sep, 2013

4 commits

  • The pre-existing sysfs interfaces which take explicit namespace
    argument are weird in that they place the optional @ns in front of
    @name which is contrary to the established convention. For example,
    we end up forcing vast majority of sysfs_get_dirent() users to do
    sysfs_get_dirent(parent, NULL, name), which is silly and error-prone
    especially as @ns and @name may be interchanged without causing
    compilation warning.

    This renames sysfs_get_dirent() to sysfs_get_dirent_ns() and swap the
    positions of @name and @ns, and sysfs_get_dirent() is now a wrapper
    around sysfs_get_dirent_ns(). This makes confusions a lot less
    likely.

    There are other interfaces which take @ns before @name. They'll be
    updated by following patches.

    This patch doesn't introduce any functional changes.

    v2: EXPORT_SYMBOL_GPL() wasn't updated leading to undefined symbol
    error on module builds. Reported by build test robot. Fixed.

    Signed-off-by: Tejun Heo
    Cc: Eric W. Biederman
    Cc: Kay Sievers
    Cc: Fengguang Wu
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • There's no reason for sysfs to be calling ktype->namespace(). It is
    backwards, obfuscates what's going on and unnecessarily tangles two
    separate layers.

    There are two places where symlink code calls ktype->namespace().

    * sysfs_do_create_link_sd() calls it to find out the namespace tag of
    the target directory. Unless symlinking races with cross-namespace
    renaming, this equals @target_sd->s_ns.

    * sysfs_rename_link() uses it to find out the new namespace to rename
    to and the new namespace can be different from the existing one.
    The function is renamed to sysfs_rename_link_ns() with an explicit
    @ns argument and the ktype->namespace() invocation is shifted to the
    device layer.

    While this patch replaces ktype->namespace() invocation with the
    recorded result in @target_sd, this shouldn't result in any behvior
    difference.

    Signed-off-by: Tejun Heo
    Cc: Eric W. Biederman
    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • For some unrecognizable reason, namespace information is communicated
    to sysfs through ktype->namespace() callback when there's *nothing*
    which needs the use of a callback. The whole sequence of operations
    is completely synchronous and sysfs operations simply end up calling
    back into the layer which just invoked it in order to find out the
    namespace information, which is completely backwards, obfuscates
    what's going on and unnecessarily tangles two separate layers.

    This patch doesn't remove ktype->namespace() but shifts its handling
    to kobject layer. We probably want to get rid of the callback in the
    long term.

    This patch adds an explicit param to sysfs_{create|rename|move}_dir()
    and renames them to sysfs_{create|rename|move}_dir_ns(), respectively.
    ktype->namespace() invocations are moved to the calling sites of the
    above functions. A new helper kboject_namespace() is introduced which
    directly tests kobj_ns_type_operations->type which should give the
    same result as testing sysfs_fs_type(parent_sd) and returns @kobj's
    namespace tag as necessary. kobject_namespace() is extern as it will
    be used from another file in the following patches.

    This patch should be an equivalent conversion without any functional
    difference.

    Signed-off-by: Tejun Heo
    Cc: Eric W. Biederman
    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • sysfs ns (namespace) implementation became more convoluted than
    necessary while trying to hide ns information from visible interface.
    The relatively recent attr ns support is a good example.

    * attr ns tag is determined by sysfs_ops->namespace() callback while
    dir tag is determined by kobj_type->namespace(). The placement is
    arbitrary.

    * Instead of performing operations with explicit ns tag, the namespace
    callback is routed through sysfs_attr_ns(), sysfs_ops->namespace(),
    class_attr_namespace(), class_attr->namespace(). It's not simpler
    in any sense. The only thing this convolution does is traversing
    the whole stack backwards.

    The namespace callbacks are unncessary because the operations involved
    are inherently synchronous. The information can be provided in in
    straight-forward top-down direction and reversing that direction is
    unnecessary and against basic design principles.

    This backward interface is unnecessarily convoluted and hinders
    properly separating out sysfs from driver model / kobject for proper
    layering. This patch updates attr ns support such that

    * sysfs_ops->namespace() and class_attr->namespace() are dropped.

    * sysfs_{create|remove}_file_ns(), which take explicit @ns param, are
    added and sysfs_{create|remove}_file() are now simple wrappers
    around the ns aware functions.

    * ns handling is dropped from sysfs_chmod_file(). Nobody uses it at
    this point. sysfs_chmod_file_ns() can be added later if necessary.

    * Explicit @ns is propagated through class_{create|remove}_file_ns()
    and netdev_class_{create|remove}_file_ns().

    * driver/net/bonding which is currently the only user of attr
    namespace is updated to use netdev_class_{create|remove}_file_ns()
    with @bh->net as the ns tag instead of using the namespace callback.

    This patch should be an equivalent conversion without any functional
    difference. It makes the code easier to follow, reduces lines of code
    a bit and helps proper separation and layering.

    Signed-off-by: Tejun Heo
    Cc: Eric W. Biederman
    Cc: Kay Sievers
    Acked-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

29 Aug, 2013

1 commit


28 Aug, 2013

1 commit


24 Aug, 2013

1 commit


23 Aug, 2013

1 commit

  • Gotta love a macro that doesn't reduce the typing you have to do.

    Also, only the driver core, and one network driver uses this. The
    driver core functions will be going away soon, and I'll convert the
    network driver soon to not need this as well, so delete it for now
    before anyone else gets some bright ideas and wants to use it.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

22 Aug, 2013

2 commits


21 Aug, 2013

1 commit

  • __BIN_ATTR_RW() wasn't passing in the _size field. As it would break
    the build if this macro was ever used, it's obvious no one had ever
    tried to use it before.

    Fix it so that it can be used.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

17 Jul, 2013

5 commits