usr/src/uts/common/fs/zfs/zfs_log.c
author ahrens
Mon, 22 Jan 2007 13:21:07 -0800
changeset 3461 c19b22f347d6
parent 3063 b252896b372b
child 3638 6b28ebc717aa
permissions -rw-r--r--
6514331 in-memory delete queue is not needed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     1
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     2
 * CDDL HEADER START
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     3
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
1669
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
     5
 * Common Development and Distribution License (the "License").
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
     6
 * You may not use this file except in compliance with the License.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     7
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    11
 * and limitations under the License.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    12
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    18
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    19
 * CDDL HEADER END
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    20
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    21
/*
3461
c19b22f347d6 6514331 in-memory delete queue is not needed
ahrens
parents: 3063
diff changeset
    22
 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    23
 * Use is subject to license terms.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    24
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    25
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    26
#pragma ident	"%Z%%M%	%I%	%E% SMI"
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    27
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    28
#include <sys/types.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    29
#include <sys/param.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    30
#include <sys/systm.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    31
#include <sys/sysmacros.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    32
#include <sys/cmn_err.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    33
#include <sys/kmem.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    34
#include <sys/thread.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    35
#include <sys/file.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    36
#include <sys/vfs.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    37
#include <sys/zfs_znode.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    38
#include <sys/zfs_dir.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    39
#include <sys/zil.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    40
#include <sys/byteorder.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    41
#include <sys/policy.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    42
#include <sys/stat.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    43
#include <sys/mode.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    44
#include <sys/acl.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    45
#include <sys/dmu.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    46
#include <sys/spa.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    47
#include <sys/ddi.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    48
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    49
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    50
 * All the functions in this file are used to construct the log entries
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    51
 * to record transactions. They allocate * a intent log transaction
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    52
 * structure (itx_t) and save within it all the information necessary to
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    53
 * possibly replay the transaction. The itx is then assigned a sequence
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    54
 * number and inserted in the in-memory list anchored in the zilog.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    55
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    56
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    57
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    58
 * zfs_log_create() is used to handle TX_CREATE, TX_MKDIR and TX_MKXATTR
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    59
 * transactions.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    60
 */
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
    61
