summaryrefslogtreecommitdiff
path: root/ioctl.h
Commit message (Collapse)AuthorAge
* btrfs-progs: device delete to get errors from the kernelAnand Jain2013-08-09
| | | | | | | | | | | | | | | | | | when user runs command btrfs dev del the raid requisite error if any goes to the /var/log/messages, its not good idea to clutter messages with these user (knowledge) errors, further user don't have to review the system messages to know problem with the cli it should be dropped to the user as part of the cli return. to bring this feature created a set of the ERROR defined BTRFS_ERROR_DEV* error codes and created their error string. I expect this enum to be added with other error which we might want to communicate to the user land Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: add send option for using new end-cmd semanticStefan Behrens2013-08-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a command line option to enable sending streams which make use of the new end-cmd semantic if multiple snapshots are sent back-to-back. The goal is to use the <end cmd> as an indication to stop reading the input stream. So far, the receiver could only use EOF to recognize the end. If the new command line option '-e' is set, this commit requires a kernel which is able to support the new flags in the send ioctl. New bits in the flags of the send ioctl will be set which cause EINVAL on old kernels. However, if the option '-e' is not set, it works with old and new kernels without any errors or any changed behavior. This used to be the encoding (with 2 snapshots in this example): <stream header> + <sequence of commands> + <end cmd> + <stream header> + <sequence of commands> + <end cmd> + EOF The new format (if the two new flags are used) is this one: <stream header> + <sequence of commands> + <sequence of commands> + <end cmd> Note that the currently existing receivers treat <end cmd> only as an indication that a new <stream header> is following. This means, you can just skip the sequence <end cmd> <stream header> without loosing compatibility. As long as an EOF is following, the currently existing receivers handle the new format (if the two new flags are used) exactly as the old one. Also note that the kernel interface was changed in a way that is backward compatible to old btrfs-progs tools. You set one or two bits in the flags field of the ioctl to enable the new behavior. Old tools set these flags to zero, thus getting exactly the same as they got with older kernels. And this is exactly what happens if the new '-e' option is not set, the new bits in the flags are not set and thus old kernels and new kernels are both supported. So what is the benefit of this change? The goal is to be able to use a single stream (one TCP connection) to multiplex a request/response handshake plus Btrfs send streams, all in the same stream. In this case you cannot evaluate an EOF condition as an end of the Btrfs send stream. You need something else, and the <end cmd> is just perfect for this purpose. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: fixup: add flags to struct btrfs_ioctl_quota_rescan_argsJan Schmidt2013-05-10
| | | | | | | | | The patch set previously sent was sent together with the kernel part, but was not updated as I added some reserved bytes to the ioctl struct for future compatibility. This fixes struct btrfs_ioctl_quota_rescan_args. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: quota rescanJan Schmidt2013-04-23
| | | | | | | | This adds the quota rescan command to be used if qgroup tracking should get out of sync. Can also be used to query the status of a running rescan operation. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
* Btrfs-progs: Change the label of a mounted file systemJeff Liu2013-02-26
| | | | | | | | With this new ioctl(2), we can set/change the label for a mounted file system. It still does normal process for an umounted file system. Signed-off-by: Jie Liu <jeff.liu@oracle.com> Signed-off-by: Anand Jain <anand.jain@oracle.com>
* btrfs-progs: make libbtrfs usable from C++Arvin Schnell2013-02-19
| | | | | | | | Please find attached a patch to make the new libbtrfs usable from C++ (at least for the parts snapper will likely need). Signed-off-by: Arvin Schnell <aschnell@suse.de> Signed-off-by: Mark Fasheh <mfasheh@suse.de>
* btrfs-progs: Add support for BTRFS_SEND_FLAG_NO_FILE_DATAMark Fasheh2013-02-12
| | | | | | | | | | | The flag and command are synced from kernel to user. Also, this patch adds a callback for the BTRFS_SEND_C_UPDATE_EXTENT in struct btrfs_send_ops. read_and_process_cmd() is updated to decode BTRFS_SEND_C_UPDATE_EXTENT and send the values through the right callback. I did not add a callback definition to cmds-receive.c as that code never uses BTRFS_SEND_FLAG_NO_FILE_DATA. Signed-off-by: Mark Fasheh <mfasheh@suse.de>
* Btrfs-progs: add support for device replace procedureStefan Behrens2013-01-31
| | | | | | | | | | | This is the user mode part of the device replace patch series. The command group "btrfs replace" is added with three commands: - btrfs replace start srcdev|srcdevid targetdev [-Bfr] mount_point - btrfs replace status mount_point [-1] - btrfs replace cancel mount_point Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
* Btrfs-progs: add command to get/reset device stats via ioctlStefan Behrens2013-01-31
| | | | | | | | "btrfs device stats" is used to retrieve and print the device stats. "btrfs device stats -z" is used to atomically retrieve, reset and print the stats. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
* Btrfs-progs: add btrfs device ready commandJosef Bacik2013-01-23
| | | | | | | | | | | This command will be used by things like dracut that wish to know very simply if all of the devices have been added to the kernel cache yet for the device to be fully mounted. This keeps initrd's from constantly having to try to mount the file system until it succeeds every time a device is added to the system. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Gene Czarcinski <gene@czarc.net>
* Btrfs progs: quota groups supportArne Jansen2012-09-04
| | | | | Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Arne Jansen <sensille@gmx.net>
* Btrfs-progs: update ioctl.h to support btrfs send ioctlAlexander Block2012-07-26
| | | | | | Add btrfs_ioctl_send_args and BTRFS_IOC_SEND to ioctl.h Signed-off-by: Alexander Block <ablock84@googlemail.com>
* Btrfs-progs: update btrfs-progs for subvol uuid+times supportAlexander Block2012-07-26
| | | | | | Update ctree.h and ioctl.h for the new uuid+times for subvolumes. Signed-off-by: Alexander Block <ablock84@googlemail.com>
* Btrfs-progs: update ioctl.h to support clone range ioctlAlexander Block2012-07-26
| | | | | | | Added missing btrfs_ioctl_clone_range_args and BTRFS_IOC_CLONE_RANGE to ioctl.h Signed-off-by: Alexander Block <ablock84@googlemail.com>
* Btrfs-progs: add BTRFS_IOC_SUBVOL_GET/SETFLAGS to ioctl.hAlexander Block2012-07-26
| | | | | | | | Btrfs send/receive and btrfs props needs this ioctl. This patch requires a recent kernel with the "Btrfs: use _IOR for BTRFS_IOC_SUBVOL_GETFLAGS" patch applied. Signed-off-by: Alexander Block <ablock84@googlemail.com>
* Btrfs-progs: add restriper headersIlya Dryomov2012-02-03
| | | | | | Add restriper headers and update print-tree.c Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* Btrfs-progs: added ioctls and commands to resolve inodes and logical addrsJan Schmidt2011-11-02
| | | | | | | | | two new commands that make use of the new path resolving functions implemented for scrub, doing the resolving in-kernel. the result for both commands is a list of files belonging to that inode / logical address. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs: scrub ioctlsJan Schmidt2011-10-25
| | | | | | | | | - scrub structs added - ioctls for scrub - BTRFS_FSID_SIZE moved Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Added support for an additional ioctl.Andreas Philipp2011-10-25
| | | | | | | | Added BTRFS_IOC_SNAP_CREATE_V2 and struct btrfs_ioctl_vol_args_v2 as defined in fs/btrfs/ioctl.h in the kernel sources. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Update for lzo supportLi Zefan2011-10-25
| | | | | | | | | | | | | | | | | | | [Btrfs-Progs][V2] Update for lzo support - Add incompat flag, otherwise btrfs-progs will report error when operating on btrfs filesystems mounted with lzo option. - Update man page. - Allow to turn on lzo compression for defrag operation: # btrfs filesystem defragment -c[zlib, lzo] <file> Note: "-c zlib" will fail, because that's how getopt() works for optional arguments. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add btrfs subvol find-new commandChris Mason2010-03-18
| | | | | | | | btrfs-subvol find-new <subvol> <id> will search through a given subvol and print out all the files with extents newer than a given id. Care must be taken to make sure any pending delalloc is on disk before running this because that won't show up in the output.
* Btrfs-progs: add btrfs filesystem df to print space infoJosef Bacik2010-03-14
| | | | | | | | | This goes along with the new space info ioctl. This will spit out the space info all nice and pretty with the type, it's flags (DUP, RAID) and how much space is in that group and how much is in use. Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add new defrag range ioctl that can also compress files on demand.Chris Mason2010-03-11
|
* Btrfs-progs: add command to set default subvolJosef Bacik2010-02-28
| | | | | | | | | | | | | | | | | | This introduces a new btrfsctl option, -m, to allow you to set the default'ly mounted subvolume. You can do btrfsctl -m /your/subvolume and that will make that subvolume the subvolume that is mounted by default, or you can do btrfsctl -m <treeid> /any/subvolume and this will make the subvolume with tree id <treeid> the default'ly mounted subvolume. You can get the treeid by using the listing option. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add btrfs-list for listing subvolumesChris Mason2010-02-28
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfsctl: add snapshot/subvolume destroy ioctlYan, Zheng2009-09-21
| | | | | | | resend Aaron Straus's patch Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix ioctl arg size (userland incompatible change!)Chris Mason2009-01-16
| | | | | | | | | | | | | | | The structure used to send device in btrfs ioctl calls was not properly aligned, and so 32 bit ioctls would not work properly on 64 bit kernels. We could fix this with compat ioctls, but we're just one byte away and it doesn't make sense at this stage to carry about the compat ioctls forever at this stage in the project. This patch brings the ioctl arg up to an evenly aligned 4k. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Modify the subvol and snapshot creation ioctls to work anywhere in the treeChris Mason2008-11-18
| | | | | | | | | | | | | | | | | | | | | | | | This changes the snapshot and subvol ioctl API and command lines so that new snapshots and subvols can be created anywhere. Subvolume creation hasn't changed much: btrfsctl -S subvol_name directory This creates a new subvolume under 'directory' Snapshot creation looks the same, but is actually different: btrfsctl -s full_path_to_new_snapshot file_or_dir For example: btrfsctl -s /mnt/new_snap /mnt/subvol Will create a new snapshot named new_snap under /mnt of the root found in /mnt/subvol. It always snapshots the entire root regardless of which file or directory inside the root you give it. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add sync and transaction ioctl defsChris Mason2008-06-10
| | | | | | | | | btrfsctl -c forces a single FS sync The transaction ioctls are unsafe for general use because they can lead to deadlocks if the application is not very careful. But, ceph is experimenting with btrfs as a backing store, and these ioctls are required for testing.
* Add the clone ioctl numberChris Mason2008-05-02
|
* Add btrfs-vol command to balance, add and (eventually) remove devicesChris Mason2008-04-28
|
* ioctls to scan for btrfs filesystemsChris Mason2008-03-24
|
* Add online resizing ioctlsChris Mason2007-12-21
| | | | btrfsctl -r size mount_point
* add defrag ioctlChris Mason2007-08-07
|
* add GPLv2Chris Mason2007-06-12
|
* add disk ioctlChris Mason2007-04-12
|
* btrfsctlChris Mason2007-04-10