From owner-svn-src-all@FreeBSD.ORG Mon Dec 22 16:38:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8A4FDEB; Mon, 22 Dec 2014 16:38:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93F72642E7; Mon, 22 Dec 2014 16:38:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBMGcUVf026430; Mon, 22 Dec 2014 16:38:30 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBMGcUvQ026429; Mon, 22 Dec 2014 16:38:30 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201412221638.sBMGcUvQ026429@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 22 Dec 2014 16:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276063 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Dec 2014 16:38:30 -0000 Author: smh Date: Mon Dec 22 16:38:29 2014 New Revision: 276063 URL: https://svnweb.freebsd.org/changeset/base/276063 Log: Standardise on illumos for #ifdef's in zvol.c Also correct as per style(9) on the use of #ifdef comments. This is a no-op change as pre-cursor to a full cleanup and merge with upstream zvol changes. Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Dec 22 16:34:59 2014 (r276062) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Dec 22 16:38:29 2014 (r276063) @@ -214,7 +214,7 @@ static void zvol_geom_worker(void *arg); static void zvol_size_changed(zvol_state_t *zv) { -#ifdef sun +#ifdef illumos dev_t dev = makedevice(maj, min); VERIFY(ddi_prop_update_int64(dev, zfs_dip, @@ -225,7 +225,7 @@ zvol_size_changed(zvol_state_t *zv) /* Notify specfs to invalidate the cached size */ spec_size_invalidate(dev, VBLK); spec_size_invalidate(dev, VCHR); -#else /* !sun */ +#else /* !illumos */ if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { struct g_provider *pp; @@ -236,7 +236,7 @@ zvol_size_changed(zvol_state_t *zv) g_resize_provider(pp, zv->zv_volsize); g_topology_unlock(); } -#endif /* !sun */ +#endif /* illumos */ } int @@ -517,7 +517,7 @@ zil_replay_func_t *zvol_replay_vector[TX zvol_replay_err, /* TX_WRITE2 */ }; -#ifdef sun +#ifdef illumos int zvol_name2minor(const char *name, minor_t *minor) { @@ -530,7 +530,7 @@ zvol_name2minor(const char *name, minor_ mutex_exit(&spa_namespace_lock); return (zv ? 0 : -1); } -#endif /* sun */ +#endif /* illumos */ /* * Create a minor node (plus a whole lot more) for the specified volume. @@ -565,7 +565,7 @@ zvol_create_minor(const char *name) return (error); } -#ifdef sun +#ifdef illumos if ((minor = zfsdev_minor_alloc()) == 0) { dmu_objset_disown(os, FTAG); mutex_exit(&spa_namespace_lock); @@ -604,7 +604,7 @@ zvol_create_minor(const char *name) zs = ddi_get_soft_state(zfsdev_state, minor); zs->zss_type = ZSST_ZVOL; zv = zs->zss_data = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP); -#else /* !sun */ +#else /* !illumos */ zv = kmem_zalloc(sizeof(*zv), KM_SLEEP); zv->zv_state = 0; @@ -651,7 +651,7 @@ zvol_create_minor(const char *name) dev->si_drv2 = zv; } LIST_INSERT_HEAD(&all_zvols, zv, zv_links); -#endif /* !sun */ +#endif /* illumos */ (void) strlcpy(zv->zv_name, name, MAXPATHLEN); zv->zv_min_bs = DEV_BSHIFT; @@ -681,7 +681,7 @@ zvol_create_minor(const char *name) mutex_exit(&spa_namespace_lock); -#ifndef sun +#ifndef illumos if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { zvol_geom_run(zv); g_topology_unlock(); @@ -700,7 +700,7 @@ zvol_create_minor(const char *name) static int zvol_remove_zv(zvol_state_t *zv) { -#ifdef sun +#ifdef illumos minor_t minor = zv->zv_minor; #endif @@ -710,7 +710,7 @@ zvol_remove_zv(zvol_state_t *zv) ZFS_LOG(1, "ZVOL %s destroyed.", zv->zv_name); -#ifdef sun +#ifdef illumos (void) snprintf(nmbuf, sizeof (nmbuf), "%u,raw", minor); ddi_remove_minor_node(zfs_dip, nmbuf); #else @@ -721,7 +721,7 @@ zvol_remove_zv(zvol_state_t *zv) g_topology_unlock(); } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) destroy_dev(zv->zv_dev); -#endif /* sun */ +#endif avl_destroy(&zv->zv_znode.z_range_avl); mutex_destroy(&zv->zv_znode.z_range_lock); @@ -809,7 +809,7 @@ zvol_last_close(zvol_state_t *zv) zv->zv_objset = NULL; } -#ifdef sun +#ifdef illumos int zvol_prealloc(zvol_state_t *zv) { @@ -848,7 +848,7 @@ zvol_prealloc(zvol_state_t *zv) return (0); } -#endif /* sun */ +#endif /* illumos */ static int zvol_update_volsize(objset_t *os, uint64_t volsize) @@ -955,7 +955,7 @@ zvol_set_volsize(const char *name, major } } -#ifdef sun +#ifdef illumos /* * Generate a LUN expansion event. */ @@ -976,7 +976,7 @@ zvol_set_volsize(const char *name, major nvlist_free(attr); kmem_free(physpath, MAXPATHLEN); } -#endif /* sun */ +#endif /* illumos */ out: dmu_objset_rele(os, FTAG); @@ -1260,7 +1260,7 @@ zvol_log_write(zvol_state_t *zv, dmu_tx_ } } -#ifdef sun +#ifdef illumos static int zvol_dumpio_vdev(vdev_t *vd, void *addr, uint64_t offset, uint64_t origoffset, uint64_t size, boolean_t doread, boolean_t isdump) @@ -1353,7 +1353,7 @@ zvol_dumpio(zvol_state_t *zv, void *addr return (error); } -#endif /* sun */ +#endif /* illumos */ void zvol_strategy(struct bio *bp) @@ -1494,7 +1494,7 @@ out: biofinish(bp, NULL, error); } -#ifdef sun +#ifdef illumos /* * Set the buffer count to the zvol maximum transfer. * Using our own routine instead of the default minphys() @@ -1550,17 +1550,17 @@ int zvol_read(dev_t dev, uio_t *uio, cred_t *cr) { minor_t minor = getminor(dev); -#else +#else /* !illumos */ int zvol_read(struct cdev *dev, struct uio *uio, int ioflag) { -#endif +#endif /* illumos */ zvol_state_t *zv; uint64_t volsize; rl_t *rl; int error = 0; -#ifdef sun +#ifdef illumos zv = zfsdev_get_soft_state(minor, ZSST_ZVOL); if (zv == NULL) return (SET_ERROR(ENXIO)); @@ -1602,24 +1602,24 @@ zvol_read(struct cdev *dev, struct uio * return (error); } -#ifdef sun +#ifdef illumos /*ARGSUSED*/ int zvol_write(dev_t dev, uio_t *uio, cred_t *cr) { minor_t minor = getminor(dev); -#else +#else /* !illumos */ int zvol_write(struct cdev *dev, struct uio *uio, int ioflag) { -#endif +#endif /* illumos */ zvol_state_t *zv; uint64_t volsize; rl_t *rl; int error = 0; boolean_t sync; -#ifdef sun +#ifdef illumos zv = zfsdev_get_soft_state(minor, ZSST_ZVOL); if (zv == NULL) return (SET_ERROR(ENXIO)); @@ -1638,9 +1638,7 @@ zvol_write(struct cdev *dev, struct uio zvol_minphys, uio); return (error); } -#endif -#ifdef sun sync = !(zv->zv_flags & ZVOL_WCE) || #else sync = (ioflag & IO_SYNC) || @@ -1677,7 +1675,7 @@ zvol_write(struct cdev *dev, struct uio return (error); } -#ifdef sun +#ifdef illumos int zvol_getefi(void *arg, int flag, uint64_t vs, uint8_t bs) { @@ -1806,7 +1804,7 @@ zvol_log_write_minor(void *minor_hdl, dm /* * END entry points to allow external callers access to the volume. */ -#endif /* sun */ +#endif /* illumos */ /* * Log a DKIOCFREE/free-long-range to the ZIL with TX_TRUNCATE. @@ -1832,7 +1830,7 @@ zvol_log_truncate(zvol_state_t *zv, dmu_ zil_itx_assign(zilog, itx, tx); } -#ifdef sun +#ifdef illumos /* * Dirtbag ioctls to support mkfs(1M) for UFS filesystems. See dkio(7I). * Also a dirtbag dkio ioctl for unmap/free-block functionality. @@ -2047,7 +2045,7 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t mutex_exit(&spa_namespace_lock); return (error); } -#endif /* sun */ +#endif /* illumos */ int zvol_busy(void) @@ -2070,7 +2068,7 @@ zvol_fini(void) ZFS_LOG(1, "ZVOL Deinitialized."); } -#ifdef sun +#ifdef illumos /*ARGSUSED*/ static int zfs_mvdev_dump_feature_check(void *arg, dmu_tx_t *tx) @@ -2355,7 +2353,7 @@ zvol_dump_fini(zvol_state_t *zv) return (0); } -#endif /* sun */ +#endif /* illumos */ static void zvol_geom_run(zvol_state_t *zv)