MFV r251620:

ZFS comments need cleaner, more consistent style

Illumos ZFS issues:
  3741 zfs comments need cleaner, more consistent style

MFC after:      2 weeks
This commit is contained in:
Xin LI 2013-06-11 19:12:06 +00:00
commit a91afe8a8d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251631
39 changed files with 244 additions and 271 deletions

View File

@ -58,11 +58,11 @@
* tight. * tight.
* *
* 3. The Megiddo and Modha model assumes a fixed page size. All * 3. The Megiddo and Modha model assumes a fixed page size. All
* elements of the cache are therefor exactly the same size. So * elements of the cache are therefore exactly the same size. So
* when adjusting the cache size following a cache miss, its simply * when adjusting the cache size following a cache miss, its simply
* a matter of choosing a single page to evict. In our model, we * a matter of choosing a single page to evict. In our model, we
* have variable sized cache blocks (rangeing from 512 bytes to * have variable sized cache blocks (rangeing from 512 bytes to
* 128K bytes). We therefor choose a set of blocks to evict to make * 128K bytes). We therefore choose a set of blocks to evict to make
* space for a cache miss that approximates as closely as possible * space for a cache miss that approximates as closely as possible
* the space used by the new block. * the space used by the new block.
* *
@ -77,7 +77,7 @@
* ways: 1) via a hash table lookup using the DVA as a key, * ways: 1) via a hash table lookup using the DVA as a key,
* or 2) via one of the ARC lists. The arc_read() interface * or 2) via one of the ARC lists. The arc_read() interface
* uses method 1, while the internal arc algorithms for * uses method 1, while the internal arc algorithms for
* adjusting the cache use method 2. We therefor provide two * adjusting the cache use method 2. We therefore provide two
* types of locks: 1) the hash table lock array, and 2) the * types of locks: 1) the hash table lock array, and 2) the
* arc list locks. * arc list locks.
* *
@ -438,7 +438,7 @@ static arc_stats_t arc_stats = {
#define ARCSTAT(stat) (arc_stats.stat.value.ui64) #define ARCSTAT(stat) (arc_stats.stat.value.ui64)
#define ARCSTAT_INCR(stat, val) \ #define ARCSTAT_INCR(stat, val) \
atomic_add_64(&arc_stats.stat.value.ui64, (val)); atomic_add_64(&arc_stats.stat.value.ui64, (val))
#define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) #define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1)
#define ARCSTAT_BUMPDOWN(stat) ARCSTAT_INCR(stat, -1) #define ARCSTAT_BUMPDOWN(stat) ARCSTAT_INCR(stat, -1)
@ -672,9 +672,7 @@ uint64_t zfs_crc64_table[256];
#define l2arc_writes_sent ARCSTAT(arcstat_l2_writes_sent) #define l2arc_writes_sent ARCSTAT(arcstat_l2_writes_sent)
#define l2arc_writes_done ARCSTAT(arcstat_l2_writes_done) #define l2arc_writes_done ARCSTAT(arcstat_l2_writes_done)
/* /* L2ARC Performance Tunables */
* L2ARC Performance Tunables
*/
uint64_t l2arc_write_max = L2ARC_WRITE_SIZE; /* default max write size */ uint64_t l2arc_write_max = L2ARC_WRITE_SIZE; /* default max write size */
uint64_t l2arc_write_boost = L2ARC_WRITE_SIZE; /* extra write during warmup */ uint64_t l2arc_write_boost = L2ARC_WRITE_SIZE; /* extra write during warmup */
uint64_t l2arc_headroom = L2ARC_HEADROOM; /* number of dev writes */ uint64_t l2arc_headroom = L2ARC_HEADROOM; /* number of dev writes */
@ -3900,7 +3898,7 @@ arc_tempreserve_space(uint64_t reserve, uint64_t txg)
/* /*
* Writes will, almost always, require additional memory allocations * Writes will, almost always, require additional memory allocations
* in order to compress/encrypt/etc the data. We therefor need to * in order to compress/encrypt/etc the data. We therefore need to
* make sure that there is sufficient available memory for this. * make sure that there is sufficient available memory for this.
*/ */
if (error = arc_memory_throttle(reserve, anon_size, txg)) if (error = arc_memory_throttle(reserve, anon_size, txg))

View File

@ -43,7 +43,7 @@
* dsl_scan_sync. This allows the delete operation to finish without traversing * dsl_scan_sync. This allows the delete operation to finish without traversing
* all the dataset's blocks. * all the dataset's blocks.
* *
* Note that while bt_begin and bt_end are only ever incremented in this code * Note that while bt_begin and bt_end are only ever incremented in this code,
* they are effectively reset to 0 every time the entire bptree is freed because * they are effectively reset to 0 every time the entire bptree is freed because
* the bptree's object is destroyed and re-created. * the bptree's object is destroyed and re-created.
*/ */

View File

@ -1808,14 +1808,16 @@ dnode_willuse_space(dnode_t *dn, int64_t space, dmu_tx_t *tx)
} }
/* /*
* This function scans a block at the indicated "level" looking for * Scans a block at the indicated "level" looking for a hole or data,
* a hole or data (depending on 'flags'). If level > 0, then we are * depending on 'flags'.
* scanning an indirect block looking at its pointers. If level == 0, *
* then we are looking at a block of dnodes. If we don't find what we * If level > 0, then we are scanning an indirect block looking at its
* are looking for in the block, we return ESRCH. Otherwise, return * pointers. If level == 0, then we are looking at a block of dnodes.
* with *offset pointing to the beginning (if searching forwards) or *
* end (if searching backwards) of the range covered by the block * If we don't find what we are looking for in the block, we return ESRCH.
* pointer we matched on (or dnode). * Otherwise, return with *offset pointing to the beginning (if searching
* forwards) or end (if searching backwards) of the range covered by the
* block pointer we matched on (or dnode).
* *
* The basic search algorithm used below by dnode_next_offset() is to * The basic search algorithm used below by dnode_next_offset() is to
* use this function to search up the block tree (widen the search) until * use this function to search up the block tree (widen the search) until

View File

@ -302,7 +302,7 @@ free_children(dmu_buf_impl_t *db, uint64_t blkid, uint64_t nblks, int trunc,
} }
/* /*
* free_range: Traverse the indicated range of the provided file * Traverse the indicated range of the provided file
* and "free" all the blocks contained there. * and "free" all the blocks contained there.
*/ */
static void static void
@ -370,7 +370,7 @@ dnode_sync_free_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx)
} }
/* /*
* Try to kick all the dnodes dbufs out of the cache... * Try to kick all the dnode's dbufs out of the cache...
*/ */
void void
dnode_evict_dbufs(dnode_t *dn) dnode_evict_dbufs(dnode_t *dn)

View File

