mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Introduce zfs rewrite subcommand (#17246)
This allows to rewrite content of specified file(s) as-is without modifications, but at a different location, compression, checksum, dedup, copies and other parameter values. It is faster than read plus write, since it does not require data copying to user-space. It is also faster for sync=always datasets, since without data modification it does not require ZIL writing. Also since it is protected by normal range range locks, it can be done under any other load. Also it does not affect file's modification time or other properties. Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Rob Norris <robn@despairlabs.com>
This commit is contained in:
@@ -1620,6 +1620,15 @@ typedef enum zfs_ioc {
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct zfs_rewrite_args {
|
||||
uint64_t off;
|
||||
uint64_t len;
|
||||
uint64_t flags;
|
||||
uint64_t arg;
|
||||
} zfs_rewrite_args_t;
|
||||
|
||||
#define ZFS_IOC_REWRITE _IOW(0x83, 3, zfs_rewrite_args_t)
|
||||
|
||||
/*
|
||||
* ZFS-specific error codes used for returning descriptive errors
|
||||
* to the userland through zfs ioctls.
|
||||
|
||||
Reference in New Issue
Block a user