1
linux/fs/btrfs
Sage Weil 6bf13c0cc8 Btrfs: transaction ioctls
These ioctls let a user application hold a transaction open while it
performs a series of operations.  A final ioctl does a sync on the fs
(closing the current transaction).  This is the main requirement for
Ceph's OSD to be able to keep the data it's storing in a btrfs volume
consistent, and AFAICS it works just fine.  The application would do
something like

	fd = ::open("some/file", O_RDONLY);
	::ioctl(fd, BTRFS_IOC_TRANS_START);
	/* do a bunch of stuff */
	::ioctl(fd, BTRFS_IOC_TRANS_END);
or just
	::close(fd);

And to ensure it commits to disk,

	::ioctl(fd, BTRFS_IOC_SYNC);

When a transaction is held open, the trans_handle is attached to the
struct file (via private_data) so that it will get cleaned up if the
process dies unexpectedly.  A held transaction is also ended on fsync() to
avoid a deadlock.

A misbehaving application could also deliberately hold a transaction open,
effectively locking up the FS, so it may make sense to restrict something
like this to root or something.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25 11:04:03 -04:00
..
acl.c Btrfs: Include sched.h in the acl code for current (fixes compile on 2.6.23) 2008-09-25 11:03:59 -04:00
bit-radix.c Btrfs: trivial include fixups 2007-07-11 10:00:37 -04:00
bit-radix.h Btrfs: add GPLv2 2007-06-12 09:07:21 -04:00
btrfs_inode.h Btrfs: Throttle file_write when data=ordered is flushing the inode 2008-09-25 11:04:02 -04:00
compat.h Btrfs: Add workaround for AppArmor changing remove_suid() 2008-09-25 11:04:02 -04:00
COPYING Btrfs: add GPLv2 2007-06-12 09:07:21 -04:00
crc32c.h Btrfs: Endianess bug fix for v0.13 with kernels 2008-09-25 11:04:01 -04:00
ctree.c Btrfs: Allocator fix variety pack 2008-09-25 11:04:03 -04:00
ctree.h Btrfs: transaction ioctls 2008-09-25 11:04:03 -04:00
dir-item.c Btrfs: unaligned access fixes 2008-09-25 11:04:00 -04:00
disk-io.c Btrfs: bdi_init and bdi_destroy come with 2.6.23 2008-09-25 11:04:03 -04:00
disk-io.h Btrfs: Add mount -o degraded to allow mounts to continue with missing devices 2008-09-25 11:04:03 -04:00
extent_io.c Fix corners in writepage and btrfs_truncate_page 2008-09-25 11:04:03 -04:00
extent_io.h Btrfs: Handle write errors on raid1 and raid10 2008-09-25 11:04:03 -04:00
extent_map.c Btrfs: Split the extent_map code into two parts 2008-09-25 11:03:59 -04:00
extent_map.h Btrfs: Split the extent_map code into two parts 2008-09-25 11:03:59 -04:00
extent-tree.c Btrfs: Allocator fix variety pack 2008-09-25 11:04:03 -04:00
file-item.c Btrfs: Clone file data ioctl 2008-09-25 11:04:02 -04:00
file.c Btrfs: transaction ioctls 2008-09-25 11:04:03 -04:00
hash.c btrfs-progs: Stop stomping on 'name' input parameter 2008-09-25 11:04:01 -04:00
hash.h Btrfs: unaligned access fixes 2008-09-25 11:04:00 -04:00
inode-item.c Btrfs: Add back pointers from the inode to the directory that references it 2008-09-25 11:03:58 -04:00
inode-map.c Fix for btrfs_find_free_objectid 2008-09-25 11:03:59 -04:00
inode.c Btrfs: transaction ioctls 2008-09-25 11:04:03 -04:00
INSTALL Btrfs: Documentation update 2007-06-22 14:49:31 -04:00
ioctl.h Btrfs: transaction ioctls 2008-09-25 11:04:03 -04:00
Makefile Btrfs: Add support for multiple devices per filesystem 2008-09-25 11:04:00 -04:00
ordered-data.c btrfs delete ordered inode handling fix 2008-09-25 11:04:03 -04:00
ordered-data.h btrfs delete ordered inode handling fix 2008-09-25 11:04:03 -04:00
print-tree.c Btrfs: Pass down the expected generation number when reading tree blocks 2008-09-25 11:04:03 -04:00
print-tree.h Btrfs: Create extent_buffer interface for large blocksizes 2008-09-25 11:03:56 -04:00
root-tree.c Btrfs: Properly find the root for snapshotted blocks during chunk relocation 2008-09-25 11:04:02 -04:00
struct-funcs.c Btrfs: unaligned access fixes 2008-09-25 11:04:00 -04:00
super.c Btrfs: transaction ioctls 2008-09-25 11:04:03 -04:00
sysfs.c Btrfs: Disable sysfs files on older kernels 2008-09-25 11:04:00 -04:00
TODO Btrfs: add GPLv2 2007-06-12 09:07:21 -04:00
transaction.c Btrfs: Invalidate dcache entry after creating snapshot and 2008-09-25 11:04:03 -04:00
transaction.h Btrfs: Split the extent_map code into two parts 2008-09-25 11:03:59 -04:00
tree-defrag.c Btrfs: Allocator fix variety pack 2008-09-25 11:04:03 -04:00
volumes.c Btrfs: Allocator fix variety pack 2008-09-25 11:04:03 -04:00
volumes.h Fix btrfs_open_devices to deal with changes since the scan ioctls 2008-09-25 11:04:03 -04:00
xattr.c Btrfs: Dislable acl xattr handlers 2008-09-25 11:04:03 -04:00
xattr.h xattr support for btrfs 2008-09-25 11:03:57 -04:00