void
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    62
zfs_log_create(zilog_t *zilog, dmu_tx_t *tx, int txtype,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    63
	znode_t *dzp, znode_t *zp, char *name)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    64
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    65
	itx_t *itx;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    66
	uint64_t seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    67
	lr_create_t *lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    68
	size_t namesize = strlen(name) + 1;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    69
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    70
	if (zilog == NULL)
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
    71
		return;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    72
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    73
	itx = zil_itx_create(txtype, sizeof (*lr) + namesize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    74
	lr = (lr_create_t *)&itx->itx_lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    75
	lr->lr_doid = dzp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    76
	lr->lr_foid = zp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    77
	lr->lr_mode = zp->z_phys->zp_mode;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    78
	lr->lr_uid = zp->z_phys->zp_uid;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    79
	lr->lr_gid = zp->z_phys->zp_gid;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    80
	lr->lr_gen = zp->z_phys->zp_gen;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    81
	lr->lr_crtime[0] = zp->z_phys->zp_crtime[0];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    82
	lr->lr_crtime[1] = zp->z_phys->zp_crtime[1];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    83
	lr->lr_rdev = zp->z_phys->zp_rdev;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    84
	bcopy(name, (char *)(lr + 1), namesize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    85
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    86
	seq = zil_itx_assign(zilog, itx, tx);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    87
	dzp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    88
	zp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    89
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    90
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    91
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    92
 * zfs_log_remove() handles both TX_REMOVE and TX_RMDIR transactions.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    93
 */
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
    94
void
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    95
zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, int txtype,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    96
	znode_t *dzp, char *name)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    97
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    98
	itx_t *itx;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    99
	uint64_t seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   100
	lr_remove_t *lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   101
	size_t namesize = strlen(name) + 1;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   102
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   103
	if (zilog == NULL)
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   104
		return;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   105
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   106
	itx = zil_itx_create(txtype, sizeof (*lr) + namesize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   107
	lr = (lr_remove_t *)&itx->itx_lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   108
	lr->lr_doid = dzp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   109
	bcopy(name, (char *)(lr + 1), namesize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   110
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   111
	seq = zil_itx_assign(zilog, itx, tx);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   112
	dzp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   113
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   114
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   115
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   116
 * zfs_log_link() handles TX_LINK transactions.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   117
 */
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   118
void
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   119
zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, int txtype,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   120
	znode_t *dzp, znode_t *zp, char *name)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   121
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   122
	itx_t *itx;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   123
	uint64_t seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   124
	lr_link_t *lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   125
	size_t namesize = strlen(name) + 1;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   126
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   127
	if (zilog == NULL)
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   128
		return;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   129
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   130
	itx = zil_itx_create(txtype, sizeof (*lr) + namesize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   131
	lr = (lr_link_t *)&itx->itx_lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   132
	lr->lr_doid = dzp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   133
	lr->lr_link_obj = zp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   134
	bcopy(name, (char *)(lr + 1), namesize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   135
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   136
	seq = zil_itx_assign(zilog, itx, tx);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   137
	dzp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   138
	zp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   139
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   140
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   141
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   142
 * zfs_log_symlink() handles TX_SYMLINK transactions.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   143
 */
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   144
void
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   145
zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, int txtype,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   146
	znode_t *dzp, znode_t *zp, char *name, char *link)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   147
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   148
	itx_t *itx;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   149
	uint64_t seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   150
	lr_create_t *lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   151
	size_t namesize = strlen(name) + 1;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   152
	size_t linksize = strlen(link) + 1;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   153
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   154
	if (zilog == NULL)
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   155
		return;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   156
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   157
	itx = zil_itx_create(txtype, sizeof (*lr) + namesize + linksize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   158
	lr = (lr_create_t *)&itx->itx_lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   159
	lr->lr_doid = dzp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   160
	lr->lr_foid = zp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   161
	lr->lr_mode = zp->z_phys->zp_mode;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   162
	lr->lr_uid = zp->z_phys->zp_uid;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   163
	lr->lr_gid = zp->z_phys->zp_gid;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   164
	lr->lr_gen = zp->z_phys->zp_gen;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   165
	lr->lr_crtime[0] = zp->z_phys->zp_crtime[0];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   166
	lr->lr_crtime[1] = zp->z_phys->zp_crtime[1];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   167
	bcopy(name, (char *)(lr + 1), namesize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   168
	bcopy(link, (char *)(lr + 1) + namesize, linksize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   169
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   170
	seq = zil_itx_assign(zilog, itx, tx);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   171
	dzp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   172
	zp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   173
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   174
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   175
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   176
 * zfs_log_rename() handles TX_RENAME transactions.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   177
 */
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   178
void
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   179
zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, int txtype,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   180
	znode_t *sdzp, char *sname, znode_t *tdzp, char *dname, znode_t *szp)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   181
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   182
	itx_t *itx;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   183
	uint64_t seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   184
	lr_rename_t *lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   185
	size_t snamesize = strlen(sname) + 1;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   186
	size_t dnamesize = strlen(dname) + 1;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   187
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   188
	if (zilog == NULL)
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   189
		return;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   190
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   191
	itx = zil_itx_create(txtype, sizeof (*lr) + snamesize + dnamesize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   192
	lr = (lr_rename_t *)&itx->itx_lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   193
	lr->lr_sdoid = sdzp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   194
	lr->lr_tdoid = tdzp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   195
	bcopy(sname, (char *)(lr + 1), snamesize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   196
	bcopy(dname, (char *)(lr + 1) + snamesize, dnamesize);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   197
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   198
	seq = zil_itx_assign(zilog, itx, tx);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   199
	sdzp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   200
	tdzp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   201
	szp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   202
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   203
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   204
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   205
 * zfs_log_write() handles TX_WRITE transactions.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   206
 */
2237
45affe88ed99 6416482 filebench oltp workload hangs in zfs
maybee
parents: 1669
diff changeset
   207
ssize_t zfs_immediate_write_sz = 32768;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   208
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   209
void
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   210
zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   211
	znode_t *zp, offset_t off, ssize_t len, int ioflag, uio_t *uio)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   212
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   213
	itx_t *itx;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   214
	uint64_t seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   215
	lr_write_t *lr;
1669
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   216
	itx_wr_state_t write_state;
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   217
	size_t dlen;
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   218
	int err;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   219
3461
c19b22f347d6 6514331 in-memory delete queue is not needed
ahrens
parents: 3063
diff changeset
   220
	if (zilog == NULL || zp->z_unlinked)
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   221
		return;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   222
1669
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   223
	/*
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   224
	 * Writes are handled in three different ways:
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   225
	 *
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   226
	 * WR_INDIRECT:
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   227
	 *    If the write is greater than zfs_immediate_write_sz then
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   228
	 *    later *if* we need to log the write then dmu_sync() is used
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   229
	 *    to immediately write the block and it's block pointer is put
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   230
	 *    in the log record.
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   231
	 * WR_COPIED:
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   232
	 *    If we know we'll immediately be committing the
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   233
	 *    transaction (FDSYNC (O_DSYNC)), the we allocate a larger
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   234
	 *    log record here for the data and copy the data in.
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   235
	 * WR_NEED_COPY:
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   236
	 *    Otherwise we don't allocate a buffer, and *if* we need to
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   237
	 *    flush the write later then a buffer is allocated and
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   238
	 *    we retrieve the data using the dmu.
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   239
	 */
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   240
	if (len > zfs_immediate_write_sz) {
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   241
		dlen = 0;
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   242
		write_state = WR_INDIRECT;
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   243
	} else if (ioflag & FDSYNC) {
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   244
		dlen = len;
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   245
		write_state = WR_COPIED;
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   246
	} else {
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   247
		dlen = 0;
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   248
		write_state = WR_NEED_COPY;
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   249
	}
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   250
	itx = zil_itx_create(txtype, sizeof (*lr) + dlen);
1669
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   251
	if (write_state == WR_COPIED) {
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   252
		err = xcopyin(uio->uio_iov->iov_base - len,
1669
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   253
		    (char *)itx + offsetof(itx_t, itx_lr) + sizeof (*lr), len);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   254
		/*
1669
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   255
		 * xcopyin shouldn't error as we've already successfully
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   256
		 * copied it to a dmu buffer. However if it does we'll get
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   257
		 * the data from the dmu later.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   258
		 */
1669
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   259
		if (err) {
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   260
			kmem_free(itx, offsetof(itx_t, itx_lr)
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   261
			    + itx->itx_lr.lrc_reclen);
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   262
			itx = zil_itx_create(txtype, sizeof (*lr));
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   263
			write_state = WR_NEED_COPY;
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   264
		}
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   265
	}
1669
3521dbbcb2e8 6343608 ZFS file range locking
perrin
parents: 789
diff changeset
   266
	itx->itx_wr_state = write_state;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   267
	lr = (lr_write_t *)&itx->itx_lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   268
	lr->lr_foid = zp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   269
	lr->lr_offset = off;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   270
	lr->lr_length = len;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   271
	lr->lr_blkoff = 0;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   272
	BP_ZERO(&lr->lr_blkptr);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   273
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   274
	itx->itx_private = zp->z_zfsvfs;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   275
3063
b252896b372b 6341569 zio_alloc_blk() vdev distribution performs badly
perrin
parents: 2638
diff changeset
   276
	itx->itx_sync = (zp->z_sync_cnt != 0);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   277
	seq = zil_itx_assign(zilog, itx, tx);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   278
	zp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   279
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   280
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   281
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   282
 * zfs_log_truncate() handles TX_TRUNCATE transactions.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   283
 */
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   284
void
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   285
zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   286
	znode_t *zp, uint64_t off, uint64_t len)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   287
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   288
	itx_t *itx;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   289
	uint64_t seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   290
	lr_truncate_t *lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   291
3461
c19b22f347d6 6514331 in-memory delete queue is not needed
ahrens
parents: 3063
diff changeset
   292
	if (zilog == NULL || zp->z_unlinked)
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   293
		return;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   294
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   295
	itx = zil_itx_create(txtype, sizeof (*lr));
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   296
	lr = (lr_truncate_t *)&itx->itx_lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   297
	lr->lr_foid = zp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   298
	lr->lr_offset = off;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   299
	lr->lr_length = len;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   300
3063
b252896b372b 6341569 zio_alloc_blk() vdev distribution performs badly
perrin
parents: 2638
diff changeset
   301
	itx->itx_sync = (zp->z_sync_cnt != 0);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   302
	seq = zil_itx_assign(zilog, itx, tx);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   303
	zp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   304
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   305
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   306
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   307
 * zfs_log_setattr() handles TX_SETATTR transactions.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   308
 */
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   309
void
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   310
zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   311
	znode_t *zp, vattr_t *vap, uint_t mask_applied)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   312
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   313
	itx_t *itx;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   314
	uint64_t seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   315
	lr_setattr_t *lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   316
3461
c19b22f347d6 6514331 in-memory delete queue is not needed
ahrens
parents: 3063
diff changeset
   317
	if (zilog == NULL || zp->z_unlinked)
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   318
		return;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   319
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   320
	itx = zil_itx_create(txtype, sizeof (*lr));
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   321
	lr = (lr_setattr_t *)&itx->itx_lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   322
	lr->lr_foid = zp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   323
	lr->lr_mask = (uint64_t)mask_applied;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   324
	lr->lr_mode = (uint64_t)vap->va_mode;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   325
	lr->lr_uid = (uint64_t)vap->va_uid;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   326
	lr->lr_gid = (uint64_t)vap->va_gid;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   327
	lr->lr_size = (uint64_t)vap->va_size;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   328
	ZFS_TIME_ENCODE(&vap->va_atime, lr->lr_atime);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   329
	ZFS_TIME_ENCODE(&vap->va_mtime, lr->lr_mtime);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   330
3063
b252896b372b 6341569 zio_alloc_blk() vdev distribution performs badly
perrin
parents: 2638
diff changeset
   331
	itx->itx_sync = (zp->z_sync_cnt != 0);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   332
	seq = zil_itx_assign(zilog, itx, tx);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   333
	zp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   334
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   335
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   336
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   337
 * zfs_log_acl() handles TX_ACL transactions.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   338
 */
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   339
void
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   340
zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, int txtype,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   341
	znode_t *zp, int aclcnt, ace_t *z_ace)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   342
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   343
	itx_t *itx;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   344
	uint64_t seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   345
	lr_acl_t *lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   346
3461
c19b22f347d6 6514331 in-memory delete queue is not needed
ahrens
parents: 3063
diff changeset
   347
	if (zilog == NULL || zp->z_unlinked)
2638
4f583dfeae92 6413510 zfs: writing to ZFS filesystem slows down fsync() on other files in the same FS
perrin
parents: 2237
diff changeset
   348
		return;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   349
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   350
	itx = zil_itx_create(txtype, sizeof (*lr) + aclcnt * sizeof (ace_t));
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   351
	lr = (lr_acl_t *)&itx->itx_lr;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   352
	lr->lr_foid = zp->z_id;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   353
	lr->lr_aclcnt = (uint64_t)aclcnt;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   354
	bcopy(z_ace, (ace_t *)(lr + 1), aclcnt * sizeof (ace_t));
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   355
3063
b252896b372b 6341569 zio_alloc_blk() vdev distribution performs badly
perrin
parents: 2638
diff changeset
   356
	itx->itx_sync = (zp->z_sync_cnt != 0);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   357
	seq = zil_itx_assign(zilog, itx, tx);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   358
	zp->z_last_itx = seq;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   359
}