Re: [PATCH 00/28] Reenable maybe-uninitialized warnings

2016-10-17 Thread Christoph Hellwig
On Tue, Oct 18, 2016 at 12:03:28AM +0200, Arnd Bergmann wrote: > This is a set of patches that I hope to get into v4.9 in some form > in order to turn on the -Wmaybe-uninitialized warnings again. Hi Arnd, I jsut complained to Geert that I was introducing way to many bugs or pointless warnings

Re: [PATCH v2 7/7] uapi: export all headers under uapi directories

2017-01-09 Thread Christoph Hellwig
On Fri, Jan 06, 2017 at 10:43:59AM +0100, Nicolas Dichtel wrote: > Regularly, when a new header is created in include/uapi/, the developer > forgets to add it in the corresponding Kbuild file. This error is usually > detected after the release is out. > > In fact, all headers under uapi

Re: simplify procfs code for seq_file instances V2

2018-05-15 Thread Christoph Hellwig
On Sun, May 06, 2018 at 08:19:49PM +0300, Alexey Dobriyan wrote: > On Wed, Apr 25, 2018 at 05:47:47PM +0200, Christoph Hellwig wrote: > > Changes since V1: > > - open code proc_create_data to avoid setting not fully initialized > >entries live > > - use unsigned i

Re: [PATCH 34/40] atm: simplify procfs code

2018-05-15 Thread Christoph Hellwig
On Sat, May 05, 2018 at 07:51:18AM -0500, Eric W. Biederman wrote: > Christoph Hellwig <h...@lst.de> writes: > > > Use remove_proc_subtree to remove the whole subtree on cleanup, and > > unwind the registration loop into individual calls. Switch to use > > pr

Re: [PATCH 06/40] proc: introduce proc_create_single{,_data}

2018-05-15 Thread Christoph Hellwig
On Thu, Apr 26, 2018 at 11:45:50AM +1000, Finn Thain wrote: > > > > -/* > > - * /proc/nubus stuff > > - */ > > - > > I don't think that the introduction of proc_create_single{,_data} alters > the value of that comment. That comment and similar comments in the same > file do have a purpose,

Re: [PATCH 04/40] proc: introduce proc_create_seq{,_data}

