Fix mismerges in ZFS from the Dtrace merge.

Submitted by:	jhb
Reviewed by:	pjd
Approved by:	jb
This commit is contained in:
Scott Long 2008-08-29 07:49:48 +00:00
parent 6c9c4767a8
commit 8d75e62c3f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/7/; revision=182436
10 changed files with 21 additions and 16 deletions

View File

@ -100,7 +100,7 @@ vfs_clearmntopt(vfs_t *vfsp, const char *name)
int
vfs_optionisset(const vfs_t *vfsp, const char *opt, char **argp)
{
struct vfsoptlist *opts = vfsp->mnt_opt;
struct vfsoptlist *opts = vfsp->mnt_optnew;
int error;
if (opts == NULL)
@ -163,6 +163,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
{
struct mount *mp;
struct vfsconf *vfsp;
struct ucred *newcr, *oldcr;
int error;
/*
@ -202,7 +203,9 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
/*
* Set the mount level flags.
* crdup() can sleep, so do it before acquiring a mutex.
*/
newcr = crdup(kcred);
MNT_ILOCK(mp);
if (fsflags & MNT_RDONLY)
mp->mnt_flag |= MNT_RDONLY;
@ -212,10 +215,11 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
* Unprivileged user can trigger mounting a snapshot, but we don't want
* him to unmount it, so we switch to privileged credentials.
*/
crfree(mp->mnt_cred);
mp->mnt_cred = crdup(kcred);
oldcr = mp->mnt_cred;
mp->mnt_cred = newcr;
mp->mnt_stat.f_owner = mp->mnt_cred->cr_uid;
MNT_IUNLOCK(mp);
crfree(oldcr);
/*
* Mount the filesystem.
* XXX The final recipients of VFS_MOUNT just overwrite the ndp they

View File

@ -92,6 +92,7 @@
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stdint.h>
#include <sys/debug.h>
#include <sys/avl.h>

View File

@ -1918,7 +1918,7 @@ nvlist_common(nvlist_t *nvl, char *buf, size_t *buflen, int encoding,
int err = 0;
nvstream_t nvs;
int nvl_endian;
#ifdef _LITTLE_ENDIAN
#if BYTE_ORDER == _LITTLE_ENDIAN
int host_endian = 1;
#else
int host_endian = 0;

View File

@ -295,7 +295,7 @@ typedef struct blkptr {
* Note: the byteorder is either 0 or -1, both of which are palindromes.
* This simplifies the endianness handling a bit.
*/
#ifdef _BIG_ENDIAN
#if BYTE_ORDER == _BIG_ENDIAN
#define ZFS_HOST_BYTEORDER (0ULL)
#else
#define ZFS_HOST_BYTEORDER (-1ULL)

View File

@ -128,7 +128,7 @@ vdev_cache_evict(vdev_cache_t *vc, vdev_cache_entry_t *ve)
ASSERT(ve->ve_data != NULL);
dprintf("evicting %p, off %llx, LRU %llu, age %lu, hits %u, stale %u\n",
vc, ve->ve_offset, ve->ve_lastused, lbolt - ve->ve_lastused,
vc, ve->ve_offset, ve->ve_lastused, LBOLT - ve->ve_lastused,
ve->ve_hits, ve->ve_missed_update);
avl_remove(&vc->vc_lastused_tree, ve);
@ -171,7 +171,7 @@ vdev_cache_allocate(zio_t *zio)
ve = kmem_zalloc(sizeof (vdev_cache_entry_t), KM_SLEEP);
ve->ve_offset = offset;
ve->ve_lastused = lbolt;
ve->ve_lastused = LBOLT;
ve->ve_data = zio_buf_alloc(VCBS);
avl_add(&vc->vc_offset_tree, ve);
@ -188,9 +188,9 @@ vdev_cache_hit(vdev_cache_t *vc, vdev_cache_entry_t *ve, zio_t *zio)
ASSERT(MUTEX_HELD(&vc->vc_lock));
ASSERT(ve->ve_fill_io == NULL);
if (ve->ve_lastused != lbolt) {
if (ve->ve_lastused != LBOLT) {
avl_remove(&vc->vc_lastused_tree, ve);
ve->ve_lastused = lbolt;
ve->ve_lastused = LBOLT;
avl_add(&vc->vc_lastused_tree, ve);
}

View File

@ -43,7 +43,7 @@
int zfs_vdev_max_pending = 35;
int zfs_vdev_min_pending = 4;
/* deadline = pri + (lbolt >> time_shift) */
/* deadline = pri + (LBOLT >> time_shift) */
int zfs_vdev_time_shift = 6;
/* exponential I/O issue ramp-up rate */

View File

@ -1553,7 +1553,7 @@ zil_replay(objset_t *os, void *arg, uint64_t *txgp,
txg_wait_synced(zilog->zl_dmu_pool, 0);
zilog->zl_stop_replay = 0;
zilog->zl_replay_time = lbolt;
zilog->zl_replay_time = LBOLT;
ASSERT(zilog->zl_replay_blks == 0);
(void) zil_parse(zilog, zil_incr_blks, zil_replay_log_record, &zr,
zh->zh_claim_txg);

View File

@ -1299,7 +1299,7 @@ zio_write_allocate_gang_members(zio_t *zio)
bzero(gbh, gsize);
/* We need to test multi-level gang blocks */
if (maxalloc >= zio_gang_bang && (lbolt & 0x1) == 0)
if (maxalloc >= zio_gang_bang && (LBOLT & 0x1) == 0)
maxalloc = MAX(maxalloc >> 2, SPA_MINBLOCKSIZE);
for (loff = 0, i = 0; loff != zio->io_size;
@ -1375,7 +1375,7 @@ zio_dva_allocate(zio_t *zio)
ASSERT3U(zio->io_ndvas, <=, spa_max_replication(zio->io_spa));
/* For testing, make some blocks above a certain size be gang blocks */
if (zio->io_size >= zio_gang_bang && (lbolt & 0x3) == 0) {
if (zio->io_size >= zio_gang_bang && (LBOLT & 0x3) == 0) {
zio_write_allocate_gang_members(zio);
return;
}

View File

@ -365,7 +365,7 @@ struct xdr_discrim {
#endif
#ifndef _LITTLE_ENDIAN
#if BYTE_ORDER == _BIG_ENDIAN
#define IXDR_GET_HYPER(buf, v) { \
*((int32_t *)(&v)) = ntohl(*(uint32_t *)buf++); \
*((int32_t *)(((char *)&v) + BYTES_PER_XDR_UNIT)) \

View File

@ -58,7 +58,7 @@ extern "C" {
* macros for conversion between host and (internet) network byte order
*/
#if defined(_BIG_ENDIAN) && !defined(ntohl) && !defined(__lint)
#if BYTE_ORDER == _BIG_ENDIAN && !defined(ntohl) && !defined(__lint)
/* big-endian */
#define ntohl(x) (x)
#define ntohs(x) (x)
@ -108,7 +108,7 @@ extern in_port_t ntohs(in_port_t);
/*
* Macros to convert from a specific byte order to/from native byte order
*/
#ifdef _BIG_ENDIAN
#if BYTE_ORDER == _BIG_ENDIAN
#define BE_8(x) BMASK_8(x)
#define BE_16(x) BMASK_16(x)
#define BE_32(x) BMASK_32(x)