linux/fs
Alexey Dobriyan d5a572a4cb proc: calculate end pointer for /proc/*/* lookup at compile time
Compilers like to transform loops like

	for (i = 0; i < n; i++) {
		[use p[i]]
	}

into
	for (p = p0; p < end; p++) {
		...
	}

Do it by hand, so that it results in overall simpler loop
and smaller code.

Space savings:

	$ ./scripts/bloat-o-meter ../vmlinux-001 ../obj/vmlinux
	add/remove: 0/0 grow/shrink: 2/1 up/down: 4/-9 (-5)
	Function                                     old     new   delta
	proc_tid_base_lookup                          17      19      +2
	proc_tgid_base_lookup                         17      19      +2
	proc_pident_lookup                           179     170      -9

The same could be done to proc_pident_readdir(), but the code becomes
bigger for some reason.

[sfr@canb.auug.org.au: merge fix for proc_pident_lookup() API change]
  Link: http://lkml.kernel.org/r/20190131160135.4a8ae70b@canb.auug.org.au
Link: http://lkml.kernel.org/r/20190114200422.GB9680@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: James Morris <jmorris@namei.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Casey Schaufler <casey@schaufler-ca.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-03-12 10:04:01 -07:00
..
9p mm: refactor readahead defines in mm.h 2019-03-12 10:04:01 -07:00
adfs
affs
afs mm: refactor readahead defines in mm.h 2019-03-12 10:04:01 -07:00
autofs autofs: clear O_NONBLOCK on the pipe 2019-03-07 18:32:01 -08:00
befs
bfs
btrfs mm: refactor readahead defines in mm.h 2019-03-12 10:04:01 -07:00
cachefiles
ceph ceph: avoid repeatedly adding inode to mdsc->snap_flush_list 2019-02-18 18:08:29 +01:00
cifs fs: cifs: Kconfig: pedantic formatting 2019-03-06 21:55:12 -06:00
coda
configfs
cramfs
crypto fscrypt updates for v5.1 2019-03-09 10:54:24 -08:00
debugfs Merge 5.0-rc6 into driver-core-next 2019-02-11 09:09:02 +01:00
devpts
dlm socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes 2019-02-03 11:17:31 -08:00
ecryptfs crypto: clarify name of WEAK_KEY request flag 2019-01-25 18:41:52 +08:00
efivarfs
efs
exportfs
ext2 \n 2019-03-07 09:01:33 -08:00
ext4 fscrypt updates for v5.1 2019-03-09 10:54:24 -08:00
f2fs fscrypt updates for v5.1 2019-03-09 10:54:24 -08:00
fat fat: enable .splice_write to support splice on O_DIRECT file 2019-03-07 18:32:01 -08:00
freevxfs
fscache
fuse mm: refactor readahead defines in mm.h 2019-03-12 10:04:01 -07:00
gfs2 We've only got three patches ready for this merge window: 2019-03-09 11:52:11 -08:00
hfs
hfsplus
hostfs
hpfs
hugetlbfs mm/memfd: add an F_SEAL_FUTURE_WRITE seal to memfd 2019-03-05 21:07:19 -08:00
isofs
jbd2
jffs2
jfs
kernfs Driver core patches for 5.1-rc1 2019-03-06 14:52:48 -08:00
lockd
minix
nfs Merge branch 'fixes-v5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2019-02-20 09:09:33 -08:00
nfs_common
nfsd Revert "nfsd4: return default lease period" 2019-02-14 12:33:19 -05:00
nilfs2
nls
notify fanotify: Make waits for fanotify events only killable 2019-02-21 11:47:23 +01:00
ntfs
ocfs2 ocfs2: Use zero-sized array and struct_size() in kzalloc() 2019-03-05 21:07:13 -08:00
omfs
openpromfs
orangefs orangefs: remove two un-needed BUG_ONs... 2019-02-20 15:12:52 -05:00
overlayfs
proc proc: calculate end pointer for /proc/*/* lookup at compile time 2019-03-12 10:04:01 -07:00
pstore pstore/ram: Avoid needless alloc during header write 2019-02-12 13:45:53 -08:00
qnx4
qnx6
quota
ramfs
reiserfs
romfs
squashfs
sysfs sysfs: remove unused include of kernfs-internal.h 2019-02-08 12:57:31 +01:00
sysv
tracefs
ubifs fscrypt: remove filesystem specific build config option 2019-01-23 23:56:43 -05:00
udf udf: Drop pointless check from udf_sync_fs() 2019-02-21 19:25:36 +01:00
ufs
xfs for-5.1/block-20190302 2019-03-08 14:12:17 -08:00
aio.c Merge branch 'timers-2038-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-03-05 14:08:26 -08:00
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c a.out: remove core dumping support 2019-03-05 10:00:35 -08:00
binfmt_elf_fdpic.c
binfmt_elf.c fs/binfmt_elf.c: spread const a little 2019-03-07 18:32:01 -08:00
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c exec: load_script: Do not exec truncated interpreter path 2019-02-18 16:49:36 -08:00
block_dev.c block: add bio_set_polled() helper 2019-02-24 08:20:17 -07:00
buffer.c fs: fix guard_bio_eod to check for real EOD errors 2019-02-28 13:59:41 -07:00
char_dev.c
compat_binfmt_elf.c
compat_ioctl.c
compat.c
coredump.c
d_path.c
dax.c
dcache.c fs/dcache: Track & report number of negative dentries 2019-01-30 11:02:11 -08:00
dcookies.c
direct-io.c block: allow bio_for_each_segment_all() to iterate over multi-page bvec 2019-02-15 08:40:11 -07:00
drop_caches.c fs/drop_caches.c: avoid softlockups in drop_pagecache_sb() 2019-02-01 15:46:24 -08:00
eventfd.c
eventpoll.c epoll: use rwlock in order to reduce ep_poll_callback() contention 2019-03-07 18:32:01 -08:00
exec.c exec: increase BINPRM_BUF_SIZE to 256 2019-03-07 18:32:01 -08:00
fcntl.c
fhandle.c
file_table.c fs: add fget_many() and fput_many() 2019-02-28 08:24:23 -07:00
file.c io_uring-2019-03-06 2019-03-08 14:48:40 -08:00
filesystems.c
fs_pin.c
fs_struct.c
fs_types.c fs: common implementation of file type 2019-01-21 17:48:13 +01:00
fs-writeback.c writeback: synchronize sync(2) against cgroup writeback membership switches 2019-01-22 14:39:38 -07:00
inode.c fs/inode.c: inode_set_flags(): replace opencoded set_mask_bits() 2019-03-05 21:07:13 -08:00
internal.h
io_uring.c mm: refactor readahead defines in mm.h 2019-03-12 10:04:01 -07:00
ioctl.c
iomap.c iomap: wire up the iopoll method 2019-02-24 08:20:17 -07:00
Kconfig scsi: fs: remove exofs 2019-02-05 21:28:13 -05:00
Kconfig.binfmt
libfs.c
locks.c locking/percpu-rwsem: Remove preempt_disable variants 2019-02-28 07:55:37 +01:00
Makefile SCSI misc on 20190306 2019-03-09 16:53:47 -08:00
mbcache.c
mount.h
mpage.c block: allow bio_for_each_segment_all() to iterate over multi-page bvec 2019-02-15 08:40:11 -07:00
namei.c Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2019-03-10 17:32:04 -07:00
namespace.c audit/stable-5.1 PR 20190305 2019-03-07 12:20:11 -08:00
no-block.c
nsfs.c
open.c
pipe.c memcg: localize memcg_kmem_enabled() check 2019-03-05 21:07:15 -08:00
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c get rid of legacy 'get_ds()' function 2019-03-04 10:50:14 -08:00
readdir.c
select.c y2038: syscalls: rename y2038 compat syscalls 2019-02-07 00:13:27 +01:00
seq_file.c
signalfd.c
splice.c fs: Make splice() and tee() take into account O_NONBLOCK flag on pipes 2019-03-04 16:10:17 -08:00
stack.c
stat.c
statfs.c vfs: add vfs_get_fsid() helper 2019-02-07 16:38:35 +01:00
super.c
sync.c
timerfd.c y2038: syscalls: rename y2038 compat syscalls 2019-02-07 00:13:27 +01:00
userfaultfd.c
utimes.c y2038: syscalls: rename y2038 compat syscalls 2019-02-07 00:13:27 +01:00
xattr.c