krwlock_t z_name_lock; /* "master" lock for dirent locks */
zfs_dirlock_t *z_dirlocks; /* directory entry lock list */
rangelock_t z_rangelock; /* file range locks */
- uint8_t z_unlinked; /* file has been unlinked */
- uint8_t z_atime_dirty; /* atime needs to be synced */
- uint8_t z_zn_prefetch; /* Prefetch znodes? */
- uint8_t z_moved; /* Has this znode been moved? */
+ boolean_t z_unlinked; /* file has been unlinked */
+ boolean_t z_atime_dirty; /* atime needs to be synced */
+ boolean_t z_zn_prefetch; /* Prefetch znodes? */
+ boolean_t z_moved; /* Has this znode been moved? */
+ boolean_t z_is_sa; /* are we native sa? */
+ boolean_t z_is_mapped; /* are we mmap'ed */
+ boolean_t z_is_ctldir; /* are we .zfs entry */
+ boolean_t z_is_stale; /* are we stale due to rollback? */
uint_t z_blksz; /* block size in bytes */
uint_t z_seq; /* modification sequence number */
uint64_t z_mapcnt; /* number of pages mapped to file */
uint64_t z_projid; /* project ID */
list_node_t z_link_node; /* all znodes in fs link */
sa_handle_t *z_sa_hdl; /* handle to sa data */
- boolean_t z_is_sa; /* are we native sa? */
- boolean_t z_is_mapped; /* are we mmap'ed */
- boolean_t z_is_ctldir; /* are we .zfs entry */
- boolean_t z_is_stale; /* are we stale due to rollback? */
struct inode z_inode; /* generic vfs inode */
} znode_t;
ASSERT3P(zp->z_acl_cached, ==, NULL);
ASSERT3P(zp->z_xattr_cached, ==, NULL);
zp->z_id = id;
- zp->z_unlinked = 0;
- zp->z_atime_dirty = 0;
- zp->z_zn_prefetch = 0;
- zp->z_moved = 0;
+ zp->z_unlinked = B_FALSE;
+ zp->z_atime_dirty = B_FALSE;
+ zp->z_zn_prefetch = B_FALSE;
+ zp->z_moved = B_FALSE;
+ zp->z_is_sa = B_FALSE;
+ zp->z_is_mapped = B_FALSE;
+ zp->z_is_ctldir = B_TRUE;
+ zp->z_is_stale = B_FALSE;
zp->z_sa_hdl = NULL;
zp->z_blksz = 0;
zp->z_seq = 0;
zp->z_pflags = 0;
zp->z_mode = 0;
zp->z_sync_cnt = 0;
- zp->z_is_mapped = B_FALSE;
- zp->z_is_ctldir = B_TRUE;
- zp->z_is_sa = B_FALSE;
- zp->z_is_stale = B_FALSE;
ip->i_generation = 0;
ip->i_ino = id;
ip->i_mode = (S_IFDIR | S_IRWXUGO);
zfs_fuid_sync(zfsvfs, tx);
/* Add to unlinked set */
- zp->z_unlinked = 1;
+ zp->z_unlinked = B_TRUE;
zfs_unlinked_add(zp, tx);
zfs_acl_ids_free(&acl_ids);
dmu_tx_commit(tx);
if (xattr_obj_unlinked) {
ASSERT3U(ZTOI(xzp)->i_nlink, ==, 2);
mutex_enter(&xzp->z_lock);
- xzp->z_unlinked = 1;
+ xzp->z_unlinked = B_TRUE;
clear_nlink(ZTOI(xzp));
links = 0;
error = sa_update(xzp->z_sa_hdl, SA_ZPL_LINKS(zfsvfs),
}
if ((mask & ATTR_ATIME) || zp->z_atime_dirty) {
- zp->z_atime_dirty = 0;
+ zp->z_atime_dirty = B_FALSE;
ZFS_TIME_ENCODE(&ip->i_atime, atime);
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_ATIME(zfsvfs), NULL,
&atime, sizeof (atime));
}
/* unmark z_unlinked so zfs_link_create will not reject */
if (is_tmpfile)
- szp->z_unlinked = 0;
+ szp->z_unlinked = B_FALSE;
error = zfs_link_create(dl, szp, tx, 0);
if (error == 0) {
}
} else if (is_tmpfile) {
/* restore z_unlinked since when linking failed */
- szp->z_unlinked = 1;
+ szp->z_unlinked = B_TRUE;
}
txg = dmu_tx_get_txg(tx);
dmu_tx_commit(tx);
/* Preserve the mtime and ctime provided by the inode */
ZFS_TIME_ENCODE(&ip->i_mtime, mtime);
ZFS_TIME_ENCODE(&ip->i_ctime, ctime);
- zp->z_atime_dirty = 0;
+ zp->z_atime_dirty = B_FALSE;
zp->z_seq++;
err = sa_bulk_update(zp->z_sa_hdl, bulk, cnt, tx);
* only need to dirty atime.
*/
if (flags == I_DIRTY_TIME) {
- zp->z_atime_dirty = 1;
+ zp->z_atime_dirty = B_TRUE;
goto out;
}
#endif
}
mutex_enter(&zp->z_lock);
- zp->z_atime_dirty = 0;
+ zp->z_atime_dirty = B_FALSE;
SA_ADD_BULK_ATTR(bulk, cnt, SA_ZPL_MODE(zfsvfs), NULL, &mode, 8);
SA_ADD_BULK_ATTR(bulk, cnt, SA_ZPL_ATIME(zfsvfs), NULL, &atime, 16);
return;
}
- if (zp->z_atime_dirty && zp->z_unlinked == 0) {
+ if (zp->z_atime_dirty && zp->z_unlinked == B_FALSE) {
dmu_tx_t *tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE);
mutex_enter(&zp->z_lock);
(void) sa_update(zp->z_sa_hdl, SA_ZPL_ATIME(zfsvfs),
(void *)&atime, sizeof (atime), tx);
- zp->z_atime_dirty = 0;
+ zp->z_atime_dirty = B_FALSE;
mutex_exit(&zp->z_lock);
dmu_tx_commit(tx);
}
zp->z_acl_cached = NULL;
zp->z_xattr_cached = NULL;
zp->z_xattr_parent = 0;
- zp->z_moved = 0;
+ zp->z_moved = B_FALSE;
return (0);
}
ASSERT(zp->z_dirlocks == NULL);
ASSERT3P(zp->z_acl_cached, ==, NULL);
ASSERT3P(zp->z_xattr_cached, ==, NULL);
- zp->z_moved = 0;
+ zp->z_unlinked = B_FALSE;
+ zp->z_atime_dirty = B_FALSE;
+ zp->z_moved = B_FALSE;
+ zp->z_is_mapped = B_FALSE;
+ zp->z_is_ctldir = B_FALSE;
+ zp->z_is_stale = B_FALSE;
zp->z_sa_hdl = NULL;
- zp->z_unlinked = 0;
- zp->z_atime_dirty = 0;
zp->z_mapcnt = 0;
zp->z_id = db->db_object;
zp->z_blksz = blksz;
zp->z_seq = 0x7A4653;
zp->z_sync_cnt = 0;
- zp->z_is_mapped = B_FALSE;
- zp->z_is_ctldir = B_FALSE;
- zp->z_is_stale = B_FALSE;
zfs_znode_sa_init(zfsvfs, zp, db, obj_type, hdl);
zfs_set_inode_flags(zp, ZTOI(zp));
zp->z_blksz = doi.doi_data_block_size;
- zp->z_atime_dirty = 0;
+ zp->z_atime_dirty = B_FALSE;
zfs_inode_update(zp);
/*
vattr.va_gid = crgetgid(cr);
rootzp = kmem_cache_alloc(znode_cache, KM_SLEEP);
- rootzp->z_moved = 0;
- rootzp->z_unlinked = 0;
- rootzp->z_atime_dirty = 0;
+ rootzp->z_unlinked = B_FALSE;
+ rootzp->z_atime_dirty = B_FALSE;
+ rootzp->z_moved = B_FALSE;
rootzp->z_is_sa = USE_SA(version, os);
rootzp->z_pflags = 0;