linux-sg2042/arch/alpha/include/asm
Christoph Hellwig 6b2f3d1f76 vfs: Implement proper O_SYNC semantics
While Linux provided an O_SYNC flag basically since day 1, it took until
Linux 2.4.0-test12pre2 to actually get it implemented for filesystems,
since that day we had generic_osync_around with only minor changes and the
great "For now, when the user asks for O_SYNC, we'll actually give
O_DSYNC" comment.  This patch intends to actually give us real O_SYNC
semantics in addition to the O_DSYNC semantics.  After Jan's O_SYNC
patches which are required before this patch it's actually surprisingly
simple, we just need to figure out when to set the datasync flag to
vfs_fsync_range and when not.

This patch renames the existing O_SYNC flag to O_DSYNC while keeping it's
numerical value to keep binary compatibility, and adds a new real O_SYNC
flag.  To guarantee backwards compatiblity it is defined as expanding to
both the O_DSYNC and the new additional binary flag (__O_SYNC) to make
sure we are backwards-compatible when compiled against the new headers.

This also means that all places that don't care about the differences can
just check O_DSYNC and get the right behaviour for O_SYNC, too - only
places that actuall care need to check __O_SYNC in addition.  Drivers and
network filesystems have been updated in a fail safe way to always do the
full sync magic if O_DSYNC is set.  The few places setting O_SYNC for
lower layers are kept that way for now to stay failsafe.

We enforce that O_DSYNC is set when __O_SYNC is set early in the open path
to make sure we always get these sane options.

