svn commit: r201744 - in stable/7/sys/cddl: compat/opensolaris/kern
compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs
contrib/opensolaris/uts/common/sys/fs
Alexander Leidinger
netchild at FreeBSD.org
Thu Jan 7 13:42:29 UTC 2010
Author: netchild
Date: Thu Jan 7 13:42:28 2010
New Revision: 201744
URL: http://svn.freebsd.org/changeset/base/201744
Log:
Diff reduction to 8-stable:
- whitespace
- fix harmless mismerges
- comments or (harmless) code which was there twice
- fix not so harmless mismerges (mem leak - double mtx_init)
MFC r197842: whitespace fix
Modified:
stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c
stable/7/sys/cddl/compat/opensolaris/sys/kmem.h
stable/7/sys/cddl/compat/opensolaris/sys/time.h
stable/7/sys/cddl/compat/opensolaris/sys/types.h
stable/7/sys/cddl/compat/opensolaris/sys/vnode.h
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
Directory Properties:
stable/7/sys/ (props changed)
stable/7/sys/cddl/contrib/opensolaris/ (props changed)
stable/7/sys/contrib/dev/acpica/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
Modified: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c
==============================================================================
--- stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -127,7 +127,6 @@ secpolicy_vnode_access(struct ucred *cre
if ((accmode & VREAD) && priv_check_cred(cred, PRIV_VFS_READ, 0) != 0)
return (EACCES);
-
if ((accmode & VWRITE) &&
priv_check_cred(cred, PRIV_VFS_WRITE, 0) != 0) {
return (EACCES);
Modified: stable/7/sys/cddl/compat/opensolaris/sys/kmem.h
==============================================================================
--- stable/7/sys/cddl/compat/opensolaris/sys/kmem.h Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/compat/opensolaris/sys/kmem.h Thu Jan 7 13:42:28 2010 (r201744)
@@ -40,7 +40,6 @@
#define KM_SLEEP M_WAITOK
#define KM_PUSHPAGE M_WAITOK
#define KM_NOSLEEP M_NOWAIT
-#define KM_ZERO M_ZERO
#define KMC_NODEBUG 0
typedef struct kmem_cache {
Modified: stable/7/sys/cddl/compat/opensolaris/sys/time.h
==============================================================================
--- stable/7/sys/cddl/compat/opensolaris/sys/time.h Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/compat/opensolaris/sys/time.h Thu Jan 7 13:42:28 2010 (r201744)
@@ -30,6 +30,7 @@
#define _OPENSOLARIS_SYS_TIME_H_
#include_next <sys/time.h>
+
#define SEC 1
#define MILLISEC 1000
#define MICROSEC 1000000
Modified: stable/7/sys/cddl/compat/opensolaris/sys/types.h
==============================================================================
--- stable/7/sys/cddl/compat/opensolaris/sys/types.h Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/compat/opensolaris/sys/types.h Thu Jan 7 13:42:28 2010 (r201744)
@@ -62,8 +62,8 @@ typedef uint64_t pgcnt_t;
typedef short index_t;
typedef off_t offset_t;
typedef long ptrdiff_t; /* pointer difference */
-typedef int major_t;
typedef int64_t rlim64_t;
+typedef int major_t;
#else
#ifdef NEED_SOLARIS_BOOLEAN
Modified: stable/7/sys/cddl/compat/opensolaris/sys/vnode.h
==============================================================================
--- stable/7/sys/cddl/compat/opensolaris/sys/vnode.h Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/compat/opensolaris/sys/vnode.h Thu Jan 7 13:42:28 2010 (r201744)
@@ -245,7 +245,6 @@ zfs_vop_fsync(vnode_t *vp, int flag, cre
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
goto drop;
-
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread);
error = VOP_FSYNC(vp, MNT_WAIT, curthread);
VOP_UNLOCK(vp, 0, curthread);
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -2965,7 +2965,7 @@ arc_release(arc_buf_t *buf, void *tag)
mutex_exit(hash_lock);
- nhdr = kmem_cache_alloc(hdr_cache, (KM_PUSHPAGE|KM_ZERO));
+ nhdr = kmem_cache_alloc(hdr_cache, KM_PUSHPAGE);
nhdr->b_size = blksz;
nhdr->b_spa = spa;
nhdr->b_type = type;
@@ -2976,7 +2976,6 @@ arc_release(arc_buf_t *buf, void *tag)
nhdr->b_l2hdr = NULL;
nhdr->b_datacnt = 1;
nhdr->b_freeze_cksum = NULL;
- mutex_init(&nhdr->b_freeze_lock, NULL, MUTEX_DEFAULT, NULL);
(void) refcount_add(&nhdr->b_refcnt, tag);
buf->b_hdr = nhdr;
rw_exit(&buf->b_lock);
@@ -3412,7 +3411,6 @@ arc_lowmem(void *arg __unused, int howto
/* Serialize access via arc_lowmem_lock. */
mutex_enter(&arc_lowmem_lock);
needfree = 1;
-
cv_signal(&arc_reclaim_thr_cv);
while (needfree)
tsleep(&needfree, 0, "zfs:lowmem", hz / 5);
@@ -3449,7 +3447,6 @@ arc_init(void)
arc_c_max = (arc_c * 8) - (1<<30);
else
arc_c_max = arc_c_min;
-
arc_c_max = MAX(arc_c * 5, arc_c_max);
#ifdef _KERNEL
/*
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -1966,10 +1966,6 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr,
list_destroy(&dr->dt.di.dr_children);
mutex_destroy(&dr->dt.di.dr_mtx);
}
- if (dr->dr_dbuf->db_level != 0) {
- list_destroy(&dr->dt.di.dr_children);
- mutex_destroy(&dr->dt.di.dr_mtx);
- }
kmem_free(dr, sizeof (dbuf_dirty_record_t));
ASSERT(db->db_dirtycnt > 0);
db->db_dirtycnt -= 1;
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -1131,7 +1131,6 @@ dmu_objset_find_spa(spa_t *spa, const ch
dsl_dir_close(dd, FTAG);
return (0);
}
- attr = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP);
thisobj = dd->dd_phys->dd_head_dataset_obj;
attr = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP);
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -864,7 +864,6 @@ dsl_snapshot_destroy_one(char *name, voi
(void) strcat(name, da->snapname);
err = dsl_dataset_own(name, DS_MODE_READONLY | DS_MODE_INCONSISTENT,
da->dstg, &ds);
-
cp = strchr(name, '@');
*cp = '\0';
if (err == 0) {
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -85,6 +85,7 @@ rrn_find(rrwlock_t *rrl)
if (refcount_count(&rrl->rr_linked_rcount) == 0)
return (NULL);
+
for (rn = tsd_get(rrw_tsd_key); rn != NULL; rn = rn->rn_next) {
if (rn->rn_rrl == rrl)
return (rn);
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -87,6 +87,7 @@ spa_config_load(void)
(void) snprintf(pathname, MAXPATHLEN, "%s", spa_config_path);
file = kobj_open_file(pathname);
+
if (file == (struct _buf *)-1) {
ZFS_LOG(1, "Cannot open %s.", pathname);
goto out;
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -432,7 +432,7 @@ vdev_geom_open_by_guid(vdev_t *vd)
if (cp != NULL) {
len = strlen(cp->provider->name) + strlen("/dev/") + 1;
buf = kmem_alloc(len, KM_SLEEP);
-
+
snprintf(buf, len, "/dev/%s", cp->provider->name);
spa_strfree(vd->vdev_path);
vd->vdev_path = buf;
@@ -662,11 +662,11 @@ static void
vdev_geom_io_done(zio_t *zio)
{
- /*
- * If the device returned ENXIO, then attempt we should verify if GEOM
- * provider has been removed. If this is the case, then we trigger an
- * asynchronous removal of the device.
- */
+ /*
+ * If the device returned ENXIO, then attempt we should verify if GEOM
+ * provider has been removed. If this is the case, then we trigger an
+ * asynchronous removal of the device.
+ */
if (zio->io_error == ENXIO) {
vdev_t *vd = zio->io_vd;
vdev_geom_ctx_t *ctx;
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -870,15 +870,6 @@ vdev_raidz_io_done(zio_t *zio)
* so we can write it out to the failed device
* later.
*/
-
- /*
- * If we read parity information (unnecessarily
- * as it happens since no reconstruction was
- * needed) regenerate and verify the parity.
- * We also regenerate parity when resilvering
- * so we can write it out to the failed device
- * later.
- */
if (parity_errors + parity_untried <
rm->rm_firstdatacol ||
(zio->io_flags & ZIO_FLAG_RESILVER)) {
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -653,8 +653,8 @@ zfsctl_snapdir_remove(vnode_t *dvp, char
}
}
-
ZFS_EXIT(zfsvfs);
+
err = zfsctl_snapshot_zname(dvp, name, MAXNAMELEN, snapname);
if (!err)
err = zfs_secpolicy_destroy_perms(snapname, cr);
@@ -1060,6 +1060,7 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin
zcp->zc_id = objset;
VFS_HOLD(vp->v_vfsp);
VOP_UNLOCK(vp, 0, curthread);
+
return (vp);
}
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -24,7 +24,6 @@
*/
#include <sys/types.h>
-#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -451,7 +451,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *
{
itx_wr_state_t write_state;
boolean_t slogging;
- uintptr_t fsync_cnt = 0;
+ uintptr_t fsync_cnt;
if (zilog == NULL || zp->z_unlinked)
return;
@@ -486,6 +486,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *
write_state = WR_COPIED;
else
write_state = WR_NEED_COPY;
+
if ((fsync_cnt = (uintptr_t)tsd_get(zfs_fsyncer_key)) != 0) {
(void) tsd_set(zfs_fsyncer_key, (void *)(fsync_cnt - 1));
}
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -710,12 +710,6 @@ zfs_mount(vfs_t *vfsp, kthread_t *td)
int error = 0;
int canwrite;
-#if 0
- /* TODO: For now deny user mounts. */
- if ((error = priv_check(td, PRIV_VFS_MOUNT)) != 0)
- return (error);
-
-#endif
if (vfs_getopt(vfsp->mnt_optnew, "from", (void **)&osname, NULL))
return (EINVAL);
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 7 13:42:28 2010 (r201744)
@@ -23,7 +23,6 @@
* Use is subject to license terms.
*/
-
/* Portions Copyright 2007 Jeremy Teo */
#include <sys/types.h>
@@ -2301,6 +2300,7 @@ zfs_fsync(vnode_t *vp, int syncflag, cre
zfsvfs_t *zfsvfs = zp->z_zfsvfs;
(void) tsd_set(zfs_fsyncer_key, (void *)zfs_fsync_sync_cnt);
+
ZFS_ENTER(zfsvfs);
ZFS_VERIFY_ZP(zp);
zil_commit(zfsvfs->z_log, zp->z_last_itx, zp->z_id);
Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu Jan 7 13:31:00 2010 (r201743)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu Jan 7 13:42:28 2010 (r201744)
@@ -363,6 +363,7 @@ typedef enum zfs_cache_type {
#define ZPOOL_CONFIG_FAULTED "faulted"
#define ZPOOL_CONFIG_DEGRADED "degraded"
#define ZPOOL_CONFIG_REMOVED "removed"
+
#define VDEV_TYPE_ROOT "root"
#define VDEV_TYPE_MIRROR "mirror"
#define VDEV_TYPE_REPLACING "replacing"
More information about the svn-src-all
mailing list