Skip to content
Snippets Groups Projects
Select Git revision
  • ede1bf0dcff2b07001c760992b1ca18fd0f419bc
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

namespace.c

Blame
    • Yann Droneaud's avatar
      ede1bf0d
      fs: use seq_open_private() for proc_mounts · ede1bf0d
      Yann Droneaud authored
      A patchset to remove support for passing pre-allocated struct seq_file to
      seq_open().  Such feature is undocumented and prone to error.
      
      In particular, if seq_release() is used in release handler, it will
      kfree() a pointer which was not allocated by seq_open().
      
      So this patchset drops support for pre-allocated struct seq_file: it's
      only of use in proc_namespace.c and can be easily replaced by using
      seq_open_private()/seq_release_private().
      
      Additionally, it documents the use of file->private_data to hold pointer
      to struct seq_file by seq_open().
      
      This patch (of 3):
      
      Since patch described below, from v2.6.15-rc1, seq_open() could use a
      struct seq_file already allocated by the caller if the pointer to the
      structure is stored in file->private_data before calling the function.
      
          Commit 1abe77b0
          Author: Al Viro <viro@zeniv.linux.org.uk>
          Date:   Mon Nov 7 17:15:34 2005 -0500
      
              [PATCH] allow callers of seq_open do allocation themselves
      
              Allow caller of seq_open() to kmalloc() seq_file + whatever else they
              want and set ->private_data to it.  seq_open() will then abstain from
              doing allocation itself.
      
      Such behavior is only used by mounts_open_common().
      
      In order to drop support for such uncommon feature, proc_mounts is
      converted to use seq_open_private(), which take care of allocating the
      proc_mounts structure, making it available through ->private in struct
      seq_file.
      
      Conversely, proc_mounts is converted to use seq_release_private(), in
      order to release the private structure allocated by seq_open_private().
      
      Then, ->private is used directly instead of proc_mounts() macro to access
      to the proc_mounts structure.
      
      Link: http://lkml.kernel.org/r/cover.1433193673.git.ydroneaud@opteya.com
      
      
      Signed-off-by: default avatarYann Droneaud <ydroneaud@opteya.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ede1bf0d
      History
      fs: use seq_open_private() for proc_mounts
      Yann Droneaud authored
      A patchset to remove support for passing pre-allocated struct seq_file to
      seq_open().  Such feature is undocumented and prone to error.
      
      In particular, if seq_release() is used in release handler, it will
      kfree() a pointer which was not allocated by seq_open().
      
      So this patchset drops support for pre-allocated struct seq_file: it's
      only of use in proc_namespace.c and can be easily replaced by using
      seq_open_private()/seq_release_private().
      
      Additionally, it documents the use of file->private_data to hold pointer
      to struct seq_file by seq_open().
      
      This patch (of 3):
      
      Since patch described below, from v2.6.15-rc1, seq_open() could use a
      struct seq_file already allocated by the caller if the pointer to the
      structure is stored in file->private_data before calling the function.
      
          Commit 1abe77b0
          Author: Al Viro <viro@zeniv.linux.org.uk>
          Date:   Mon Nov 7 17:15:34 2005 -0500
      
              [PATCH] allow callers of seq_open do allocation themselves
      
              Allow caller of seq_open() to kmalloc() seq_file + whatever else they
              want and set ->private_data to it.  seq_open() will then abstain from
              doing allocation itself.
      
      Such behavior is only used by mounts_open_common().
      
      In order to drop support for such uncommon feature, proc_mounts is
      converted to use seq_open_private(), which take care of allocating the
      proc_mounts structure, making it available through ->private in struct
      seq_file.
      
      Conversely, proc_mounts is converted to use seq_release_private(), in
      order to release the private structure allocated by seq_open_private().
      
      Then, ->private is used directly instead of proc_mounts() macro to access
      to the proc_mounts structure.
      
      Link: http://lkml.kernel.org/r/cover.1433193673.git.ydroneaud@opteya.com
      
      
      Signed-off-by: default avatarYann Droneaud <ydroneaud@opteya.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    async-thread.c 17.84 KiB