Note that parisc really screwed up their headers as they already define a
O_DSYNC that has always been a no-op.  We try to repair it by using it for
the new O_DSYNC and redefinining O_SYNC to send both the traditional
O_SYNC numerical value _and_ the O_DSYNC one.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Dilger <adilger@sun.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Acked-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jan Kara <jack@suse.cz>
2009-12-10 15:02:50 +01:00
..
8253pit.h time: move PIT_TICK_RATE to linux/timex.h 2009-06-16 19:47:27 -07:00
Kbuild byteorder: make swab.h include asm/swab.h like a regular header 2009-01-14 19:56:50 -08:00
a.out-core.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
a.out.h alpha: introduce field 'taso' into struct linux_binprm 2008-10-16 11:21:38 -07:00
agp.h agp: kill phys_to_gart() and gart_to_phys() 2009-08-03 09:05:00 +01:00
agp_backend.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
atomic.h asm-generic: rename atomic.h to atomic-long.h 2009-06-11 21:02:17 +02:00
auxvec.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
barrier.h alpha: futex implementation 2009-05-02 15:36:10 -07:00
bitops.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
bitsperlong.h asm-generic: introduce asm/bitsperlong.h 2009-06-11 21:02:14 +02:00
bug.h alpha: fixup BUG macro 2009-02-05 12:56:49 -08:00
bugs.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
byteorder.h byteorder: make swab.h include asm/swab.h like a regular header 2009-01-14 19:56:50 -08:00
cache.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
cacheflush.h block: add helpers to run flush_dcache_page() against a bio and a request's pages 2009-11-26 09:16:19 +01:00
checksum.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
compiler.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
console.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_apecs.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_cia.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_irongate.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_lca.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_marvel.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_mcpcia.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_polaris.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_t2.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_titan.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_tsunami.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
core_wildfire.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
cputime.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
current.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
delay.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
device.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
div64.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
dma-mapping.h alpha: compile fixes 2009-01-29 18:04:44 -08:00
dma.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
elf.h [PATCH] remove unused ibcs2/PER_SVR4 in SET_PERSONALITY 2008-10-16 15:40:05 +02:00
emergency-restart.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
err_common.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
err_ev6.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
err_ev7.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
errno.h cfg80211: errno.h: define ERFKILL 2009-06-07 05:01:00 -07:00
fb.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
fcntl.h vfs: Implement proper O_SYNC semantics 2009-12-10 15:02:50 +01:00
floppy.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
fpu.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
ftrace.h tracing: make CALLER_ADDRx overwriteable 2009-03-02 16:49:37 -05:00
futex.h alpha: futex implementation 2009-05-02 15:36:10 -07:00
gct.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
gentrap.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
hardirq.h alpha: convert to asm-generic/hardirq.h 2009-09-22 07:17:43 -07:00
hw_irq.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
hwrpb.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
io.h alpha: remove dead BIO_VMERGE_BOUNDARY 2008-12-29 08:29:51 +01:00
io_trivial.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
ioctl.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
ioctls.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
ipcbuf.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
irq.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
irq_regs.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
jensen.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
kdebug.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
kmap_types.h kmap_types: make most arches use generic header file 2009-06-16 19:47:51 -07:00
linkage.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
local.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
machvec.h alpha: convert u64 to unsigned long long 2009-04-01 08:59:16 -07:00
mc146818rtc.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
md.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
mman.h mm: add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions 2009-09-22 07:17:41 -07:00
mmu.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
mmu_context.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
mmzone.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
module.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
msgbuf.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
mutex.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
page.h asm-generic: rename page.h and uaccess.h 2009-06-11 21:02:17 +02:00
pal.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
param.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
parport.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
pci.h PCI: remove pcibios_scan_all_fns() 2009-09-09 13:29:18 -07:00
percpu.h alpha: fix percpu build breakage 2009-06-30 18:55:59 -07:00
pgalloc.h alpha: make pte_alloc_one_kernel() inline 2009-01-15 16:39:40 -08:00
pgtable.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
poll.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
posix_types.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
processor.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
ptrace.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
reg.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
regdef.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
resource.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
rtc.h alpha: fix RTC on marvel 2009-01-15 16:39:40 -08:00
rwsem.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
scatterlist.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
sections.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
segment.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
sembuf.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
serial.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
setup.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
sfp-machine.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
shmbuf.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
shmparam.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
sigcontext.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
siginfo.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
signal.h asm-generic: rename termios.h, signal.h and mman.h 2009-06-11 21:01:52 +02:00
smp.h cpumask: remove arch_send_call_function_ipi 2009-09-24 09:34:47 +09:30
socket.h net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
sockios.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
spinlock.h Allow rwlocks to re-enable interrupts 2009-04-02 19:05:11 -07:00
spinlock_types.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
stat.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
statfs.h headers_check fix: alpha, statfs.h 2009-02-01 11:01:22 +05:30
string.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
swab.h headers_check fix: alpha, swab.h 2009-02-01 11:01:22 +05:30
sysinfo.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
system.h alpha: xchg/cmpxchg cleanup and fixes 2009-04-01 08:59:16 -07:00
termbits.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
termios.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
thread_info.h Alpha: Rearrange thread info flags fixing two regressions 2009-11-30 22:44:40 -05:00
timex.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
tlb.h mm: Pass virtual address to [__]p{te,ud,md}_free_tlb() 2009-07-27 12:10:38 -07:00
tlbflush.h alpha: switch to dynamic percpu allocator 2009-06-24 15:13:52 +09:00
topology.h cpumask: remove obsolete node_to_cpumask now everyone uses cpumask_of_node 2009-09-24 09:34:34 +09:30
types.h asm-generic: introduce asm/bitsperlong.h 2009-06-11 21:02:14 +02:00
uaccess.h alpha: exception table sorting 2009-05-02 15:36:10 -07:00
ucontext.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
unaligned.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
unistd.h alpha: Fixup recvmmsg syscall glue 2009-11-14 09:02:48 -08:00
user.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
vga.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00
xchg.h alpha: xchg/cmpxchg cleanup and fixes 2009-04-01 08:59:16 -07:00
xor.h alpha: move include/asm-alpha to arch/alpha/include/asm 2008-08-15 09:19:40 -07:00