Deleted Added
full compact
zvol.c (268178) zvol.c (268464)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 837 unchanged lines hidden (view full) ---

846{
847 dmu_tx_t *tx;
848 int error;
849
850 ASSERT(MUTEX_HELD(&spa_namespace_lock));
851
852 tx = dmu_tx_create(os);
853 dmu_tx_hold_zap(tx, ZVOL_ZAP_OBJ, TRUE, NULL);
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 837 unchanged lines hidden (view full) ---

846{
847 dmu_tx_t *tx;
848 int error;
849
850 ASSERT(MUTEX_HELD(&spa_namespace_lock));
851
852 tx = dmu_tx_create(os);
853 dmu_tx_hold_zap(tx, ZVOL_ZAP_OBJ, TRUE, NULL);
854 dmu_tx_mark_netfree(tx);
854 error = dmu_tx_assign(tx, TXG_WAIT);
855 if (error) {
856 dmu_tx_abort(tx);
857 return (error);
858 }
859
860 error = zap_update(os, ZVOL_ZAP_OBJ, "size", 8, 1,
861 &volsize, tx);

--- 1120 unchanged lines hidden (view full) ---

1982 if (df.df_start >= zv->zv_volsize)
1983 break; /* No need to do anything... */
1984 if (df.df_start + df.df_length > zv->zv_volsize)
1985 df.df_length = DMU_OBJECT_END;
1986
1987 rl = zfs_range_lock(&zv->zv_znode, df.df_start, df.df_length,
1988 RL_WRITER);
1989 tx = dmu_tx_create(zv->zv_objset);
855 error = dmu_tx_assign(tx, TXG_WAIT);
856 if (error) {
857 dmu_tx_abort(tx);
858 return (error);
859 }
860
861 error = zap_update(os, ZVOL_ZAP_OBJ, "size", 8, 1,
862 &volsize, tx);

--- 1120 unchanged lines hidden (view full) ---

1983 if (df.df_start >= zv->zv_volsize)
1984 break; /* No need to do anything... */
1985 if (df.df_start + df.df_length > zv->zv_volsize)
1986 df.df_length = DMU_OBJECT_END;
1987
1988 rl = zfs_range_lock(&zv->zv_znode, df.df_start, df.df_length,
1989 RL_WRITER);
1990 tx = dmu_tx_create(zv->zv_objset);
1991 dmu_tx_mark_netfree(tx);
1990 error = dmu_tx_assign(tx, TXG_WAIT);
1991 if (error != 0) {
1992 dmu_tx_abort(tx);
1993 } else {
1994 zvol_log_truncate(zv, tx, df.df_start,
1995 df.df_length, B_TRUE);
1996 dmu_tx_commit(tx);
1997 error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ,

--- 847 unchanged lines hidden ---
1992 error = dmu_tx_assign(tx, TXG_WAIT);
1993 if (error != 0) {
1994 dmu_tx_abort(tx);
1995 } else {
1996 zvol_log_truncate(zv, tx, df.df_start,
1997 df.df_length, B_TRUE);
1998 dmu_tx_commit(tx);
1999 error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ,

--- 847 unchanged lines hidden ---