2008-11-20 20:01:55 +00:00
|
|
|
/*
|
|
|
|
* CDDL HEADER START
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the terms of the
|
|
|
|
* Common Development and Distribution License (the "License").
|
|
|
|
* You may not use this file except in compliance with the License.
|
|
|
|
*
|
|
|
|
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
2022-07-11 21:16:13 +00:00
|
|
|
* or https://opensource.org/licenses/CDDL-1.0.
|
2008-11-20 20:01:55 +00:00
|
|
|
* See the License for the specific language governing permissions
|
|
|
|
* and limitations under the License.
|
|
|
|
*
|
|
|
|
* When distributing Covered Code, include this CDDL HEADER in each
|
|
|
|
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
|
|
* If applicable, add the following below this CDDL HEADER, with the
|
|
|
|
* fields enclosed by brackets "[]" replaced with your own identifying
|
|
|
|
* information: Portions Copyright [yyyy] [name of copyright owner]
|
|
|
|
*
|
|
|
|
* CDDL HEADER END
|
|
|
|
*/
|
|
|
|
/*
|
2010-05-28 20:45:14 +00:00
|
|
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
2018-08-20 16:52:37 +00:00
|
|
|
* Copyright (c) 2013, 2018 by Delphix. All rights reserved.
|
2008-11-20 20:01:55 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SYS_FS_ZFS_VFSOPS_H
|
|
|
|
#define _SYS_FS_ZFS_VFSOPS_H
|
|
|
|
|
2018-08-20 16:52:37 +00:00
|
|
|
#include <sys/dataset_kstats.h>
|
2008-11-20 20:01:55 +00:00
|
|
|
#include <sys/isa_defs.h>
|
|
|
|
#include <sys/types32.h>
|
|
|
|
#include <sys/list.h>
|
|
|
|
#include <sys/vfs.h>
|
|
|
|
#include <sys/zil.h>
|
2010-05-28 20:45:14 +00:00
|
|
|
#include <sys/sa.h>
|
2008-11-20 20:01:55 +00:00
|
|
|
#include <sys/rrwlock.h>
|
2018-07-11 22:49:10 +00:00
|
|
|
#include <sys/dsl_dataset.h>
|
2008-11-20 20:01:55 +00:00
|
|
|
#include <sys/zfs_ioctl.h>
|
Implement Redacted Send/Receive
Redacted send/receive allows users to send subsets of their data to
a target system. One possible use case for this feature is to not
transmit sensitive information to a data warehousing, test/dev, or
analytics environment. Another is to save space by not replicating
unimportant data within a given dataset, for example in backup tools
like zrepl.
Redacted send/receive is a three-stage process. First, a clone (or
clones) is made of the snapshot to be sent to the target. In this
clone (or clones), all unnecessary or unwanted data is removed or
modified. This clone is then snapshotted to create the "redaction
snapshot" (or snapshots). Second, the new zfs redact command is used
to create a redaction bookmark. The redaction bookmark stores the
list of blocks in a snapshot that were modified by the redaction
snapshot(s). Finally, the redaction bookmark is passed as a parameter
to zfs send. When sending to the snapshot that was redacted, the
redaction bookmark is used to filter out blocks that contain sensitive
or unwanted information, and those blocks are not included in the send
stream. When sending from the redaction bookmark, the blocks it
contains are considered as candidate blocks in addition to those
blocks in the destination snapshot that were modified since the
creation_txg of the redaction bookmark. This step is necessary to
allow the target to rehydrate data in the case where some blocks are
accidentally or unnecessarily modified in the redaction snapshot.
The changes to bookmarks to enable fast space estimation involve
adding deadlists to bookmarks. There is also logic to manage the
life cycles of these deadlists.
The new size estimation process operates in cases where previously
an accurate estimate could not be provided. In those cases, a send
is performed where no data blocks are read, reducing the runtime
significantly and providing a byte-accurate size estimate.
Reviewed-by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Chris Williamson <chris.williamson@delphix.com>
Reviewed-by: Pavel Zhakarov <pavel.zakharov@delphix.com>
Reviewed-by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #7958
2019-06-19 16:48:13 +00:00
|
|
|
#include <sys/objlist.h>
|
2008-11-20 20:01:55 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-03-08 00:21:37 +00:00
|
|
|
typedef struct zfsvfs zfsvfs_t;
|
2010-05-28 20:45:14 +00:00
|
|
|
struct znode;
|
2008-11-20 20:01:55 +00:00
|
|
|
|
2017-03-09 00:56:09 +00:00
|
|
|
/*
|
|
|
|
* This structure emulates the vfs_t from other platforms. It's purpose
|
2019-08-30 16:53:15 +00:00
|
|
|
* is to facilitate the handling of mount options and minimize structural
|
2017-03-09 00:56:09 +00:00
|
|
|
* differences between the platforms.
|
|
|
|
*/
|
|
|
|
typedef struct vfs {
|
|
|
|
struct zfsvfs *vfs_data;
|
|
|
|
char *vfs_mntpoint; /* Primary mount point */
|
|
|
|
uint64_t vfs_xattr;
|
|
|
|
boolean_t vfs_readonly;
|
|
|
|
boolean_t vfs_do_readonly;
|
|
|
|
boolean_t vfs_setuid;
|
|
|
|
boolean_t vfs_do_setuid;
|
|
|
|
boolean_t vfs_exec;
|
|
|
|
boolean_t vfs_do_exec;
|
|
|
|
boolean_t vfs_devices;
|
|
|
|
boolean_t vfs_do_devices;
|
|
|
|
boolean_t vfs_do_xattr;
|
|
|
|
boolean_t vfs_atime;
|
|
|
|
boolean_t vfs_do_atime;
|
|
|
|
boolean_t vfs_relatime;
|
|
|
|
boolean_t vfs_do_relatime;
|
|
|
|
boolean_t vfs_nbmand;
|
|
|
|
boolean_t vfs_do_nbmand;
|
|
|
|
} vfs_t;
|
|
|
|
|
|
|
|
typedef struct zfs_mnt {
|
|
|
|
const char *mnt_osname; /* Objset name */
|
|
|
|
char *mnt_data; /* Raw mount options */
|
|
|
|
} zfs_mnt_t;
|
2015-08-31 23:46:01 +00:00
|
|
|
|
2017-03-08 00:21:37 +00:00
|
|
|
struct zfsvfs {
|
2017-03-09 00:56:09 +00:00
|
|
|
vfs_t *z_vfs; /* generic fs struct */
|
2011-02-08 19:16:06 +00:00
|
|
|
struct super_block *z_sb; /* generic super_block */
|
2017-03-08 00:21:37 +00:00
|
|
|
struct zfsvfs *z_parent; /* parent fs */
|
2008-11-20 20:01:55 +00:00
|
|
|
objset_t *z_os; /* objset reference */
|
2011-02-08 19:16:06 +00:00
|
|
|
uint64_t z_flags; /* super_block flags */
|
2008-11-20 20:01:55 +00:00
|
|
|
uint64_t z_root; /* id of root znode */
|
|
|
|
uint64_t z_unlinkedobj; /* id of unlinked zapobj */
|
|
|
|
uint64_t z_max_blksz; /* maximum block size for files */
|
|
|
|
uint64_t z_fuid_obj; /* fuid table object number */
|
|
|
|
uint64_t z_fuid_size; /* fuid table size */
|
|
|
|
avl_tree_t z_fuid_idx; /* fuid tree keyed by index */
|
|
|
|
avl_tree_t z_fuid_domain; /* fuid tree keyed by domain */
|
|
|
|
krwlock_t z_fuid_lock; /* fuid lock */
|
|
|
|
boolean_t z_fuid_loaded; /* fuid tables are loaded */
|
2009-07-02 22:44:48 +00:00
|
|
|
boolean_t z_fuid_dirty; /* need to sync fuid table ? */
|
2008-11-20 20:01:55 +00:00
|
|
|
struct zfs_fuid_info *z_fuid_replay; /* fuid info for replay */
|
|
|
|
zilog_t *z_log; /* intent log pointer */
|
2019-12-05 00:35:18 +00:00
|
|
|
uint_t z_acl_mode; /* acl chmod/mode behavior */
|
2008-11-20 20:01:55 +00:00
|
|
|
uint_t z_acl_inherit; /* acl inheritance behavior */
|
2013-10-28 16:22:15 +00:00
|
|
|
uint_t z_acl_type; /* type of ACL usable on this FS */
|
2008-11-20 20:01:55 +00:00
|
|
|
zfs_case_t z_case; /* case-sense */
|
|
|
|
boolean_t z_utf8; /* utf8-only */
|
|
|
|
int z_norm; /* normalization flags */
|
2014-01-18 19:00:53 +00:00
|
|
|
boolean_t z_relatime; /* enable relatime mount option */
|
2008-11-20 20:01:55 +00:00
|
|
|
boolean_t z_unmounted; /* unmounted */
|
2014-07-18 16:53:38 +00:00
|
|
|
rrmlock_t z_teardown_lock;
|
2008-11-20 20:01:55 +00:00
|
|
|
krwlock_t z_teardown_inactive_lock;
|
2011-12-22 20:20:43 +00:00
|
|
|
list_t z_all_znodes; /* all znodes in the fs */
|
2013-11-01 19:26:11 +00:00
|
|
|
unsigned long z_rollback_time; /* last online rollback time */
|
2019-08-30 16:53:15 +00:00
|
|
|
unsigned long z_snap_defer_time; /* last snapshot unmount deferral */
|
2008-11-20 20:01:55 +00:00
|
|
|
kmutex_t z_znodes_lock; /* lock for z_all_znodes */
|
2015-03-17 22:07:47 +00:00
|
|
|
arc_prune_t *z_arc_prune; /* called by ARC to prune caches */
|
2011-01-26 20:45:24 +00:00
|
|
|
struct inode *z_ctldir; /* .zfs directory inode */
|
2008-11-20 20:01:55 +00:00
|
|
|
boolean_t z_show_ctldir; /* expose .zfs in the root dir */
|
|
|
|
boolean_t z_issnap; /* true if this is a snapshot */
|
|
|
|
boolean_t z_use_fuids; /* version allows fuids */
|
2009-01-15 21:59:39 +00:00
|
|
|
boolean_t z_replay; /* set during ZIL replay */
|
2010-05-28 20:45:14 +00:00
|
|
|
boolean_t z_use_sa; /* version allow system attributes */
|
2011-10-24 23:55:20 +00:00
|
|
|
boolean_t z_xattr_sa; /* allow xattrs to be stores as SA */
|
2019-02-12 18:41:15 +00:00
|
|
|
boolean_t z_draining; /* is true when drain is active */
|
|
|
|
boolean_t z_drain_cancel; /* signal the unlinked drain to stop */
|
2008-11-20 20:01:55 +00:00
|
|
|
uint64_t z_version; /* ZPL version */
|
2009-07-02 22:44:48 +00:00
|
|
|
uint64_t z_shares_dir; /* hidden shares dir */
|
2018-08-20 16:52:37 +00:00
|
|
|
dataset_kstats_t z_kstat; /* fs kstats */
|
2009-07-02 22:44:48 +00:00
|
|
|
kmutex_t z_lock;
|
|
|
|
uint64_t z_userquota_obj;
|
|
|
|
uint64_t z_groupquota_obj;
|
2016-10-04 18:46:10 +00:00
|
|
|
uint64_t z_userobjquota_obj;
|
|
|
|
uint64_t z_groupobjquota_obj;
|
2018-02-13 22:54:54 +00:00
|
|
|
uint64_t z_projectquota_obj;
|
|
|
|
uint64_t z_projectobjquota_obj;
|
2010-08-26 21:24:34 +00:00
|
|
|
uint64_t z_replay_eof; /* New end of file - replay only */
|
2010-05-28 20:45:14 +00:00
|
|
|
sa_attr_type_t *z_attr_table; /* SA attr mapping->id */
|
2015-12-22 21:47:38 +00:00
|
|
|
uint64_t z_hold_size; /* znode hold array size */
|
|
|
|
avl_tree_t *z_hold_trees; /* znode hold trees */
|
|
|
|
kmutex_t *z_hold_locks; /* znode hold locks */
|
2019-02-12 18:41:15 +00:00
|
|
|
taskqid_t z_drain_task; /* task id for the unlink drain task */
|
2017-03-08 00:21:37 +00:00
|
|
|
};
|
2011-01-26 20:45:24 +00:00
|
|
|
|
2020-11-04 22:23:48 +00:00
|
|
|
#define ZFS_TEARDOWN_INIT(zfsvfs) \
|
|
|
|
rrm_init(&(zfsvfs)->z_teardown_lock, B_FALSE)
|
|
|
|
|
|
|
|
#define ZFS_TEARDOWN_DESTROY(zfsvfs) \
|
|
|
|
rrm_destroy(&(zfsvfs)->z_teardown_lock)
|
|
|
|
|
|
|
|
#define ZFS_TEARDOWN_ENTER_READ(zfsvfs, tag) \
|
|
|
|
rrm_enter_read(&(zfsvfs)->z_teardown_lock, tag);
|
|
|
|
|
|
|
|
#define ZFS_TEARDOWN_EXIT_READ(zfsvfs, tag) \
|
|
|
|
rrm_exit(&(zfsvfs)->z_teardown_lock, tag)
|
|
|
|
|
|
|
|
#define ZFS_TEARDOWN_ENTER_WRITE(zfsvfs, tag) \
|
|
|
|
rrm_enter(&(zfsvfs)->z_teardown_lock, RW_WRITER, tag)
|
|
|
|
|
|
|
|
#define ZFS_TEARDOWN_EXIT_WRITE(zfsvfs) \
|
|
|
|
rrm_exit(&(zfsvfs)->z_teardown_lock, tag)
|
|
|
|
|
|
|
|
#define ZFS_TEARDOWN_EXIT(zfsvfs, tag) \
|
|
|
|
rrm_exit(&(zfsvfs)->z_teardown_lock, tag)
|
|
|
|
|
|
|
|
#define ZFS_TEARDOWN_READ_HELD(zfsvfs) \
|
|
|
|
RRM_READ_HELD(&(zfsvfs)->z_teardown_lock)
|
|
|
|
|
|
|
|
#define ZFS_TEARDOWN_WRITE_HELD(zfsvfs) \
|
|
|
|
RRM_WRITE_HELD(&(zfsvfs)->z_teardown_lock)
|
|
|
|
|
|
|
|
#define ZFS_TEARDOWN_HELD(zfsvfs) \
|
|
|
|
RRM_LOCK_HELD(&(zfsvfs)->z_teardown_lock)
|
|
|
|
|
2011-05-19 18:44:07 +00:00
|
|
|
#define ZSB_XATTR 0x0001 /* Enable user xattrs */
|
2011-02-08 19:16:06 +00:00
|
|
|
|
2011-01-26 20:45:24 +00:00
|
|
|
/*
|
|
|
|
* Allow a maximum number of links. While ZFS does not internally limit
|
2012-01-13 19:35:05 +00:00
|
|
|
* this the inode->i_nlink member is defined as an unsigned int. To be
|
|
|
|
* safe we use 2^31-1 as the limit.
|
2011-01-26 20:45:24 +00:00
|
|
|
*/
|
2013-11-01 19:26:11 +00:00
|
|
|
#define ZFS_LINK_MAX ((1U << 31) - 1U)
|
2008-11-20 20:01:55 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Normal filesystems (those not under .zfs/snapshot) have a total
|
|
|
|
* file ID size limited to 12 bytes (including the length field) due to
|
|
|
|
* NFSv2 protocol's limitation of 32 bytes for a filehandle. For historical
|
|
|
|
* reasons, this same limit is being imposed by the Solaris NFSv3 implementation
|
|
|
|
* (although the NFSv3 protocol actually permits a maximum of 64 bytes). It
|
|
|
|
* is not possible to expand beyond 12 bytes without abandoning support
|
|
|
|
* of NFSv2.
|
|
|
|
*
|
|
|
|
* For normal filesystems, we partition up the available space as follows:
|
|
|
|
* 2 bytes fid length (required)
|
|
|
|
* 6 bytes object number (48 bits)
|
|
|
|
* 4 bytes generation number (32 bits)
|
|
|
|
*
|
|
|
|
* We reserve only 48 bits for the object number, as this is the limit
|
|
|
|
* currently defined and imposed by the DMU.
|
|
|
|
*/
|
|
|
|
typedef struct zfid_short {
|
|
|
|
uint16_t zf_len;
|
|
|
|
uint8_t zf_object[6]; /* obj[i] = obj >> (8 * i) */
|
|
|
|
uint8_t zf_gen[4]; /* gen[i] = gen >> (8 * i) */
|
|
|
|
} zfid_short_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Filesystems under .zfs/snapshot have a total file ID size of 22 bytes
|
|
|
|
* (including the length field). This makes files under .zfs/snapshot
|
|
|
|
* accessible by NFSv3 and NFSv4, but not NFSv2.
|
|
|
|
*
|
|
|
|
* For files under .zfs/snapshot, we partition up the available space
|
|
|
|
* as follows:
|
|
|
|
* 2 bytes fid length (required)
|
|
|
|
* 6 bytes object number (48 bits)
|
|
|
|
* 4 bytes generation number (32 bits)
|
|
|
|
* 6 bytes objset id (48 bits)
|
|
|
|
* 4 bytes currently just zero (32 bits)
|
|
|
|
*
|
|
|
|
* We reserve only 48 bits for the object number and objset id, as these are
|
|
|
|
* the limits currently defined and imposed by the DMU.
|
|
|
|
*/
|
|
|
|
typedef struct zfid_long {
|
|
|
|
zfid_short_t z_fid;
|
|
|
|
uint8_t zf_setid[6]; /* obj[i] = obj >> (8 * i) */
|
|
|
|
uint8_t zf_setgen[4]; /* gen[i] = gen >> (8 * i) */
|
|
|
|
} zfid_long_t;
|
|
|
|
|
|
|
|
#define SHORT_FID_LEN (sizeof (zfid_short_t) - sizeof (uint16_t))
|
|
|
|
#define LONG_FID_LEN (sizeof (zfid_long_t) - sizeof (uint16_t))
|
|
|
|
|
2020-06-11 20:38:25 +00:00
|
|
|
extern void zfs_init(void);
|
|
|
|
extern void zfs_fini(void);
|
|
|
|
|
2017-03-08 00:21:37 +00:00
|
|
|
extern int zfs_suspend_fs(zfsvfs_t *zfsvfs);
|
|
|
|
extern int zfs_resume_fs(zfsvfs_t *zfsvfs, struct dsl_dataset *ds);
|
Implement Redacted Send/Receive
Redacted send/receive allows users to send subsets of their data to
a target system. One possible use case for this feature is to not
transmit sensitive information to a data warehousing, test/dev, or
analytics environment. Another is to save space by not replicating
unimportant data within a given dataset, for example in backup tools
like zrepl.
Redacted send/receive is a three-stage process. First, a clone (or
clones) is made of the snapshot to be sent to the target. In this
clone (or clones), all unnecessary or unwanted data is removed or
modified. This clone is then snapshotted to create the "redaction
snapshot" (or snapshots). Second, the new zfs redact command is used
to create a redaction bookmark. The redaction bookmark stores the
list of blocks in a snapshot that were modified by the redaction
snapshot(s). Finally, the redaction bookmark is passed as a parameter
to zfs send. When sending to the snapshot that was redacted, the
redaction bookmark is used to filter out blocks that contain sensitive
or unwanted information, and those blocks are not included in the send
stream. When sending from the redaction bookmark, the blocks it
contains are considered as candidate blocks in addition to those
blocks in the destination snapshot that were modified since the
creation_txg of the redaction bookmark. This step is necessary to
allow the target to rehydrate data in the case where some blocks are
accidentally or unnecessarily modified in the redaction snapshot.
The changes to bookmarks to enable fast space estimation involve
adding deadlists to bookmarks. There is also logic to manage the
life cycles of these deadlists.
The new size estimation process operates in cases where previously
an accurate estimate could not be provided. In those cases, a send
is performed where no data blocks are read, reducing the runtime
significantly and providing a byte-accurate size estimate.
Reviewed-by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Chris Williamson <chris.williamson@delphix.com>
Reviewed-by: Pavel Zhakarov <pavel.zakharov@delphix.com>
Reviewed-by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #7958
2019-06-19 16:48:13 +00:00
|
|
|
extern int zfs_end_fs(zfsvfs_t *zfsvfs, struct dsl_dataset *ds);
|
2019-11-11 17:34:21 +00:00
|
|
|
extern void zfs_exit_fs(zfsvfs_t *zfsvfs);
|
2017-03-08 00:21:37 +00:00
|
|
|
extern int zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers);
|
2018-02-21 00:27:31 +00:00
|
|
|
extern int zfsvfs_create(const char *name, boolean_t readony, zfsvfs_t **zfvp);
|
2018-02-08 16:16:23 +00:00
|
|
|
extern int zfsvfs_create_impl(zfsvfs_t **zfvp, zfsvfs_t *zfsvfs, objset_t *os);
|
2017-03-08 22:56:19 +00:00
|
|
|
extern void zfsvfs_free(zfsvfs_t *zfsvfs);
|
2010-05-28 20:45:14 +00:00
|
|
|
extern int zfs_check_global_label(const char *dsname, const char *hexsl);
|
2008-11-20 20:01:55 +00:00
|
|
|
|
2017-03-08 22:56:19 +00:00
|
|
|
extern boolean_t zfs_is_readonly(zfsvfs_t *zfsvfs);
|
2017-03-09 00:56:09 +00:00
|
|
|
extern int zfs_domount(struct super_block *sb, zfs_mnt_t *zm, int silent);
|
2011-11-11 07:15:53 +00:00
|
|
|
extern void zfs_preumount(struct super_block *sb);
|
2011-02-08 19:16:06 +00:00
|
|
|
extern int zfs_umount(struct super_block *sb);
|
2017-03-09 00:56:09 +00:00
|
|
|
extern int zfs_remount(struct super_block *sb, int *flags, zfs_mnt_t *zm);
|
linux: add basic fallocate(mode=0/2) compatibility
Implement semi-compatible functionality for mode=0 (preallocation)
and mode=FALLOC_FL_KEEP_SIZE (preallocation beyond EOF) for ZPL.
Since ZFS does COW and snapshots, preallocating blocks for a file
cannot guarantee that writes to the file will not run out of space.
Even if the first overwrite was guaranteed, it would not handle any
later overwrite of blocks due to COW, so strict compliance is futile.
Instead, make a best-effort check that at least enough free space is
currently available in the pool (with a bit of margin), then create
a sparse file of the requested size and continue on with life.
This does not handle all cases (e.g. several fallocate() calls before
writing into the files when the filesystem is nearly full), which
would require a more complex mechanism to be implemented, probably
based on a modified version of dmu_prealloc(), but is usable as-is.
A new module option zfs_fallocate_reserve_percent is used to control
the reserve margin for any single fallocate call. By default, this
is 110% of the requested preallocation size, so an additional 10% of
available space is reserved for overhead to allow the application a
good chance of finishing the write when the fallocate() succeeds.
If the heuristics of this basic fallocate implementation are not
desirable, the old non-functional behavior of returning EOPNOTSUPP
for calls can be restored by setting zfs_fallocate_reserve_percent=0.
The parameter of zfs_statvfs() is changed to take an inode instead
of a dentry, since no dentry is available in zfs_fallocate_common().
A few tests from @behlendorf cover basic fallocate functionality.
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Arshad Hussain <arshad.super@gmail.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Issue #326
Closes #10408
2020-06-18 18:22:11 +00:00
|
|
|
extern int zfs_statvfs(struct inode *ip, struct kstatfs *statp);
|
2011-05-19 18:44:07 +00:00
|
|
|
extern int zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp);
|
2017-03-08 22:56:19 +00:00
|
|
|
extern int zfs_prune(struct super_block *sb, unsigned long nr_to_scan,
|
|
|
|
int *objects);
|
2019-10-10 22:59:34 +00:00
|
|
|
extern int zfs_get_temporary_prop(dsl_dataset_t *ds, zfs_prop_t zfs_prop,
|
|
|
|
uint64_t *val, char *setpoint);
|
2010-12-17 19:18:08 +00:00
|
|
|
|
2008-11-20 20:01:55 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _SYS_FS_ZFS_VFSOPS_H */
|