]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
client: Respect O_SYNC, O_DSYNC, and O_RSYNC
authorSam Lang <sam.lang@inktank.com>
Thu, 17 Jan 2013 20:03:51 +0000 (14:03 -0600)
committerSam Lang <sam.lang@inktank.com>
Fri, 18 Jan 2013 21:43:33 +0000 (15:43 -0600)
commit4bdcfbffa0b4f134d447cfc8fa83c19e4133390c
treed4f0a908fb5d55ec552919b504f85d2714f4416a
parent76e715ba8f35315952208b5bcf447dc708db1505
client: Respect O_SYNC, O_DSYNC, and O_RSYNC

If the file is opened with O_SYNC, O_DSYNC, or O_RSYNC, we need to
flush cached data (and metadata for O_SYNC) on a write.
For O_RSYNC, we need to flush dirty data on a read.
This patch adds a file_flush() call to the objectCacher
to allow a specific range to be flushed from the cache, and
in the O_SYNC,O_DSYNC case for write and O_RSYNC case for read,
calls that function waiting for the flush to complete.  The patch
also adds a flags field directly to the file handle struct, and
replaces the append boolean with the use of the flags field directly.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
src/client/Client.cc
src/client/Client.h
src/client/Fh.h
src/osdc/ObjectCacher.h