summaryrefslogtreecommitdiff
path: root/ioctl.h
Commit message (Collapse)AuthorAge
* btrfs-progs: extend balance args to take min/max usage filterDavid Sterba2016-01-12
| | | | | | | | | | | Add the overlapping usage and [usage_min, usage_max] members to the balance args. The min/max values are interpreted iff the corresponding flag BTRFS_BALANCE_ARGS_USAGE_RANGE is set. The minimum boundary is inclusive, maximum is exclusive: * usage_min <= chunk_usage < usage_max Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: balance: add stripes filterGabríel Arthúr Pétursson2016-01-12
| | | | | | | | | | | | Add new balance filter 'stripes=<range>' to process only chunks that are spread accross given number of chunks. The range minimum and maximum are inclusive. Signed-off-by: Gabríel Arthúr Pétursson <gabriel@system.is> [ reworked a bit to use the range helpers, dropped the single value for stripes ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: extend balance args to take min/max limit filterDavid Sterba2016-01-12
| | | | | | | | | | | | | Add the overlapping limit and [limit_min, limit_max] members to the balance args. The min/max values are interpreted iff the corresponding flag BTRFS_BALANCE_ARGS_LIMIT_RANGE is set. The minimum and maximum are inclusive. Note that the values are only 32bit, but this should be enough for the foreseeable future. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add missing includes to header filesDavid Sterba2015-06-10
| | | | | | | Add includes that let the header files compile or add explicit include of kerncompat if the uXX types are used. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: ioctl.h: add btrfs_ioctl_feature_flags structDavid Sterba2015-06-03
| | | | | | Copied from uapi/linux/btrfs.h. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: ioctl.h: update btrfs_ioctl_fs_info_argsDavid Sterba2015-06-03
| | | | | | Copied from uapi/linux/btrfs.h. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: ioctl.h: update type annotationsDavid Sterba2015-06-03
| | | | | | Add the __user annotations to pointers in structures. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: ioctl.h: add send flag maskDavid Sterba2015-06-03
| | | | | | Copied from uapi/linux/btrfs.h. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: ioctl.h: add EXTENT_SAME ioctl and structuresDavid Sterba2015-06-03
| | | | | | Copied from uapi/linux/btrfs.h. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: ioctl.h: copy commented version of balance structuresDavid Sterba2015-06-03
| | | | | | Copied from uapi/linux/btrfs.h, no-op change. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: ioctl.h: copy commented version of scrub_progress structureDavid Sterba2015-06-03
| | | | | | Copied from uapi/linux/btrfs.h, no-op change. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: ioctl.h: reorder to match kernel uapi headerDavid Sterba2015-06-03
| | | | | | | This is a no-op change, move the code that also exists in the uapi/linux/btrfs.h header. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: unify header file inclusion protectionsDavid Sterba2015-01-21
| | | | | | There are missing ifdefs or defines with very generic names. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: basic support for TREE_SEARCH_V2 ioctlDavid Sterba2014-12-10
| | | | | | Add the interface and helper that checks if the v2 ioctl is supported. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: add new dev replace resultEryu Guan2014-11-25
| | | | | | | | | | | A new dev replace result was introduced by kernel commit Btrfs: return failure if btrfs_dev_replace_finishing() failed Make the userspace know about the new result too. Signed-off-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: only report internal dev replace result if there's a resultEryu Guan2014-11-03
| | | | | | | | | | | | | | | | | | If BTRFS_IOC_DEV_REPLACE ioctl failed, args.result usually won't be updated by the ioctl. And the arg has been initialized with 0, the result is always 0, which is BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR, and the resulting error message looks confusing: ERROR: ioctl(DEV_REPLACE_START) failed on "/mnt/btrfs": No such file or directory, no error But in case there's an internal result returned in future, don't drop the result completely, instead print dev replace result message only if the result is updated by a failed ioctl call. Signed-off-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: balance filter: add limit of processed chunksDavid Sterba2014-08-22
| | | | | | | | | | | | | | | Add more control to the balance behaviour. Usage filter may not be finegrained enough and can lead to moving too many chunks at once. Another example use is in connection with drange+devid or vrange filters that allow to work with a specific chunk or even with a chunk on a given device. The limit filter applies last, the value of 0 means no limiting. CC: Ilya Dryomov <idryomov@gmail.com> CC: Hugo Mills <hugo@carfax.org.uk> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: correct prompt of minimal num of devs for raid56Gui Hecheng2014-04-11
| | | | | | | | | For btrfs, Raid5 can't go below 2 devs, not 3; Raid6 can't go below 3 devs, not 4. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: use the correct integer type for ioctlArvin Schnell2014-03-21
| | | | | | Signed-off-by: Arvin Schnell <aschnell@suse.de> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
* ioctl: add note regarding CLONE_RANGE(len=0) behaviourDavid Disseldorp2014-03-21
| | | | | | | | | | | | A BTRFS_IOC_CLONE_RANGE request with a src_length value of zero has the effect of cloning all data from src_offset through to end-of-file. Document this behaviour in the header file for those who (like me) incorrectly assume that no data is cloned in such a case. Signed-off-by: David Disseldorp <ddiss@suse.de> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
* btrfs-progs: sync-up with newly introduced ioctl numberAnand Jain2014-01-31
| | | | | | | | | | for now the manual sync up of new ioctls introduced in the btrfs kernel. For which there wasn't any btrfs-progs patch. however we might have better idea for the long run. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
* btrfs-progs: add options to set commit mode after subvol deleteDavid Sterba2014-01-31
| | | | | | | | | | | | | | | | | | Subvolume deletion does not do a full transaction commit. This can lead to an unexpected result when the system crashes between deletion and commit, the subvolume directory will appear again. Add options to request filesystem sync after each deleted subvolume or after the last one. If the command with --commit option finishes succesfully, the subvolume(s) deletion status is safely stored on the media. Userspace approach is more flexible than in-kernel. Related discussions: http://www.spinics.net/lists/linux-btrfs/msg22088.html http://www.spinics.net/lists/linux-btrfs/msg27240.html CC: Alex Lyakas <alex.btrfs@zadarastorage.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
* Btrfs-progs: fix typo in btrfs_err_str()Wang Shilong2013-10-16
| | | | | | | | | Raid5 and raid6 at least need three and foure devices respectively, fix it. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: added "btrfs quota rescan" -w switch (wait)Jan Schmidt2013-09-03
| | | | | | | | | | With -w one can wait for a rescan operation to finish. It can be used when starting a rescan operation or later to wait for the currently running rescan operation to finish. Waiting is interruptible. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* 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>