@ -379,7 +379,7 @@ dsl_prop_predict(dsl_dir_t *dd, const char *propname,
/* /*
* Unregister this callback. Return 0 on success, ENOENT if ddname is * Unregister this callback. Return 0 on success, ENOENT if ddname is
* invalid, ENOMSG if no matching callback registered. * invalid, or ENOMSG if no matching callback registered.
*/ */
int int
dsl_prop_unregister(dsl_dataset_t *ds, const char *propname, dsl_prop_unregister(dsl_dataset_t *ds, const char *propname,

View File

@ -111,6 +111,7 @@
* location. * location.
* *
* Byteswap implications: * Byteswap implications:
*
* Since the SA attributes are not entirely self describing we can't do * Since the SA attributes are not entirely self describing we can't do
* the normal byteswap processing. The special ZAP layout attribute and * the normal byteswap processing. The special ZAP layout attribute and
* attribute registration attributes define the byteswap function and the * attribute registration attributes define the byteswap function and the
@ -189,7 +190,6 @@ sa_attr_reg_t sa_legacy_attrs[] = {
}; };
/* /*
* ZPL legacy layout
* This is only used for objects of type DMU_OT_ZNODE * This is only used for objects of type DMU_OT_ZNODE
*/ */
sa_attr_type_t sa_legacy_zpl_layout[] = { sa_attr_type_t sa_legacy_zpl_layout[] = {
@ -199,7 +199,6 @@ sa_attr_type_t sa_legacy_zpl_layout[] = {
/* /*
* Special dummy layout used for buffers with no attributes. * Special dummy layout used for buffers with no attributes.
*/ */
sa_attr_type_t sa_dummy_zpl_layout[] = { 0 }; sa_attr_type_t sa_dummy_zpl_layout[] = { 0 };
static int sa_legacy_attr_count = 16; static int sa_legacy_attr_count = 16;

View File

@ -4698,6 +4698,7 @@ spa_vdev_attach(spa_t *spa, uint64_t guid, nvlist_t *nvroot, int replacing)
/* /*
* Detach a device from a mirror or replacing vdev. * Detach a device from a mirror or replacing vdev.
*
* If 'replace_done' is specified, only detach if the parent * If 'replace_done' is specified, only detach if the parent
* is a replacing vdev. * is a replacing vdev.
*/ */
@ -5359,11 +5360,9 @@ spa_vdev_remove_from_namespace(spa_t *spa, vdev_t *vd)
* the spa_vdev_config_[enter/exit] functions which allow us to * the spa_vdev_config_[enter/exit] functions which allow us to
* grab and release the spa_config_lock while still holding the namespace * grab and release the spa_config_lock while still holding the namespace
* lock. During each step the configuration is synced out. * lock. During each step the configuration is synced out.
*/ *
* Currently, this supports removing only hot spares, slogs, and level 2 ARC
/* * devices.
* Remove a device from the pool. Currently, this supports removing only hot
* spares, slogs, and level 2 ARC devices.
*/ */
int int
spa_vdev_remove(spa_t *spa, uint64_t guid, boolean_t unspare) spa_vdev_remove(spa_t *spa, uint64_t guid, boolean_t unspare)
@ -5473,7 +5472,7 @@ spa_vdev_remove(spa_t *spa, uint64_t guid, boolean_t unspare)
/* /*
* Find any device that's done replacing, or a vdev marked 'unspare' that's * Find any device that's done replacing, or a vdev marked 'unspare' that's
* current spared, so we can detach it. * currently spared, so we can detach it.
*/ */
static vdev_t * static vdev_t *
spa_vdev_resilver_done_hunt(vdev_t *vd) spa_vdev_resilver_done_hunt(vdev_t *vd)

View File

@ -315,6 +315,7 @@ spa_config_set(spa_t *spa, nvlist_t *config)
/* /*
* Generate the pool's configuration based on the current in-core state. * Generate the pool's configuration based on the current in-core state.
*
* We infer whether to generate a complete config or just one top-level config * We infer whether to generate a complete config or just one top-level config
* based on whether vd is the root vdev. * based on whether vd is the root vdev.
*/ */

View File

@ -1369,7 +1369,7 @@ zfs_panic_recover(const char *fmt, ...)
/* /*
* This is a stripped-down version of strtoull, suitable only for converting * This is a stripped-down version of strtoull, suitable only for converting
* lowercase hexidecimal numbers that don't overflow. * lowercase hexadecimal numbers that don't overflow.
*/ */
uint64_t uint64_t
zfs_strtonum(const char *str, char **nptr) zfs_strtonum(const char *str, char **nptr)

View File

@ -63,16 +63,15 @@ enum ddt_class {
*/ */
typedef struct ddt_key { typedef struct ddt_key {
zio_cksum_t ddk_cksum; /* 256-bit block checksum */ zio_cksum_t ddk_cksum; /* 256-bit block checksum */
uint64_t ddk_prop; /* LSIZE, PSIZE, compression */ /*
* Encoded with logical & physical size, and compression, as follows:
* +-------+-------+-------+-------+-------+-------+-------+-------+
* | 0 | 0 | 0 | comp | PSIZE | LSIZE |
* +-------+-------+-------+-------+-------+-------+-------+-------+
*/
uint64_t ddk_prop;
} ddt_key_t; } ddt_key_t;
/*
* ddk_prop layout:
*
* +-------+-------+-------+-------+-------+-------+-------+-------+
* | 0 | 0 | 0 | comp | PSIZE | LSIZE |
* +-------+-------+-------+-------+-------+-------+-------+-------+
*/
#define DDK_GET_LSIZE(ddk) \ #define DDK_GET_LSIZE(ddk) \
BF64_GET_SB((ddk)->ddk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1) BF64_GET_SB((ddk)->ddk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1)
#define DDK_SET_LSIZE(ddk, x) \ #define DDK_SET_LSIZE(ddk, x) \

View File

@ -145,9 +145,8 @@ typedef struct dnode_phys {
typedef struct dnode { typedef struct dnode {
/* /*
* dn_struct_rwlock protects the structure of the dnode, * Protects the structure of the dnode, including the number of levels
* including the number of levels of indirection (dn_nlevels), * of indirection (dn_nlevels), dn_maxblkid, and dn_next_*
* dn_maxblkid, and dn_next_*
*/ */
krwlock_t dn_struct_rwlock; krwlock_t dn_struct_rwlock;

View File

@ -110,6 +110,7 @@ typedef struct dsl_pool {
/* /*
* Protects administrative changes (properties, namespace) * Protects administrative changes (properties, namespace)
*
* It is only held for write in syncing context. Therefore * It is only held for write in syncing context. Therefore
* syncing context does not need to ever have it for read, since * syncing context does not need to ever have it for read, since
* nobody else could possibly have it for write. * nobody else could possibly have it for write.

View File

@ -150,6 +150,7 @@ struct sa_os {
/* /*
* header for all bonus and spill buffers. * header for all bonus and spill buffers.
*
* The header has a fixed portion with a variable number * The header has a fixed portion with a variable number
* of "lengths" depending on the number of variable sized * of "lengths" depending on the number of variable sized
* attribues which are determined by the "layout number" * attribues which are determined by the "layout number"
@ -158,29 +159,27 @@ struct sa_os {
#define SA_MAGIC 0x2F505A /* ZFS SA */ #define SA_MAGIC 0x2F505A /* ZFS SA */
typedef struct sa_hdr_phys { typedef struct sa_hdr_phys {
uint32_t sa_magic; uint32_t sa_magic;
uint16_t sa_layout_info; /* Encoded with hdrsize and layout number */ /*
* Encoded with hdrsize and layout number as follows:
* 16 10 0
* +--------+-------+
* | hdrsz |layout |
* +--------+-------+
*
* Bits 0-10 are the layout number
* Bits 11-16 are the size of the header.
* The hdrsize is the number * 8
*
* For example.
* hdrsz of 1 ==> 8 byte header
* 2 ==> 16 byte header
*
*/
uint16_t sa_layout_info;
uint16_t sa_lengths[1]; /* optional sizes for variable length attrs */ uint16_t sa_lengths[1]; /* optional sizes for variable length attrs */
/* ... Data follows the lengths. */ /* ... Data follows the lengths. */
} sa_hdr_phys_t; } sa_hdr_phys_t;
/*
* sa_hdr_phys -> sa_layout_info
*
* 16 10 0
* +--------+-------+
* | hdrsz |layout |
* +--------+-------+
*
* Bits 0-10 are the layout number
* Bits 11-16 are the size of the header.
* The hdrsize is the number * 8
*
* For example.
* hdrsz of 1 ==> 8 byte header
* 2 ==> 16 byte header
*
*/
#define SA_HDR_LAYOUT_NUM(hdr) BF32_GET(hdr->sa_layout_info, 0, 10) #define SA_HDR_LAYOUT_NUM(hdr) BF32_GET(hdr->sa_layout_info, 0, 10)
#define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 6, 3, 0) #define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 6, 3, 0)
#define SA_HDR_LAYOUT_INFO_ENCODE(x, num, size) \ #define SA_HDR_LAYOUT_INFO_ENCODE(x, num, size) \

View File

@ -242,7 +242,7 @@ struct spa {
uint64_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_sync_starttime; /* starting time fo spa_sync */
uint64_t spa_deadman_synctime; /* deadman expiration timer */ uint64_t spa_deadman_synctime; /* deadman expiration timer */
/* /*
* spa_refcnt & spa_config_lock must be the last elements * spa_refcount & spa_config_lock must be the last elements
* because refcount_t changes size based on compilation options. * because refcount_t changes size based on compilation options.
* In order for the MDB module to function correctly, the other * In order for the MDB module to function correctly, the other
* fields must remain in the same location. * fields must remain in the same location.

View File

@ -94,7 +94,6 @@ struct space_map_ops {
* 63 62 60 59 50 49 0 * 63 62 60 59 50 49 0
* *
* *
*
* non-debug entry * non-debug entry
* *
* 1 47 1 15 * 1 47 1 15

View File

@ -26,8 +26,6 @@
#ifndef _SYS_UNIQUE_H #ifndef _SYS_UNIQUE_H
#define _SYS_UNIQUE_H #define _SYS_UNIQUE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/zfs_context.h> #include <sys/zfs_context.h>
#ifdef __cplusplus #ifdef __cplusplus
@ -42,7 +40,7 @@ void unique_fini(void);
/* /*
* Return a new unique value (which will not be uniquified against until * Return a new unique value (which will not be uniquified against until
* it is unique_insert()-ed. * it is unique_insert()-ed).
*/ */
uint64_t unique_create(void); uint64_t unique_create(void);

View File

@ -247,12 +247,13 @@ typedef struct vdev_label {
#define VDD_METASLAB 0x01 #define VDD_METASLAB 0x01
#define VDD_DTL 0x02 #define VDD_DTL 0x02
/* Offset of embedded boot loader region on each label */
#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t))
/* /*
* Size and offset of embedded boot loader region on each label. * Size of embedded boot loader region on each label.
* The total size of the first two labels plus the boot area is 4MB. * The total size of the first two labels plus the boot area is 4MB.
*/ */
#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t)) #define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */
#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */
/* /*
* Size of label regions at the start and end of each leaf device. * Size of label regions at the start and end of each leaf device.
@ -323,8 +324,9 @@ extern uint64_t vdev_get_min_asize(vdev_t *vd);
extern void vdev_set_min_asize(vdev_t *vd); extern void vdev_set_min_asize(vdev_t *vd);
/* /*
* zdb uses this tunable, so it must be declared here to make lint happy. * Global variables
*/ */
/* zdb uses this tunable, so it must be declared here to make lint happy. */
extern int zfs_vdev_cache_size; extern int zfs_vdev_cache_size;
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -86,18 +86,22 @@ extern "C" {
#endif #endif
/* /*
* The matchtype specifies which entry will be accessed. * Specifies matching criteria for ZAP lookups.
* MT_EXACT: only find an exact match (non-normalized)
* MT_FIRST: find the "first" normalized (case and Unicode
* form) match; the designated "first" match will not change as long
* as the set of entries with this normalization doesn't change
* MT_BEST: if there is an exact match, find that, otherwise find the
* first normalized match
*/ */
typedef enum matchtype typedef enum matchtype
{ {
/* Only find an exact match (non-normalized) */
MT_EXACT, MT_EXACT,
/*
* If there is an exact match, find that, otherwise find the
* first normalized match.
*/
MT_BEST, MT_BEST,
/*
* Find the "first" normalized (case and Unicode form) match;
* the designated "first" match will not change as long as the
* set of entries with this normalization doesn't change.
*/
MT_FIRST MT_FIRST
} matchtype_t; } matchtype_t;
@ -174,16 +178,21 @@ int zap_destroy(objset_t *ds, uint64_t zapobj, dmu_tx_t *tx);
* call will fail and return EINVAL. * call will fail and return EINVAL.
* *
* If 'integer_size' is equal to or larger than the attribute's integer * If 'integer_size' is equal to or larger than the attribute's integer
* size, the call will succeed and return 0. * When converting to a * size, the call will succeed and return 0.
* larger integer size, the integers will be treated as unsigned (ie. no *
* sign-extension will be performed). * When converting to a larger integer size, the integers will be treated as
* unsigned (ie. no sign-extension will be performed).
* *
* 'num_integers' is the length (in integers) of 'buf'. * 'num_integers' is the length (in integers) of 'buf'.
* *
* If the attribute is longer than the buffer, as many integers as will * If the attribute is longer than the buffer, as many integers as will
* fit will be transferred to 'buf'. If the entire attribute was not * fit will be transferred to 'buf'. If the entire attribute was not
* transferred, the call will return EOVERFLOW. * transferred, the call will return EOVERFLOW.
* */
int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name,
uint64_t integer_size, uint64_t num_integers, void *buf);
/*
* If rn_len is nonzero, realname will be set to the name of the found * If rn_len is nonzero, realname will be set to the name of the found
* entry (which may be different from the requested name if matchtype is * entry (which may be different from the requested name if matchtype is
* not MT_EXACT). * not MT_EXACT).
@ -191,8 +200,6 @@ int zap_destroy(objset_t *ds, uint64_t zapobj, dmu_tx_t *tx);
* If normalization_conflictp is not NULL, it will be set if there is * If normalization_conflictp is not NULL, it will be set if there is
* another name with the same case/unicode normalized form. * another name with the same case/unicode normalized form.
*/ */
int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name,
uint64_t integer_size, uint64_t num_integers, void *buf);
int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name, int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name,
uint64_t integer_size, uint64_t num_integers, void *buf, uint64_t integer_size, uint64_t num_integers, void *buf,
matchtype_t mt, char *realname, int rn_len, matchtype_t mt, char *realname, int rn_len,

View File

@ -101,6 +101,7 @@ typedef enum zap_chunk_type {
*/ */
typedef struct zap_leaf_phys { typedef struct zap_leaf_phys {
struct zap_leaf_header { struct zap_leaf_header {
/* Public to ZAP */
uint64_t lh_block_type; /* ZBT_LEAF */ uint64_t lh_block_type; /* ZBT_LEAF */
uint64_t lh_pad1; uint64_t lh_pad1;
uint64_t lh_prefix; /* hash prefix of this leaf */ uint64_t lh_prefix; /* hash prefix of this leaf */
@ -109,8 +110,7 @@ typedef struct zap_leaf_phys {
uint16_t lh_nentries; /* number of entries */ uint16_t lh_nentries; /* number of entries */
uint16_t lh_prefix_len; /* num bits used to id this */ uint16_t lh_prefix_len; /* num bits used to id this */
/* above is accessable to zap, below is zap_leaf private */ /* Private to zap_leaf */
uint16_t lh_freelist; /* chunk head of free list */ uint16_t lh_freelist; /* chunk head of free list */
uint8_t lh_flags; /* ZLF_* flags */ uint8_t lh_flags; /* ZLF_* flags */
uint8_t lh_pad2[11]; uint8_t lh_pad2[11];
@ -161,13 +161,13 @@ typedef struct zap_leaf {
typedef struct zap_entry_handle { typedef struct zap_entry_handle {
/* below is set by zap_leaf.c and is public to zap.c */ /* Set by zap_leaf and public to ZAP */
uint64_t zeh_num_integers; uint64_t zeh_num_integers;
uint64_t zeh_hash; uint64_t zeh_hash;
uint32_t zeh_cd; uint32_t zeh_cd;
uint8_t zeh_integer_size; uint8_t zeh_integer_size;
/* below is private to zap_leaf.c */ /* Private to zap_leaf */
uint16_t zeh_fakechunk; uint16_t zeh_fakechunk;
uint16_t *zeh_chunkp; uint16_t *zeh_chunkp;
zap_leaf_t *zeh_leaf; zap_leaf_t *zeh_leaf;
@ -202,7 +202,7 @@ extern int zap_entry_read_name(struct zap *zap, const zap_entry_handle_t *zeh,
/* /*
* Replace the value of an existing entry. * Replace the value of an existing entry.
* *
* zap_entry_update may fail if it runs out of space (ENOSPC). * May fail if it runs out of space (ENOSPC).
*/ */
extern int zap_entry_update(zap_entry_handle_t *zeh, extern int zap_entry_update(zap_entry_handle_t *zeh,
uint8_t integer_size, uint64_t num_integers, const void *buf); uint8_t integer_size, uint64_t num_integers, const void *buf);
@ -221,10 +221,7 @@ extern int zap_entry_create(zap_leaf_t *l, struct zap_name *zn, uint32_t cd,
uint8_t integer_size, uint64_t num_integers, const void *buf, uint8_t integer_size, uint64_t num_integers, const void *buf,
zap_entry_handle_t *zeh); zap_entry_handle_t *zeh);
/* /* Determine whether there is another entry with the same normalized form. */
* Return true if there are additional entries with the same normalized
* form.
*/
extern boolean_t zap_entry_normalization_conflict(zap_entry_handle_t *zeh, extern boolean_t zap_entry_normalization_conflict(zap_entry_handle_t *zeh,
struct zap_name *zn, const char *name, struct zap *zap); struct zap_name *zn, const char *name, struct zap *zap);

View File

@ -45,7 +45,8 @@ struct znode_phys;
#define ZFS_ACL_VERSION ZFS_ACL_VERSION_FUID #define ZFS_ACL_VERSION ZFS_ACL_VERSION_FUID
/* /*
* ZFS ACLs are store in various forms. * ZFS ACLs (Access Control Lists) are stored in various forms.
*
* Files created with ACL version ZFS_ACL_VERSION_INITIAL * Files created with ACL version ZFS_ACL_VERSION_INITIAL
* will all be created with fixed length ACEs of type * will all be created with fixed length ACEs of type
* zfs_oldace_t. * zfs_oldace_t.
@ -135,8 +136,8 @@ typedef struct acl_ops {
size_t (*ace_size)(void *acep); /* how big is this ace */ size_t (*ace_size)(void *acep); /* how big is this ace */
size_t (*ace_abstract_size)(void); /* sizeof abstract entry */ size_t (*ace_abstract_size)(void); /* sizeof abstract entry */
int (*ace_mask_off)(void); /* off of access mask in ace */ int (*ace_mask_off)(void); /* off of access mask in ace */
/* ptr to data if any */
int (*ace_data)(void *acep, void **datap); int (*ace_data)(void *acep, void **datap);
/* ptr to data if any */
} acl_ops_t; } acl_ops_t;
/* /*

View File

@ -26,8 +26,6 @@
#ifndef _SYS_FS_ZFS_RLOCK_H #ifndef _SYS_FS_ZFS_RLOCK_H
#define _SYS_FS_ZFS_RLOCK_H #define _SYS_FS_ZFS_RLOCK_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -57,16 +55,14 @@ typedef struct rl {
} rl_t; } rl_t;
/* /*
* Lock a range (offset, length) as either shared (READER) * Lock a range (offset, length) as either shared (RL_READER)
* or exclusive (WRITER or APPEND). APPEND is a special type that * or exclusive (RL_WRITER or RL_APPEND). RL_APPEND is a special type that
* is converted to WRITER that specified to lock from the start of the * is converted to RL_WRITER that specified to lock from the start of the
* end of file. zfs_range_lock() returns the range lock structure. * end of file. Returns the range lock structure.
*/ */
rl_t *zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type); rl_t *zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type);
/* /* Unlock range and destroy range lock structure. */
* Unlock range and destroy range lock structure.
*/
void zfs_range_unlock(rl_t *rl); void zfs_range_unlock(rl_t *rl);
/* /*
@ -76,7 +72,8 @@ void zfs_range_unlock(rl_t *rl);
void zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len); void zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len);
/* /*
* AVL comparison function used to compare range locks * AVL comparison function used to order range locks
* Locks are ordered on the start offset of the range.
*/ */
int zfs_range_compare(const void *arg1, const void *arg2); int zfs_range_compare(const void *arg1, const void *arg2);

View File

@ -135,8 +135,9 @@ extern "C" {
#define ZFS_MAX_BLOCKSIZE (SPA_MAXBLOCKSIZE) #define ZFS_MAX_BLOCKSIZE (SPA_MAXBLOCKSIZE)
/* Path component length */
/* /*
* Path component length
*
* The generic fs code uses MAXNAMELEN to represent * The generic fs code uses MAXNAMELEN to represent
* what the largest component length is. Unfortunately, * what the largest component length is. Unfortunately,
* this length includes the terminating NULL. ZFS needs * this length includes the terminating NULL. ZFS needs
@ -252,12 +253,7 @@ VTOZ(vnode_t *vp)
#define VTOZ(VP) ((znode_t *)(VP)->v_data) #define VTOZ(VP) ((znode_t *)(VP)->v_data)
#endif #endif
/* /* Called on entry to each ZFS vnode and vfs operation */
* ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation.
* ZFS_ENTER_NOERROR() is called when we can't return EIO.
* ZFS_EXIT() must be called before exitting the vop.
* ZFS_VERIFY_ZP() verifies the znode is valid.
*/
#define ZFS_ENTER(zfsvfs) \ #define ZFS_ENTER(zfsvfs) \
{ \ { \
rrw_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ rrw_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \
@ -267,11 +263,14 @@ VTOZ(vnode_t *vp)
} \ } \
} }
/* Called on entry to each ZFS vnode and vfs operation that can not return EIO */
#define ZFS_ENTER_NOERROR(zfsvfs) \ #define ZFS_ENTER_NOERROR(zfsvfs) \
rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG)
/* Must be called before exiting the vop */
#define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) #define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG)
/* Verifies the znode is valid */
#define ZFS_VERIFY_ZP(zp) \ #define ZFS_VERIFY_ZP(zp) \
if ((zp)->z_sa_hdl == NULL) { \ if ((zp)->z_sa_hdl == NULL) { \
ZFS_EXIT((zp)->z_zfsvfs); \ ZFS_EXIT((zp)->z_zfsvfs); \
@ -291,15 +290,14 @@ VTOZ(vnode_t *vp)
#define ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num) \ #define ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num) \
mutex_exit(ZFS_OBJ_MUTEX((zfsvfs), (obj_num))) mutex_exit(ZFS_OBJ_MUTEX((zfsvfs), (obj_num)))
/* /* Encode ZFS stored time values from a struct timespec */
* Macros to encode/decode ZFS stored time values from/to struct timespec
*/
#define ZFS_TIME_ENCODE(tp, stmp) \ #define ZFS_TIME_ENCODE(tp, stmp) \
{ \ { \
(stmp)[0] = (uint64_t)(tp)->tv_sec; \ (stmp)[0] = (uint64_t)(tp)->tv_sec; \
(stmp)[1] = (uint64_t)(tp)->tv_nsec; \ (stmp)[1] = (uint64_t)(tp)->tv_nsec; \
} }
/* Decode ZFS stored time values to a struct timespec */
#define ZFS_TIME_DECODE(tp, stmp) \ #define ZFS_TIME_DECODE(tp, stmp) \
{ \ { \
(tp)->tv_sec = (time_t)(stmp)[0]; \ (tp)->tv_sec = (time_t)(stmp)[0]; \

View File

@ -242,6 +242,12 @@ typedef struct {
* information needed for replaying the create. If the * information needed for replaying the create. If the
* file doesn't have any actual ACEs then the lr_aclcnt * file doesn't have any actual ACEs then the lr_aclcnt
* would be zero. * would be zero.
*
* After lr_acl_flags, there are a lr_acl_bytes number of variable sized ace's.
* If create is also setting xvattr's, then acl data follows xvattr.
* If ACE FUIDs are needed then they will follow the xvattr_t. Following
* the FUIDs will be the domain table information. The FUIDs for the owner
* and group will be in lr_create. Name follows ACL data.
*/ */
typedef struct { typedef struct {
lr_create_t lr_create; /* common create portion */ lr_create_t lr_create; /* common create portion */
@ -250,13 +256,6 @@ typedef struct {
uint64_t lr_fuidcnt; /* number of real fuids */ uint64_t lr_fuidcnt; /* number of real fuids */
uint64_t lr_acl_bytes; /* number of bytes in ACL */ uint64_t lr_acl_bytes; /* number of bytes in ACL */
uint64_t lr_acl_flags; /* ACL flags */ uint64_t lr_acl_flags; /* ACL flags */
/* lr_acl_bytes number of variable sized ace's follows */
/* if create is also setting xvattr's, then acl data follows xvattr */
/* if ACE FUIDs are needed then they will follow the xvattr_t */
/* Following the FUIDs will be the domain table information. */
/* The FUIDs for the owner and group will be in the lr_create */
/* portion of the record. */
/* name follows ACL data */
} lr_acl_create_t; } lr_acl_create_t;
typedef struct { typedef struct {

View File

@ -36,11 +36,10 @@
extern "C" { extern "C" {
#endif #endif
/* /* Common signature for all zio compress functions. */
* Common signature for all zio compress/decompress functions.
*/
typedef size_t zio_compress_func_t(void *src, void *dst, typedef size_t zio_compress_func_t(void *src, void *dst,
size_t s_len, size_t d_len, int); size_t s_len, size_t d_len, int);
/* Common signature for all zio decompress functions. */
typedef int zio_decompress_func_t(void *src, void *dst, typedef int zio_decompress_func_t(void *src, void *dst,
size_t s_len, size_t d_len, int); size_t s_len, size_t d_len, int);

View File

@ -570,8 +570,8 @@ txg_quiesce_thread(void *arg)
/* /*
* Delay this thread by 'ticks' if we are still in the open transaction * Delay this thread by 'ticks' if we are still in the open transaction
* group and there is already a waiting txg quiesing or quiesced. Abort * group and there is already a waiting txg quiescing or quiesced.
* the delay if this txg stalls or enters the quiesing state. * Abort the delay if this txg stalls or enters the quiescing state.
*/ */
void void
txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks) txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks)
@ -579,7 +579,7 @@ txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks)
tx_state_t *tx = &dp->dp_tx; tx_state_t *tx = &dp->dp_tx;
clock_t timeout = ddi_get_lbolt() + ticks; clock_t timeout = ddi_get_lbolt() + ticks;
/* don't delay if this txg could transition to quiesing immediately */ /* don't delay if this txg could transition to quiescing immediately */
if (tx->tx_open_txg > txg || if (tx->tx_open_txg > txg ||
tx->tx_syncing_txg == txg-1 || tx->tx_synced_txg == txg-1) tx->tx_syncing_txg == txg-1 || tx->tx_synced_txg == txg-1)
return; return;

View File

@ -963,9 +963,11 @@ vdev_probe_done(zio_t *zio)
} }
/* /*
* Determine whether this device is accessible by reading and writing * Determine whether this device is accessible.
* to several known locations: the pad regions of each vdev label *
* but the first (which we leave alone in case it contains a VTOC). * Read and write to several known locations: the pad regions of each
* vdev label but the first, which we leave alone in case it contains
* a VTOC.
*/ */
zio_t * zio_t *
vdev_probe(vdev_t *vd, zio_t *zio) vdev_probe(vdev_t *vd, zio_t *zio)
@ -2190,10 +2192,12 @@ vdev_degrade(spa_t *spa, uint64_t guid, vdev_aux_t aux)
} }
/* /*
* Online the given vdev. If 'unspare' is set, it implies two things. First, * Online the given vdev.
* any attached spare device should be detached when the device finishes *
* resilvering. Second, the online should be treated like a 'test' online case, * If 'ZFS_ONLINE_UNSPARE' is set, it implies two things. First, any attached
* so no FMA events are generated if the device fails to open. * spare device should be detached when the device finishes resilvering.
* Second, the online should be treated like a 'test' online case, so no FMA
* events are generated if the device fails to open.
*/ */
int int
vdev_online(spa_t *spa, uint64_t guid, uint64_t flags, vdev_state_t *newstate) vdev_online(spa_t *spa, uint64_t guid, uint64_t flags, vdev_state_t *newstate)

View File

@ -35,13 +35,14 @@
/* /*
* These tunables are for performance analysis. * These tunables are for performance analysis.
*/ */
/*
* zfs_vdev_max_pending is the maximum number of i/os concurrently /* The maximum number of I/Os concurrently pending to each device. */
* pending to each device. zfs_vdev_min_pending is the initial number
* of i/os pending to each device (before it starts ramping up to
* max_pending).
*/
int zfs_vdev_max_pending = 10; int zfs_vdev_max_pending = 10;
/*
* The initial number of I/Os pending to each device, before it starts ramping
* up to zfs_vdev_max_pending.
*/
int zfs_vdev_min_pending = 4; int zfs_vdev_min_pending = 4;
/* /*

View File

@ -60,6 +60,7 @@
* o addition (+) is represented by a bitwise XOR * o addition (+) is represented by a bitwise XOR
* o subtraction (-) is therefore identical to addition: A + B = A - B * o subtraction (-) is therefore identical to addition: A + B = A - B
* o multiplication of A by 2 is defined by the following bitwise expression: * o multiplication of A by 2 is defined by the following bitwise expression:
*
* (A * 2)_7 = A_6 * (A * 2)_7 = A_6
* (A * 2)_6 = A_5 * (A * 2)_6 = A_5
* (A * 2)_5 = A_4 * (A * 2)_5 = A_4
@ -118,7 +119,7 @@ typedef struct raidz_map {
uint64_t rm_missingparity; /* Count of missing parity devices */ uint64_t rm_missingparity; /* Count of missing parity devices */
uint64_t rm_firstdatacol; /* First data column/parity count */ uint64_t rm_firstdatacol; /* First data column/parity count */
uint64_t rm_nskip; /* Skipped sectors for padding */ uint64_t rm_nskip; /* Skipped sectors for padding */
uint64_t rm_skipstart; /* Column index of padding start */ uint64_t rm_skipstart; /* Column index of padding start */
void *rm_datacopy; /* rm_asize-buffer of copied data */ void *rm_datacopy; /* rm_asize-buffer of copied data */
uintptr_t rm_reports; /* # of referencing checksum reports */ uintptr_t rm_reports; /* # of referencing checksum reports */
uint8_t rm_freed; /* map no longer has referencing ZIO */ uint8_t rm_freed; /* map no longer has referencing ZIO */
@ -158,10 +159,7 @@ typedef struct raidz_map {
*/ */
int vdev_raidz_default_to_general; int vdev_raidz_default_to_general;
/* /* Powers of 2 in the Galois field defined above. */
* These two tables represent powers and logs of 2 in the Galois field defined
* above. These values were computed by repeatedly multiplying by 2 as above.
*/
static const uint8_t vdev_raidz_pow2[256] = { static const uint8_t vdev_raidz_pow2[256] = {
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26,
@ -196,6 +194,7 @@ static const uint8_t vdev_raidz_pow2[256] = {
0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83,
0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x01 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x01
}; };
/* Logs of 2 in the Galois field defined above. */
static const uint8_t vdev_raidz_log2[256] = { static const uint8_t vdev_raidz_log2[256] = {
0x00, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x00, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6,
0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b,

View File

@ -1359,7 +1359,8 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mode, boolean_t trim, zfs_acl_t *aclp)
zacep = (void *)((uintptr_t)zacep + abstract_size); zacep = (void *)((uintptr_t)zacep + abstract_size);
new_count++; new_count++;
new_bytes += abstract_size; new_bytes += abstract_size;
} if (masks.deny1) { }
if (masks.deny1) {
zfs_set_ace(aclp, zacep, masks.deny1, DENY, -1, ACE_OWNER); zfs_set_ace(aclp, zacep, masks.deny1, DENY, -1, ACE_OWNER);
zacep = (void *)((uintptr_t)zacep + abstract_size); zacep = (void *)((uintptr_t)zacep + abstract_size);
new_count++; new_count++;
@ -1767,7 +1768,7 @@ zfs_acl_ids_overquota(zfsvfs_t *zfsvfs, zfs_acl_ids_t *acl_ids)
} }
/* /*
* Retrieve a files ACL * Retrieve a file's ACL
*/ */
int int
zfs_getacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr) zfs_getacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr)
@ -1922,7 +1923,7 @@ zfs_vsec_2_aclp(zfsvfs_t *zfsvfs, vtype_t obj_type,
} }
/* /*
* Set a files ACL * Set a file's ACL
*/ */
int int
zfs_setacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr) zfs_setacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr)
@ -2355,6 +2356,7 @@ zfs_fastaccesschk_execute(znode_t *zdp, cred_t *cr)
/* /*
* Determine whether Access should be granted/denied. * Determine whether Access should be granted/denied.
*
* The least priv subsytem is always consulted as a basic privilege * The least priv subsytem is always consulted as a basic privilege
* can define any form of access. * can define any form of access.
*/ */
@ -2560,7 +2562,6 @@ zfs_delete_final_check(znode_t *zp, znode_t *dzp,
* Determine whether Access should be granted/deny, without * Determine whether Access should be granted/deny, without
* consulting least priv subsystem. * consulting least priv subsystem.
* *
*
* The following chart is the recommended NFSv4 enforcement for * The following chart is the recommended NFSv4 enforcement for
* ability to delete an object. * ability to delete an object.
* *

View File

@ -1234,6 +1234,7 @@ zfsctl_shares_readdir(ap)
/* /*
* pvp is the '.zfs' directory (zfsctl_node_t). * pvp is the '.zfs' directory (zfsctl_node_t).
*
* Creates vp, which is '.zfs/snapshot' (zfsctl_snapdir_t). * Creates vp, which is '.zfs/snapshot' (zfsctl_snapdir_t).
* *
* This function is the callback to create a GFS vnode for '.zfs/snapshot' * This function is the callback to create a GFS vnode for '.zfs/snapshot'

View File

@ -335,9 +335,7 @@ zfs_is_bootfs(const char *name)
} }
/* /*
* zfs_earlier_version * Return non-zero if the spa version is less than requested version.
*
* Return non-zero if the spa version is less than requested version.
*/ */
static int static int
zfs_earlier_version(const char *name, int version) zfs_earlier_version(const char *name, int version)
@ -355,8 +353,6 @@ zfs_earlier_version(const char *name, int version)
} }
/* /*
* zpl_earlier_version
*
* Return TRUE if the ZPL version is less than requested version. * Return TRUE if the ZPL version is less than requested version.
*/ */
static boolean_t static boolean_t
@ -3000,10 +2996,10 @@ zfs_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx)
/* /*
* inputs: * inputs:
* createprops list of properties requested by creator
* default_zplver zpl version to use if unspecified in createprops
* fuids_ok fuids allowed in this version of the spa?
* os parent objset pointer (NULL if root fs) * os parent objset pointer (NULL if root fs)
* fuids_ok fuids allowed in this version of the spa?
* sa_ok SAs allowed in this version of the spa?
* createprops list of properties requested by creator
* *
* outputs: * outputs:
* zplprops values for the zplprops we attach to the master node object * zplprops values for the zplprops we attach to the master node object

View File

@ -216,9 +216,8 @@ zfs_log_fuid_domains(zfs_fuid_info_t *fuidp, void *start)
} }
/* /*
* zfs_log_create() is used to handle TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, * Handles TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, TX_MKDIR_ATTR and
* TX_MKDIR_ATTR and TX_MKXATTR * TK_MKXATTR transactions.
* transactions.
* *
* TX_CREATE and TX_MKDIR are standard creates, but they may have FUID * TX_CREATE and TX_MKDIR are standard creates, but they may have FUID
* domain information appended prior to the name. In this case the * domain information appended prior to the name. In this case the
@ -345,7 +344,7 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
} }
/* /*
* zfs_log_remove() handles both TX_REMOVE and TX_RMDIR transactions. * Handles both TX_REMOVE and TX_RMDIR transactions.
*/ */
void void
zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
@ -369,7 +368,7 @@ zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
} }
/* /*
* zfs_log_link() handles TX_LINK transactions. * Handles TX_LINK transactions.
*/ */
void void
zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
@ -392,7 +391,7 @@ zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
} }
/* /*
* zfs_log_symlink() handles TX_SYMLINK transactions. * Handles TX_SYMLINK transactions.
*/ */
void void
zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
@ -424,7 +423,7 @@ zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
} }
/* /*
* zfs_log_rename() handles TX_RENAME transactions. * Handles TX_RENAME transactions.
*/ */
void void
zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
@ -450,7 +449,7 @@ zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
} }
/* /*
* zfs_log_write() handles TX_WRITE transactions. * Handles TX_WRITE transactions.
*/ */
ssize_t zfs_immediate_write_sz = 32768; ssize_t zfs_immediate_write_sz = 32768;
@ -529,7 +528,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype,
} }
/* /*
* zfs_log_truncate() handles TX_TRUNCATE transactions. * Handles TX_TRUNCATE transactions.
*/ */
void void
zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype, zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype,
@ -552,7 +551,7 @@ zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype,
} }
/* /*
* zfs_log_setattr() handles TX_SETATTR transactions. * Handles TX_SETATTR transactions.
*/ */
void void
zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype, zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype,
@ -614,7 +613,7 @@ zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype,
} }
/* /*
* zfs_log_acl() handles TX_ACL transactions. * Handles TX_ACL transactions.
*/ */
void void
zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp, zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp,

