linux/arch/powerpc
David Howells 1dce27c5aa Wrap accesses to the fd_sets in struct fdtable
Wrap accesses to the fd_sets in struct fdtable (for recording open files and
close-on-exec flags) so that we can move away from using fd_sets since we
abuse the fd_set structs by not allocating the full-sized structure under
normal circumstances and by non-core code looking at the internals of the
fd_sets.

The first abuse means that use of FD_ZERO() on these fd_sets is not permitted,
since that cannot be told about their abnormal lengths.

This introduces six wrapper functions for setting, clearing and testing
close-on-exec flags and fd-is-open flags:

	void __set_close_on_exec(int fd, struct fdtable *fdt);
	void __clear_close_on_exec(int fd, struct fdtable *fdt);
	bool close_on_exec(int fd, const struct fdtable *fdt);
	void __set_open_fd(int fd, struct fdtable *fdt);
	void __clear_open_fd(int fd, struct fdtable *fdt);
	bool fd_is_open(int fd, const struct fdtable *fdt);

Note that I've prepended '__' to the names of the set/clear functions because
they require the caller to hold a lock to use them.

Note also that I haven't added wrappers for looking behind the scenes at the
the array.  Possibly that should exist too.

Signed-off-by: David Howells <dhowells@redhat.com>
Link: http://lkml.kernel.org/r/20120216174942.23314.1364.stgit@warthog.procyon.org.uk
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
2012-02-19 10:30:52 -08:00
..
boot powerpc/85xx: Add dr_mode property in USB nodes 2012-01-18 08:05:42 -06:00
configs Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2012-01-06 17:58:22 -08:00
include/asm powerpc: Use generic posix_types.h 2012-02-14 12:01:29 -08:00
kernel powerpc: Fix build on some non-freescale platforms 2012-01-25 13:33:22 +11:00
kvm Merge branch 'kvm-updates/3.3' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2012-01-10 09:57:11 -08:00
lib powerpc: POWER7 optimised copy_to_user/copy_from_user using VMX 2011-12-19 14:40:40 +11:00
math-emu powerpc/math_emu/efp: Look for errata handler when type mismatches 2011-10-06 23:36:47 -05:00
mm cpumask: update setup_node_to_cpumask_map() comments 2012-01-12 20:13:11 -08:00
net net: filter: BPF 'JIT' compiler for PPC64 2011-07-21 12:38:32 -07:00
oprofile powerpc/oprofile: Handle events that raise an exception without overflowing 2011-05-26 13:38:57 +10:00
platforms Wrap accesses to the fd_sets in struct fdtable 2012-02-19 10:30:52 -08:00
sysdev arch/powerpc/sysdev/fsl_pci.c: add missing iounmap 2012-01-17 13:08:35 -06:00
xmon powerpc/xmon: Fix #if typo for systems without MSR[RI] 2011-11-25 14:11:28 +11:00
Kconfig lib: use generic pci_iomap on all architectures 2012-01-10 18:04:27 -08:00
Kconfig.debug powerpc: Implement CONFIG_STRICT_DEVMEM 2011-11-28 11:42:08 +11:00
Makefile powerpc: Process dynamic relocations for kernel 2011-12-20 10:21:08 -05:00
relocs_check.pl powerpc: Process dynamic relocations for kernel 2011-12-20 10:21:08 -05:00