2018-05-15 Thread Christoph Hellwig
On Mon, Apr 30, 2018 at 02:19:25PM +0100, David Howells wrote: > Christoph Hellwig <h...@lst.de> wrote: > > > + > > +struct proc_dir_entry *proc_create_seq_data(const char *name, umode_t mode, > > + struct proc_dir_entry *parent, const struct seq_operati

Re: [PATCH 11/40] ipv6/flowlabel: simplify pid namespace lookup

2018-05-15 Thread Christoph Hellwig
On Sat, May 05, 2018 at 07:37:33AM -0500, Eric W. Biederman wrote: > Christoph Hellwig <h...@lst.de> writes: > > > The shole seq_file sequence already operates under a single RCU lock pair, > > so move the pid namespace lookup into it, and stop grabbing a reference

Re: [PATCH 11/40] ipv6/flowlabel: simplify pid namespace lookup

2018-05-17 Thread Christoph Hellwig
On Thu, May 17, 2018 at 12:28:01AM -0500, Eric W. Biederman wrote: > > struct pid_namespace *proc_pid_namespace(struct inode *inode) > > { > > // maybe warn on for s_magic not on procfs?? > > return inode->i_sb->s_fs_info; > > } > > That should work. Ideally out of line for the proc_fs.h

[PATCH 33/42] netfilter/xt_hashlimit: switch to proc_create_{seq,single}_data

2018-05-16 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/netfilter/xt_hashlimit.c | 92 +++- 1 file changed, 18 insertions(+), 74 deletions(-) diff --git a/net/

[PATCH 41/42] tty: replace ->proc_fops with ->proc_show

2018-05-16 Thread Christoph Hellwig
Just set up the show callback in the tty_operations, and use proc_create_single_data to create the file without additional boilerplace code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/ia64/hp/sim/simserial.c| 15 +-- arch/xtensa/platforms/iss/console.

[PATCH 27/42] resource: switch to proc_create_seq_data

2018-05-16 Thread Christoph Hellwig
And use the root resource directly from the proc private data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- kernel/resource.c | 43 +-- 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c

[PATCH 34/42] netfilter/x_tables: switch to proc_create_seq_private

2018-05-16 Thread Christoph Hellwig
And remove proc boilerplate code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/netfilter/x_tables.c | 42 ++-- 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 344dd0

[PATCH 23/42] afs: simplify procfs code

2018-05-16 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/afs/proc.c | 134 ++-

[PATCH 29/42] rtc/proc: switch to proc_create_single_data

2018-05-16 Thread Christoph Hellwig
And stop trying to get a reference on the submodule, procfs code deals with release after an unloaded module and thus removed proc entry. Signed-off-by: Christoph Hellwig <h...@lst.de> Acked-by: Alexandre Belloni <alexandre.bell...@bootlin.com> --- drivers/rtc/rtc

[PATCH 11/42] ipv{4,6}/ping: simplify proc file creation

2018-05-16 Thread Christoph Hellwig
Remove the pointless ping_seq_afinfo indirection and make the code look like most other protocols. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/net/ping.h | 11 -- net/ipv4/ping.c| 50 +- net/ipv6/ping.c

[PATCH 05/42] proc: add a proc_create_reg helper

2018-05-16 Thread Christoph Hellwig
Common code for creating a regular file. Factor out of proc_create_data, to be reused by other functions soon. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/proc/generic.c | 44 +--- fs/proc/internal.h | 2 ++ 2 files changed, 27 inse

[PATCH 12/42] ipv{4,6}/raw: simplify ѕeq_file code

2018-05-16 Thread Christoph Hellwig
Pass the hashtable to the proc private data instead of copying it into the per-file private data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/net/raw.h | 4 net/ipv4/raw.c| 36 net/ipv6/raw.c| 6 -- 3 files chang

[PATCH 02/42] proc: introduce a proc_pid_ns helper

2018-05-16 Thread Christoph Hellwig
Factor out retrieving the per-sb pid namespaces from the sb private data into an easier to understand helper. Suggested-by: Eric W. Biederman <ebied...@xmission.com> Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/proc/array.c | 7 +-- fs/proc/base.c

[PATCH 10/42] ipv{4,6}/tcp: simplify procfs registration

2018-05-16 Thread Christoph Hellwig
Avoid most of the afinfo indirections and just call the proc helpers directly. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/net/tcp.h | 11 ++ net/ipv4/tcp_ipv4.c | 85 + net/ipv6/tcp_ipv6.c | 27 +- 3 files chang

[PATCH 32/42] neigh: switch to proc_create_seq_data

2018-05-16 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/core/neighbour.c | 31 ++- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/net/core/neighbour.c b

[PATCH 30/42] bonding: switch to proc_create_seq_data

2018-05-16 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/net/bonding/bond_procfs.c | 36 ++- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/drivers/ne

[PATCH 38/42] isdn: replace ->proc_fops with ->proc_show

2018-05-16 Thread Christoph Hellwig
And switch to proc_create_single_data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/isdn/capi/kcapi.c | 3 ++- drivers/isdn/gigaset/capi.c| 16 +--- drivers/isdn/hardware/avm/avmcard.h| 4 ++-- drivers/isdn/hardware/avm/b1.c

[PATCH 35/42] bluetooth: switch to proc_create_seq_data

2018-05-16 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private and private state. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/bluetooth/af_bluetooth.c | 40 +--- 1 file changed, 5 insertions(+), 35 deletions(-) diff --

[PATCH 37/42] atm: switch to proc_create_seq_private

2018-05-16 Thread Christoph Hellwig
And remove proc boilerplate code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/atm/proc.c | 72 +- 1 file changed, 13 insertions(+), 59 deletions(-) diff --git a/net/atm/proc.c b/net/atm/proc.c index f272b0f59d82..0b0495a41bbe

[PATCH 36/42] atm: simplify procfs code

2018-05-16 Thread Christoph Hellwig
will handle missing files gracefully. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/atm/proc.c | 65 ++ 1 file changed, 7 insertions(+), 58 deletions(-) diff --git a/net/atm/proc.c b/net/atm/proc.c index 55410c00c7e2..f272b0f59d82

[PATCH 24/42] ext4: simplify procfs code

2018-05-16 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/ext4/ext4.h| 2 +- fs/ext4/mballoc.

[PATCH 14/42] net/kcm: simplify proc registration

2018-05-16 Thread Christoph Hellwig
Remove a couple indirections to make the code look like most other protocols. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/kcm/kcmproc.c | 71 --- 1 file changed, 17 insertions(+), 54 deletions(-) diff --git a/net/kcm/kcmproc.c b/n

[PATCH 31/42] hostap: switch to proc_create_{seq,single}_data

2018-05-16 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private. Signed-off-by: Christoph Hellwig <h...@lst.de> --- .../net/wireless/intersil/hostap/hostap_ap.c | 70 ++--- .../net/wireless/intersil/hostap/hostap_hw.c | 17 +-- .../wireless/intersil/hostap/host

[PATCH 17/42] proc: introduce proc_create_net{,_data}

2018-05-16 Thread Christoph Hellwig
Variants of proc_create{,_data} that directly take a struct seq_operations and deal with network namespaces in ->open and ->release. All callers of proc_create + seq_open_net converted over, and seq_{open,release}_net are removed entirely. Signed-off-by: Christoph Hellwig <h.

[PATCH 06/42] proc: introduce proc_create_seq{,_data}

2018-05-16 Thread Christoph Hellwig
Variants of proc_create{,_data} that directly take a struct seq_operations argument and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/ia64/hp/common/sba_iommu.c | 15 +- arch/ia64/

[PATCH 04/42] proc: simplify proc_register calling conventions

2018-05-16 Thread Christoph Hellwig
Return registered entry on success, return NULL on failure and free the passed in entry. Also expose it in internal.h as we'll start using it in proc_net.c soon. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/proc/generic.c | 44 ++-- f

[PATCH 39/42] ide: remove ide_driver_proc_write

2018-05-16 Thread Christoph Hellwig
The driver proc file hasn't been writeable for a long time, so this is just dead code. Signed-off-by: Christoph Hellwig <h...@lst.de> Acked-by: "Eric W. Biederman" <ebied...@xmission.com> --- drivers/ide/ide-proc.c | 46 -- 1 file

[PATCH 18/42] proc: introduce proc_create_net_single

2018-05-16 Thread Christoph Hellwig
Variant of proc_create_data that directly take a seq_file show callback and deals with network namespaces in ->open and ->release. All callers of proc_create + single_open_net converted over, and single_{open,release}_net are removed entirely. Signed-off-by: Christoph Hellwig <h.

[PATCH 20/42] sgi-gru: simplify procfs code

2018-05-16 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/misc/sgi-gru/gruprocfs.c | 81 ++---

[PATCH 15/42] netfilter/x_tables: simplify ѕeq_file code

2018-05-16 Thread Christoph Hellwig
Just use the address family from the proc private data instead of copying it into per-file data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/netfilter/x_tables.c | 39 +++ 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/net/net

[PATCH 19/42] acpi/battery: simplify procfs code

2018-05-16 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Rafael J. Wysocki <rafael.j.wyso...@intel.com> ---

[PATCH 28/42] drbd: switch to proc_create_single

2018-05-16 Thread Christoph Hellwig
And stop messing with try_module_get on THIS_MODULE, which doesn't make any sense here. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/block/drbd/drbd_int.h | 2 +- drivers/block/drbd/drbd_main.c | 3 ++- drivers/block/drbd/drbd_proc.c | 34 +--

[PATCH 25/42] jfs: simplify procfs code

2018-05-16 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/jfs/jfs_debug.c| 43 ++---

[PATCH 21/42] megaraid: simplify procfs code

2018-05-16 Thread Christoph Hellwig
files gracefully. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/megaraid.c | 140 +++- drivers/scsi/megaraid.h | 12 2 files changed, 36 insertions(+), 116 deletions(-) diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/mega

[PATCH 16/42] net: move seq_file_single_net to

2018-05-16 Thread Christoph Hellwig
This helper deals with single_{open,release}_net internals and thus belongs here. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/linux/seq_file_net.h | 13 + include/net/ip_vs.h | 12 2 files changed, 13 insertions(+), 12 deletions(-) diff

Re: [PATCH 38/42] isdn: replace ->proc_fops with ->proc_show

2018-05-18 Thread Christoph Hellwig
On Fri, May 18, 2018 at 10:43:46AM +0200, Paul Bolle wrote: > > iif->ctr.release_appl = gigaset_release_appl; > > iif->ctr.send_message = gigaset_send_message; > > - iif->ctr.procinfo = gigaset_procinfo; > > Is this intentional? You didn't touch the procinfo method in the other

[PATCH 01/42] net/can: single_open_net needs to be paired with single_release_net

2018-05-16 Thread Christoph Hellwig
Otherwise we will leak a reference to the network namespace. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/can/bcm.c | 2 +- net/can/proc.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/can/bcm.c b/net/can/bcm.c index ac5e5e34fee3..8073fa14e143

simplify procfs code for seq_file instances V3

2018-05-16 Thread Christoph Hellwig
We currently have hundreds of proc files that implement plain, read-only seq_file based interfaces. This series consolidates them using new procfs helpers that take the seq_operations or simple show callback directly. A git tree is available at: git://git.infradead.org/users/hch/misc.git

[PATCH 40/42] ide: replace ->proc_fops with ->proc_show

2018-05-16 Thread Christoph Hellwig
Just set up the show callback in the tty_operations, and use proc_create_single_data to create the file without additional boilerplace code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/ide/ide-cd.c | 15 +--- drivers/ide/ide-disk_proc.c | 62 ++-- d

[PATCH 42/42] proc: update SIZEOF_PDE_INLINE_NAME for the new pde fields

2018-05-16 Thread Christoph Hellwig
This makes Alexey happy and Al groan. Based on a patch from Alexey Dobriyan. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/proc/internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 84c68508a256..a318ae

[PATCH 26/42] staging/rtl8192u: simplify procfs code

2018-05-16 Thread Christoph Hellwig
Unwind the registration loop into individual calls. Switch to use proc_create_single where applicable. Also don't bother handling proc_create* failures - the driver works perfectly fine without the proc files, and the cleanup will handle missing files gracefully. Signed-off-by: Christoph

[PATCH 22/42] sg: simplify procfs code

2018-05-16 Thread Christoph Hellwig
will handle missing files gracefully. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/sg.c | 124 +- 1 file changed, 12 insertions(+), 112 deletions(-) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index c198b96368dd..8ff687158704

[PATCH 13/42] ipv6/flowlabel: simplify pid namespace lookup

2018-05-16 Thread Christoph Hellwig
The code should be using the pid namespace from the procfs mount instead of trying to look it up during open. Suggested-by: Eric W. Biederman <ebied...@xmission.com> Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/ipv6/ip6_flowlabel.c | 29 ++--- 1 fil

[PATCH 03/42] proc: don't detour through seq->private to get the inode

2018-05-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/proc/array.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/fs/proc/array.c b/fs/proc/array.c index 911f66924d81..4a8e413bf59b 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -677,20 +

[PATCH 07/42] proc: introduce proc_create_seq_private

2018-05-16 Thread Christoph Hellwig
Variant of proc_create_data that directly take a struct seq_operations argument + a private state size and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/locks.c

[PATCH 28/39] hostap: switch to proc_create_{seq,single}_data

2018-04-19 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private. Signed-off-by: Christoph Hellwig <h...@lst.de> --- .../net/wireless/intersil/hostap/hostap_ap.c | 70 ++--- .../net/wireless/intersil/hostap/hostap_hw.c | 17 +-- .../wireless/intersil/hostap/host

[PATCH 35/39] isdn: replace ->proc_fops with ->proc_show

2018-04-19 Thread Christoph Hellwig
And switch to proc_create_single_data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/isdn/capi/kcapi.c | 3 ++- drivers/isdn/gigaset/capi.c| 16 +--- drivers/isdn/hardware/avm/avmcard.h| 4 ++-- drivers/isdn/hardware/avm/b1.c

[PATCH 22/39] jfs: simplify procfs code

2018-04-19 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/jfs/jfs_debug.c| 43 ++---

[PATCH 17/39] sgi-gru: simplify procfs code

2018-04-19 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/misc/sgi-gru/gruprocfs.c | 81 ++---

[PATCH 18/39] megaraid: simplify procfs code

2018-04-19 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_single. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/megaraid.c | 140 +++- driver

[PATCH 04/39] proc: introduce proc_create_single{,_data}

2018-04-19 Thread Christoph Hellwig
Variants of proc_create{,_data} that directly take a seq_file show callback and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/kernel/dma.c | 14 +--- ar

[PATCH 08/39] ipv{4,6}/raw: simplify ѕeq_file code

2018-04-19 Thread Christoph Hellwig
Pass the hashtable to the proc private data instead of copying it into the per-file private data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/net/raw.h | 4 net/ipv4/raw.c| 36 net/ipv6/raw.c| 6 -- 3 files chang

[PATCH 03/39] proc: introduce proc_create_seq_private

2018-04-19 Thread Christoph Hellwig
Variant of proc_create_data that directly take a struct seq_operations argument + a private state size and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/s390/cio/blacklist.

[PATCH 07/39] ipv{4,6}/ping: simplify proc file creation

2018-04-19 Thread Christoph Hellwig
Remove the pointless ping_seq_afinfo indirection and make the code look like most other protocols. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/net/ping.h | 11 -- net/ipv4/ping.c| 50 +- net/ipv6/ping.c

[PATCH 30/39] netfilter/xt_hashlimit: switch to proc_create_{seq,single}_data

2018-04-19 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/netfilter/xt_hashlimit.c | 92 +++- 1 file changed, 18 insertions(+), 74 deletions(-) diff --git a/net/

[PATCH 19/39] sg: simplify procfs code

2018-04-19 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/sg.c | 124 +--

[PATCH 37/39] ide: remove ide_driver_proc_write

2018-04-19 Thread Christoph Hellwig
The driver proc file hasn't been writeable for a long time, so this is just dead code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/ide/ide-proc.c | 46 -- 1 file changed, 46 deletions(-) diff --git a/drivers/ide/ide-proc.c b/drivers/i

[PATCH 25/39] drbd: switch to proc_create_single

2018-04-19 Thread Christoph Hellwig
And stop messing with try_module_get on THIS_MODULE, which doesn't make any sense here. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/block/drbd/drbd_int.h | 2 +- drivers/block/drbd/drbd_main.c | 3 ++- drivers/block/drbd/drbd_proc.c | 34 +--

[PATCH 34/39] atm: switch to proc_create_seq_private

2018-04-19 Thread Christoph Hellwig
And remove proc boilerplate code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/atm/proc.c | 72 +- 1 file changed, 13 insertions(+), 59 deletions(-) diff --git a/net/atm/proc.c b/net/atm/proc.c index f272b0f59d82..0b0495a41bbe

[PATCH 11/39] netfilter/x_tables: simplify ѕeq_file code

2018-04-19 Thread Christoph Hellwig
Just use the address family from the proc private data instead of copying it into per-file data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/netfilter/x_tables.c | 39 +++ 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/net/net

[PATCH 38/39] ide: replace ->proc_fops with ->proc_show

2018-04-19 Thread Christoph Hellwig
Just set up the show callback in the tty_operations, and use proc_create_single_data to create the file without additional boilerplace code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/ide/ide-cd.c | 15 +--- drivers/ide/ide-disk_proc.c | 62 ++-- d

[PATCH 36/39] proc: don't detour through seq->private to get the inode

2018-04-19 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/proc/array.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/fs/proc/array.c b/fs/proc/array.c index ae2c807fd719..b34796b562ef 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -677,7

[PATCH 15/39] acpi/battery: simplify procfs code

2018-04-19 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/acpi/battery.c | 121 +-

[PATCH 29/39] neigh: switch to proc_create_seq_data

2018-04-19 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/core/neighbour.c | 31 ++- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/net/core/neighbour.c b

[PATCH 23/39] staging/rtl8192u: simplify procfs code

2018-04-19 Thread Christoph Hellwig
Unwind the registration loop into individual calls. Switch to use proc_create_single where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/staging/rtl8192u/r8192U_core.c | 67 ++ 1 file changed, 14 insertions(+), 53 deletions(-) diff

[PATCH 20/39] afs: simplify procfs code

2018-04-19 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/afs/proc.c | 134 ++-

[PATCH 21/39] ext4: simplify procfs code

2018-04-19 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/ext4/ext4.h| 2 +- fs/ext4/mballoc.

[PATCH 16/39] ipmi: simplify procfs code

2018-04-19 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup instead of a hand rolled list of proc entries, unwind the registration loop into individual calls. Switch to use proc_create_single to further simplify the code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/cha

[PATCH 06/39] ipv{4,6}/tcp: simplify procfs registration

2018-04-19 Thread Christoph Hellwig
Avoid most of the afinfo indirections and just call the proc helpers directly. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/net/tcp.h | 11 ++ net/ipv4/tcp_ipv4.c | 85 + net/ipv6/tcp_ipv6.c | 27 +- 3 files chang

[PATCH 05/39] ipv{4,6}/udp{,lite}: simplify proc registration

2018-04-19 Thread Christoph Hellwig
Remove a couple indirections to make the code look like most other protocols. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/net/udp.h | 20 -- net/ipv4/udp.c | 99 +- net/ipv4/udplite.c | 21 +++--- net/ipv6/udp.c

[PATCH 33/39] atm: simplify procfs code

2018-04-19 Thread Christoph Hellwig
Use remove_proc_subtree to remove the whole subtree on cleanup, and unwind the registration loop into individual calls. Switch to use proc_create_seq where applicable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/atm/proc.c | 65 ++-

[PATCH 32/39] bluetooth: switch to proc_create_seq_data

2018-04-19 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private and private state. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/bluetooth/af_bluetooth.c | 40 +--- 1 file changed, 5 insertions(+), 35 deletions(-) diff --

simplify procfs code for seq_file instances

2018-04-19 Thread Christoph Hellwig
We currently have hundreds of proc files that implement plain, read-only seq_file based interfaces. This series consolidates them using new procfs helpers that take the seq_operations or simple show callback directly. A git tree is available at: git://git.infradead.org/users/hch/misc.git

[PATCH 01/39] net/can: single_open_net needs to be paired with single_release_net

2018-04-19 Thread Christoph Hellwig
Otherwise we will leak a reference to the network namespace. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/can/bcm.c | 2 +- net/can/proc.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/can/bcm.c b/net/can/bcm.c index ac5e5e34fee3..8073fa14e143

[PATCH 12/39] net: move seq_file_single_net to

2018-04-19 Thread Christoph Hellwig
This helper deals with single_{open,release}_net internals and thus belongs here. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/linux/seq_file_net.h | 13 + include/net/ip_vs.h | 12 2 files changed, 13 insertions(+), 12 deletions(-) diff

[PATCH 10/39] net/kcm: simplify proc registration

2018-04-19 Thread Christoph Hellwig
Remove a couple indirections to make the code look like most other protocols. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/kcm/kcmproc.c | 71 --- 1 file changed, 17 insertions(+), 54 deletions(-) diff --git a/net/kcm/kcmproc.c b/n

[PATCH 09/39] ipv6/flowlabel: simplify pid namespace lookup

2018-04-19 Thread Christoph Hellwig
The shole seq_file sequence already operates under a single RCU lock pair, so move the pid namespace lookup into it, and stop grabbing a reference and remove all kinds of boilerplate code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/ipv6/ip6_flowlabel.

[PATCH 13/39] proc: introduce proc_create_net{,_data}

2018-04-19 Thread Christoph Hellwig
Variants of proc_create{,_data} that directly take a struct seq_operations and deal with network namespaces in ->open and ->release. All callers of proc_create + seq_open_net converted over, and seq_{open,release}_net are removed entirely. Signed-off-by: Christoph Hellwig <h.

[PATCH 39/39] tty: replace ->proc_fops with ->proc_show

2018-04-19 Thread Christoph Hellwig
Just set up the show callback in the tty_operations, and use proc_create_single_data to create the file without additional boilerplace code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/ia64/hp/sim/simserial.c| 15 +-- arch/xtensa/platforms/iss/console.

[PATCH 24/39] resource: switch to proc_create_seq_data

2018-04-19 Thread Christoph Hellwig
And use the root resource directly from the proc private data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- kernel/resource.c | 43 +-- 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c

[PATCH 27/39] bonding: switch to proc_create_seq_data

2018-04-19 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/net/bonding/bond_procfs.c | 36 ++- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/drivers/ne

[PATCH 26/39] rtc/proc: switch to proc_create_single_data

2018-04-19 Thread Christoph Hellwig
And stop trying to get a reference on the submodule, procfs code deals with release after and unloaded module and thus removed proc entry. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/rtc/rtc-proc.c | 33 ++--- 1 file changed, 2 insertions(

Re: simplify procfs code for seq_file instances

2018-04-24 Thread Christoph Hellwig
On Tue, Apr 24, 2018 at 08:19:16AM -0700, Andrew Morton wrote: > > > I want to ask if it is time to start using poorman function overloading > > > with _b_c_e(). There are millions of allocation functions for example, > > > all slightly difference, and people will add more. Seeing /proc interfaces

Re: [PATCH 26/39] rtc/proc: switch to proc_create_single_data

2018-04-24 Thread Christoph Hellwig
On Thu, Apr 19, 2018 at 03:10:27PM +0200, Alexandre Belloni wrote: > On 19/04/2018 14:41:27+0200, Christoph Hellwig wrote: > > And stop trying to get a reference on the submodule, procfs code deals > > with release after and unloaded module and thus removed proc entry. > > &g

Re: [PATCH 16/39] ipmi: simplify procfs code

2018-04-24 Thread Christoph Hellwig
On Thu, Apr 19, 2018 at 10:29:29AM -0500, Corey Minyard wrote: > On 04/19/2018 07:41 AM, Christoph Hellwig wrote: >> Use remove_proc_subtree to remove the whole subtree on cleanup instead >> of a hand rolled list of proc entries, unwind the registration loop into >> indi

Re: [PATCH 03/39] proc: introduce proc_create_seq_private

2018-04-24 Thread Christoph Hellwig
On Thu, Apr 19, 2018 at 05:18:18PM +0300, Dan Carpenter wrote: > > -static const struct file_operations cio_ignore_proc_fops = { > > - .open= cio_ignore_proc_open, > > - .read= seq_read, > > - .llseek = seq_lseek, > > - .release = seq_release_private, > > - .write =

Re: simplify procfs code for seq_file instances

2018-04-24 Thread Christoph Hellwig
On Thu, Apr 19, 2018 at 09:57:50PM +0300, Alexey Dobriyan wrote: > > git://git.infradead.org/users/hch/misc.git proc_create > > > I want to ask if it is time to start using poorman function overloading > with _b_c_e(). There are millions of allocation functions for example, > all slightly

Re: [PATCH 03/39] proc: introduce proc_create_seq_private

2018-04-24 Thread Christoph Hellwig
On Thu, Apr 19, 2018 at 09:50:27PM +0300, Alexey Dobriyan wrote: > On Thu, Apr 19, 2018 at 02:41:04PM +0200, Christoph Hellwig wrote: > > Variant of proc_create_data that directly take a struct seq_operations > > > --- a/fs/proc/internal.h > > +++ b/fs/proc/internal.h >

Re: [PATCH 02/39] proc: introduce proc_create_seq{,_data}

2018-04-24 Thread Christoph Hellwig
On Thu, Apr 19, 2018 at 09:41:06PM +0300, Alexey Dobriyan wrote: > Should be oopsable. > Once proc_create_data() returns, entry is live, ->open can be called. Ok, switching to opencoding proc_create_data instead. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the

[PATCH 06/40] proc: introduce proc_create_single{,_data}

2018-04-25 Thread Christoph Hellwig
Variants of proc_create{,_data} that directly take a seq_file show callback and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/kernel/dma.c | 14 +--- ar

[PATCH 02/40] proc: simplify proc_register calling conventions

2018-04-25 Thread Christoph Hellwig
Return registered entry on success, return NULL on failure and free the passed in entry. Also expose it in internal.h as we'll start using it in proc_net.c soon. Signed-off-by: Christoph Hellwig <h...@lst.de> --- fs/proc/generic.c | 44 ++-- f

[PATCH 29/40] hostap: switch to proc_create_{seq,single}_data

2018-04-25 Thread Christoph Hellwig
And use proc private data directly instead of doing a detour through seq->private. Signed-off-by: Christoph Hellwig <h...@lst.de> --- .../net/wireless/intersil/hostap/hostap_ap.c | 70 ++--- .../net/wireless/intersil/hostap/hostap_hw.c | 17 +-- .../wireless/intersil/hostap/host

[PATCH 13/40] netfilter/x_tables: simplify ѕeq_file code

2018-04-25 Thread Christoph Hellwig
Just use the address family from the proc private data instead of copying it into per-file data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- net/netfilter/x_tables.c | 39 +++ 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/net/net

[PATCH 14/40] net: move seq_file_single_net to

2018-04-25 Thread Christoph Hellwig
This helper deals with single_{open,release}_net internals and thus belongs here. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/linux/seq_file_net.h | 13 + include/net/ip_vs.h | 12 2 files changed, 13 insertions(+), 12 deletions(-) diff

[PATCH 36/40] isdn: replace ->proc_fops with ->proc_show

2018-04-25 Thread Christoph Hellwig
And switch to proc_create_single_data. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/isdn/capi/kcapi.c | 3 ++- drivers/isdn/gigaset/capi.c| 16 +--- drivers/isdn/hardware/avm/avmcard.h| 4 ++-- drivers/isdn/hardware/avm/b1.c

  1   2   >