View File

@ -28,7 +28,7 @@
/* /*
* This file contains the code to implement file range locking in * This file contains the code to implement file range locking in
* ZFS, although there isn't much specific to ZFS (all that comes to mind * ZFS, although there isn't much specific to ZFS (all that comes to mind is
* support for growing the blocksize). * support for growing the blocksize).
* *
* Interface * Interface

View File

@ -187,7 +187,7 @@ zfs_sa_set_scanstamp(znode_t *zp, xvattr_t *xvap, dmu_tx_t *tx)
/* /*
* I'm not convinced we should do any of this upgrade. * I'm not convinced we should do any of this upgrade.
* since the SA code can read both old/new znode formats * since the SA code can read both old/new znode formats
* with probably little to know performance difference. * with probably little to no performance difference.
* *
* All new files will be created with the new format. * All new files will be created with the new format.
*/ */

View File

@ -1340,13 +1340,12 @@ zfs_parse_bootfs(char *bpath, char *outpath)
} }
/* /*
* zfs_check_global_label: * Check that the hex label string is appropriate for the dataset being
* Check that the hex label string is appropriate for the dataset * mounted into the global_zone proper.
* being mounted into the global_zone proper.
* *
* Return an error if the hex label string is not default or * Return an error if the hex label string is not default or
* admin_low/admin_high. For admin_low labels, the corresponding * admin_low/admin_high. For admin_low labels, the corresponding
* dataset must be readonly. * dataset must be readonly.
*/ */
int int
zfs_check_global_label(const char *dsname, const char *hexsl) zfs_check_global_label(const char *dsname, const char *hexsl)
@ -1368,15 +1367,12 @@ zfs_check_global_label(const char *dsname, const char *hexsl)
} }
/* /*
* zfs_mount_label_policy: * Determine whether the mount is allowed according to MAC check.
* Determine whether the mount is allowed according to MAC check. * by comparing (where appropriate) label of the dataset against
* by comparing (where appropriate) label of the dataset against * the label of the zone being mounted into. If the dataset has
* the label of the zone being mounted into. If the dataset has * no label, create one.
* no label, create one.
* *
* Returns: * Returns 0 if access allowed, error otherwise (e.g. EACCES)
* 0 : access allowed
* >0 : error code, such as EACCES
*/ */
static int static int
zfs_mount_label_policy(vfs_t *vfsp, char *osname) zfs_mount_label_policy(vfs_t *vfsp, char *osname)

View File

@ -87,11 +87,11 @@
* The ordering of events is important to avoid deadlocks and references * The ordering of events is important to avoid deadlocks and references
* to freed memory. The example below illustrates the following Big Rules: * to freed memory. The example below illustrates the following Big Rules:
* *
* (1) A check must be made in each zfs thread for a mounted file system. * (1) A check must be made in each zfs thread for a mounted file system.
* This is done avoiding races using ZFS_ENTER(zfsvfs). * This is done avoiding races using ZFS_ENTER(zfsvfs).
* A ZFS_EXIT(zfsvfs) is needed before all returns. Any znodes * A ZFS_EXIT(zfsvfs) is needed before all returns. Any znodes
* must be checked with ZFS_VERIFY_ZP(zp). Both of these macros * must be checked with ZFS_VERIFY_ZP(zp). Both of these macros
* can return EIO from the calling function. * can return EIO from the calling function.
* *
* (2) VN_RELE() should always be the last thing except for zil_commit() * (2) VN_RELE() should always be the last thing except for zil_commit()
* (if necessary) and ZFS_EXIT(). This is for 3 reasons: * (if necessary) and ZFS_EXIT(). This is for 3 reasons:
@ -123,7 +123,7 @@
* (5) If the operation succeeded, generate the intent log entry for it * (5) If the operation succeeded, generate the intent log entry for it
* before dropping locks. This ensures that the ordering of events * before dropping locks. This ensures that the ordering of events
* in the intent log matches the order in which they actually occurred. * in the intent log matches the order in which they actually occurred.
* During ZIL replay the zfs_log_* functions will update the sequence * During ZIL replay the zfs_log_* functions will update the sequence
* number to indicate the zil transaction has replayed. * number to indicate the zil transaction has replayed.
* *
* (6) At the end of each vnode op, the DMU tx must always commit, * (6) At the end of each vnode op, the DMU tx must always commit,
@ -568,7 +568,7 @@ mappedread_sf(vnode_t *vp, int nbytes, uio_t *uio)
* else we default from the dmu buffer. * else we default from the dmu buffer.
* *
* NOTE: We will always "break up" the IO into PAGESIZE uiomoves when * NOTE: We will always "break up" the IO into PAGESIZE uiomoves when
* the file is memory mapped. * the file is memory mapped.
*/ */
static int static int
mappedread(vnode_t *vp, int nbytes, uio_t *uio) mappedread(vnode_t *vp, int nbytes, uio_t *uio)
@ -631,8 +631,7 @@ offset_t zfs_read_chunk_size = 1024 * 1024; /* Tunable */
* *
* OUT: uio - updated offset and range, buffer filled. * OUT: uio - updated offset and range, buffer filled.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Side Effects: * Side Effects:
* vp - atime updated if byte count > 0 * vp - atime updated if byte count > 0
@ -776,14 +775,14 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr, caller_context_t *ct)
* IN: vp - vnode of file to be written to. * IN: vp - vnode of file to be written to.
* uio - structure supplying write location, range info, * uio - structure supplying write location, range info,
* and data buffer. * and data buffer.
* ioflag - FAPPEND flag set if in append mode. * ioflag - FAPPEND, FSYNC, and/or FDSYNC. FAPPEND is
* set if in append mode.
* cr - credentials of caller. * cr - credentials of caller.
* ct - caller context (NFS/CIFS fem monitor only) * ct - caller context (NFS/CIFS fem monitor only)
* *
* OUT: uio - updated offset and range. * OUT: uio - updated offset and range.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* vp - ctime|mtime updated if byte count > 0 * vp - ctime|mtime updated if byte count > 0
@ -1367,8 +1366,7 @@ specvp_check(vnode_t **vpp, cred_t *cr)
* *
* OUT: vpp - vnode of located entry, NULL if not found. * OUT: vpp - vnode of located entry, NULL if not found.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* NA * NA
@ -1565,8 +1563,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct componentname *cnp,
* *
* OUT: vpp - vnode of created or trunc'd entry. * OUT: vpp - vnode of created or trunc'd entry.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* dvp - ctime|mtime updated if new entry created * dvp - ctime|mtime updated if new entry created
@ -1816,8 +1813,7 @@ zfs_create(vnode_t *dvp, char *name, vattr_t *vap, int excl, int mode,
* ct - caller context * ct - caller context
* flags - case flags * flags - case flags
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* dvp - ctime|mtime * dvp - ctime|mtime
@ -2053,12 +2049,12 @@ zfs_remove(vnode_t *dvp, char *name, cred_t *cr, caller_context_t *ct,
* vap - attributes of new directory. * vap - attributes of new directory.
* cr - credentials of caller. * cr - credentials of caller.
* ct - caller context * ct - caller context
* flags - case flags
* vsecp - ACL to be set * vsecp - ACL to be set
* *
* OUT: vpp - vnode of created directory. * OUT: vpp - vnode of created directory.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* dvp - ctime|mtime updated * dvp - ctime|mtime updated
@ -2238,8 +2234,7 @@ zfs_mkdir(vnode_t *dvp, char *dirname, vattr_t *vap, vnode_t **vpp, cred_t *cr,
* ct - caller context * ct - caller context
* flags - case flags * flags - case flags
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* dvp - ctime|mtime updated * dvp - ctime|mtime updated
@ -2364,7 +2359,7 @@ zfs_rmdir(vnode_t *dvp, char *name, vnode_t *cwd, cred_t *cr,
/* /*
* Read as many directory entries as will fit into the provided * Read as many directory entries as will fit into the provided
* buffer from the given directory cursor position (specified in * buffer from the given directory cursor position (specified in
* the uio structure. * the uio structure).
* *
* IN: vp - vnode of directory to read. * IN: vp - vnode of directory to read.
* uio - structure supplying read location, range info, * uio - structure supplying read location, range info,
@ -2376,8 +2371,7 @@ zfs_rmdir(vnode_t *dvp, char *name, vnode_t *cwd, cred_t *cr,
* OUT: uio - updated offset and range, buffer filled. * OUT: uio - updated offset and range, buffer filled.
* eofp - set to true if end-of-file detected. * eofp - set to true if end-of-file detected.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* vp - atime updated * vp - atime updated
@ -2722,7 +2716,7 @@ zfs_fsync(vnode_t *vp, int syncflag, cred_t *cr, caller_context_t *ct)
* *
* OUT: vap - attribute values. * OUT: vap - attribute values.
* *
* RETURN: 0 (always succeeds) * RETURN: 0 (always succeeds).
*/ */
/* ARGSUSED */ /* ARGSUSED */
static int static int
@ -2943,8 +2937,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
* cr - credentials of caller. * cr - credentials of caller.
* ct - caller context * ct - caller context
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* vp - ctime updated, mtime updated if size changed. * vp - ctime updated, mtime updated if size changed.
@ -2952,7 +2945,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
/* ARGSUSED */ /* ARGSUSED */
static int static int
zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr, zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
caller_context_t *ct) caller_context_t *ct)
{ {
znode_t *zp = VTOZ(vp); znode_t *zp = VTOZ(vp);
zfsvfs_t *zfsvfs = zp->z_zfsvfs; zfsvfs_t *zfsvfs = zp->z_zfsvfs;
@ -3556,6 +3549,7 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
if (attrzp) if (attrzp)
VN_RELE(ZTOV(attrzp)); VN_RELE(ZTOV(attrzp));
if (aclp) if (aclp)
zfs_acl_free(aclp); zfs_acl_free(aclp);
@ -3690,8 +3684,7 @@ zfs_rename_lock(znode_t *szp, znode_t *tdzp, znode_t *sdzp, zfs_zlock_t **zlpp)
* ct - caller context * ct - caller context
* flags - case flags * flags - case flags
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* sdvp,tdvp - ctime|mtime updated * sdvp,tdvp - ctime|mtime updated
@ -4053,13 +4046,11 @@ zfs_rename(vnode_t *sdvp, char *snm, vnode_t *tdvp, char *tnm, cred_t *cr,
* IN: dvp - Directory to contain new symbolic link. * IN: dvp - Directory to contain new symbolic link.
* link - Name for new symlink entry. * link - Name for new symlink entry.
* vap - Attributes of new entry. * vap - Attributes of new entry.
* target - Target path of new symlink.
* cr - credentials of caller. * cr - credentials of caller.
* ct - caller context * ct - caller context
* flags - case flags * flags - case flags
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* dvp - ctime|mtime updated * dvp - ctime|mtime updated
@ -4205,14 +4196,13 @@ zfs_symlink(vnode_t *dvp, vnode_t **vpp, char *name, vattr_t *vap, char *link,
* the symbolic path referred to by vp. * the symbolic path referred to by vp.
* *
* IN: vp - vnode of symbolic link. * IN: vp - vnode of symbolic link.
* uoip - structure to contain the link path. * uio - structure to contain the link path.
* cr - credentials of caller. * cr - credentials of caller.
* ct - caller context * ct - caller context
* *
* OUT: uio - structure to contain the link path. * OUT: uio - structure containing the link path.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* vp - atime updated * vp - atime updated
@ -4251,8 +4241,7 @@ zfs_readlink(vnode_t *vp, uio_t *uio, cred_t *cr, caller_context_t *ct)
* cr - credentials of caller. * cr - credentials of caller.
* ct - caller context * ct - caller context
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* tdvp - ctime|mtime updated * tdvp - ctime|mtime updated
@ -4421,8 +4410,7 @@ zfs_null_putapage(vnode_t *vp, page_t *pp, u_offset_t *offp,
* OUT: offp - start of range pushed. * OUT: offp - start of range pushed.
* lenp - len of range pushed. * lenp - len of range pushed.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* NOTE: callers must have locked the page to be pushed. On * NOTE: callers must have locked the page to be pushed. On
* exit, the page (and all other pages in the kluster) must be * exit, the page (and all other pages in the kluster) must be
@ -4544,8 +4532,7 @@ zfs_putapage(vnode_t *vp, page_t *pp, u_offset_t *offp,
* cr - credentials of caller. * cr - credentials of caller.
* ct - caller context. * ct - caller context.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* vp - ctime|mtime updated * vp - ctime|mtime updated
@ -4694,8 +4681,7 @@ zfs_inactive(vnode_t *vp, cred_t *cr, caller_context_t *ct)
* noffp - pointer to new file offset * noffp - pointer to new file offset
* ct - caller context * ct - caller context
* *
* RETURN: 0 if success * RETURN: 0 on success, EINVAL if new offset invalid.
* EINVAL if new offset invalid
*/ */
/* ARGSUSED */ /* ARGSUSED */
static int static int
@ -4831,8 +4817,7 @@ zfs_fillpage(vnode_t *vp, u_offset_t off, struct seg *seg,
* OUT: protp - protection mode of created pages. * OUT: protp - protection mode of created pages.
* pl - list of pages created. * pl - list of pages created.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* vp - atime updated * vp - atime updated
@ -4840,8 +4825,8 @@ zfs_fillpage(vnode_t *vp, u_offset_t off, struct seg *seg,
/* ARGSUSED */ /* ARGSUSED */
static int static int
zfs_getpage(vnode_t *vp, offset_t off, size_t len, uint_t *protp, zfs_getpage(vnode_t *vp, offset_t off, size_t len, uint_t *protp,
page_t *pl[], size_t plsz, struct seg *seg, caddr_t addr, page_t *pl[], size_t plsz, struct seg *seg, caddr_t addr,
enum seg_rw rw, cred_t *cr, caller_context_t *ct) enum seg_rw rw, cred_t *cr, caller_context_t *ct)
{ {
znode_t *zp = VTOZ(vp); znode_t *zp = VTOZ(vp);
zfsvfs_t *zfsvfs = zp->z_zfsvfs; zfsvfs_t *zfsvfs = zp->z_zfsvfs;
@ -4916,15 +4901,11 @@ zfs_getpage(vnode_t *vp, offset_t off, size_t len, uint_t *protp,
* Request a memory map for a section of a file. This code interacts * Request a memory map for a section of a file. This code interacts
* with common code and the VM system as follows: * with common code and the VM system as follows:
* *
* common code calls mmap(), which ends up in smmap_common() * - common code calls mmap(), which ends up in smmap_common()
* * - this calls VOP_MAP(), which takes you into (say) zfs
* this calls VOP_MAP(), which takes you into (say) zfs * - zfs_map() calls as_map(), passing segvn_create() as the callback
* * - segvn_create() creates the new segment and calls VOP_ADDMAP()
* zfs_map() calls as_map(), passing segvn_create() as the callback * - zfs_addmap() updates z_mapcnt
*
* segvn_create() creates the new segment and calls VOP_ADDMAP()
*
* zfs_addmap() updates z_mapcnt
*/ */
/*ARGSUSED*/ /*ARGSUSED*/
static int static int
@ -5066,8 +5047,7 @@ zfs_delmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr,
* cr - credentials of caller [UNUSED]. * cr - credentials of caller [UNUSED].
* ct - caller context. * ct - caller context.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure.
* error code if failure
* *
* Timestamps: * Timestamps:
* vp - ctime|mtime updated * vp - ctime|mtime updated
@ -5304,13 +5284,14 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int flag, cred_t *cr,
#ifdef sun #ifdef sun
/* /*
* Tunable, both must be a power of 2. * The smallest read we may consider to loan out an arcbuf.
* * This must be a power of 2.
* zcr_blksz_min: the smallest read we may consider to loan out an arcbuf
* zcr_blksz_max: if set to less than the file block size, allow loaning out of
* an arcbuf for a partial block read
*/ */
int zcr_blksz_min = (1 << 10); /* 1K */ int zcr_blksz_min = (1 << 10); /* 1K */
/*
* If set to less than the file block size, allow loaning out of an
* arcbuf for a partial block read. This must be a power of 2.
*/
int zcr_blksz_max = (1 << 17); /* 128K */ int zcr_blksz_max = (1 << 17); /* 128K */
/*ARGSUSED*/ /*ARGSUSED*/
@ -5584,10 +5565,12 @@ const fs_operation_def_t zfs_sharevnodeops_template[] = {
/* /*
* Extended attribute directory vnode operations template * Extended attribute directory vnode operations template
* This template is identical to the directory vnodes *
* operation template except for restricted operations: * This template is identical to the directory vnodes
* VOP_MKDIR() * operation template except for restricted operations:
* VOP_SYMLINK() * VOP_MKDIR()
* VOP_SYMLINK()
*
* Note that there are other restrictions embedded in: * Note that there are other restrictions embedded in:
* zfs_create() - restrict type to VREG * zfs_create() - restrict type to VREG
* zfs_link() - no links into/out of attribute space * zfs_link() - no links into/out of attribute space

View File

@ -1046,9 +1046,8 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr,
} }
/* /*
* zfs_xvattr_set only updates the in-core attributes * Update in-core attributes. It is assumed the caller will be doing an
* it is assumed the caller will be doing an sa_bulk_update * sa_bulk_update to push the changes out.
* to push the changes out
*/ */
void void
zfs_xvattr_set(znode_t *zp, xvattr_t *xvap, dmu_tx_t *tx) zfs_xvattr_set(znode_t *zp, xvattr_t *xvap, dmu_tx_t *tx)
@ -1537,8 +1536,7 @@ zfs_no_putpage(vnode_t *vp, page_t *pp, u_offset_t *offp, size_t *lenp,
* IN: zp - znode of file to free data in. * IN: zp - znode of file to free data in.
* end - new end-of-file * end - new end-of-file
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure
* error code if failure
*/ */
static int static int
zfs_extend(znode_t *zp, uint64_t end) zfs_extend(znode_t *zp, uint64_t end)
@ -1617,8 +1615,7 @@ zfs_extend(znode_t *zp, uint64_t end)
* off - start of section to free. * off - start of section to free.
* len - length of section to free. * len - length of section to free.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure
* error code if failure
*/ */
static int static int
zfs_free_range(znode_t *zp, uint64_t off, uint64_t len) zfs_free_range(znode_t *zp, uint64_t off, uint64_t len)
@ -1665,8 +1662,7 @@ zfs_free_range(znode_t *zp, uint64_t off, uint64_t len)
* IN: zp - znode of file to free data in. * IN: zp - znode of file to free data in.
* end - new end-of-file. * end - new end-of-file.
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure
* error code if failure
*/ */
static int static int
zfs_trunc(znode_t *zp, uint64_t end) zfs_trunc(znode_t *zp, uint64_t end)
@ -1748,8 +1744,7 @@ zfs_trunc(znode_t *zp, uint64_t end)
* flag - current file open mode flags. * flag - current file open mode flags.
* log - TRUE if this action should be logged * log - TRUE if this action should be logged
* *
* RETURN: 0 if success * RETURN: 0 on success, error code on failure
* error code if failure
*/ */
int int
zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log) zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)

View File

@ -66,9 +66,9 @@
*/ */
/* /*
* This global ZIL switch affects all pools * Disable intent logging replay. This global ZIL switch affects all pools.
*/ */
int zil_replay_disable = 0; /* disable intent logging replay */ int zil_replay_disable = 0;
SYSCTL_DECL(_vfs_zfs); SYSCTL_DECL(_vfs_zfs);
TUNABLE_INT("vfs.zfs.zil_replay_disable", &zil_replay_disable); TUNABLE_INT("vfs.zfs.zil_replay_disable", &zil_replay_disable);
SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_replay_disable, CTLFLAG_RW, SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_replay_disable, CTLFLAG_RW,
@ -891,6 +891,7 @@ zil_lwb_write_init(zilog_t *zilog, lwb_t *lwb)
/* /*
* Define a limited set of intent log block sizes. * Define a limited set of intent log block sizes.
*
* These must be a multiple of 4KB. Note only the amount used (again * These must be a multiple of 4KB. Note only the amount used (again
* aligned to 4KB) actually gets written. However, we can't always just * aligned to 4KB) actually gets written. However, we can't always just
* allocate SPA_MAXBLOCKSIZE as the slog space could be exhausted. * allocate SPA_MAXBLOCKSIZE as the slog space could be exhausted.

View File

@ -1256,13 +1256,16 @@ zio_interrupt(zio_t *zio)
/* /*
* Execute the I/O pipeline until one of the following occurs: * Execute the I/O pipeline until one of the following occurs:
* (1) the I/O completes; (2) the pipeline stalls waiting for *
* dependent child I/Os; (3) the I/O issues, so we're waiting * (1) the I/O completes
* for an I/O completion interrupt; (4) the I/O is delegated by * (2) the pipeline stalls waiting for dependent child I/Os
* vdev-level caching or aggregation; (5) the I/O is deferred * (3) the I/O issues, so we're waiting for an I/O completion interrupt
* due to vdev-level queueing; (6) the I/O is handed off to * (4) the I/O is delegated by vdev-level caching or aggregation
* another thread. In all cases, the pipeline stops whenever * (5) the I/O is deferred due to vdev-level queueing
* there's no CPU work; it never burns a thread in cv_wait(). * (6) the I/O is handed off to another thread.
*
* In all cases, the pipeline stops whenever there's no CPU work; it never
* burns a thread in cv_wait().
* *
* There's no locking on io_stage because there's no legitimate way * There's no locking on io_stage because there's no legitimate way
* for multiple threads to be attempting to process the same I/O. * for multiple threads to be attempting to process the same I/O.