1*66325755SMatthew Dillon /* 2*66325755SMatthew Dillon * Copyright (c) 2007 The DragonFly Project. All rights reserved. 3*66325755SMatthew Dillon * 4*66325755SMatthew Dillon * This code is derived from software contributed to The DragonFly Project 5*66325755SMatthew Dillon * by Matthew Dillon <dillon@backplane.com> 6*66325755SMatthew Dillon * 7*66325755SMatthew Dillon * Redistribution and use in source and binary forms, with or without 8*66325755SMatthew Dillon * modification, are permitted provided that the following conditions 9*66325755SMatthew Dillon * are met: 10*66325755SMatthew Dillon * 11*66325755SMatthew Dillon * 1. Redistributions of source code must retain the above copyright 12*66325755SMatthew Dillon * notice, this list of conditions and the following disclaimer. 13*66325755SMatthew Dillon * 2. Redistributions in binary form must reproduce the above copyright 14*66325755SMatthew Dillon * notice, this list of conditions and the following disclaimer in 15*66325755SMatthew Dillon * the documentation and/or other materials provided with the 16*66325755SMatthew Dillon * distribution. 17*66325755SMatthew Dillon * 3. Neither the name of The DragonFly Project nor the names of its 18*66325755SMatthew Dillon * contributors may be used to endorse or promote products derived 19*66325755SMatthew Dillon * from this software without specific, prior written permission. 20*66325755SMatthew Dillon * 21*66325755SMatthew Dillon * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22*66325755SMatthew Dillon * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23*66325755SMatthew Dillon * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24*66325755SMatthew Dillon * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25*66325755SMatthew Dillon * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26*66325755SMatthew Dillon * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 27*66325755SMatthew Dillon * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28*66325755SMatthew Dillon * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 29*66325755SMatthew Dillon * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30*66325755SMatthew Dillon * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 31*66325755SMatthew Dillon * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32*66325755SMatthew Dillon * SUCH DAMAGE. 33*66325755SMatthew Dillon * 34*66325755SMatthew Dillon * $DragonFly: src/sys/vfs/hammer/hammer_transaction.c,v 1.1 2007/11/07 00:43:24 dillon Exp $ 35*66325755SMatthew Dillon */ 36*66325755SMatthew Dillon 37*66325755SMatthew Dillon #include "hammer.h" 38*66325755SMatthew Dillon 39*66325755SMatthew Dillon void 40*66325755SMatthew Dillon hammer_start_transaction(struct hammer_mount *hmp, 41*66325755SMatthew Dillon struct hammer_transaction *trans) 42*66325755SMatthew Dillon { 43*66325755SMatthew Dillon struct timespec ts; 44*66325755SMatthew Dillon 45*66325755SMatthew Dillon getnanotime(&ts); 46*66325755SMatthew Dillon trans->hmp = hmp; 47*66325755SMatthew Dillon trans->tid = ts.tv_sec * 1000000000LL + ts.tv_nsec; 48*66325755SMatthew Dillon if (trans->tid < hmp->last_tid) 49*66325755SMatthew Dillon trans->tid = hmp->last_tid; 50*66325755SMatthew Dillon hmp->last_tid = trans->tid + 1; 51*66325755SMatthew Dillon } 52*66325755SMatthew Dillon 53*66325755SMatthew Dillon void 54*66325755SMatthew Dillon hammer_abort_transaction(struct hammer_transaction *trans) 55*66325755SMatthew Dillon { 56*66325755SMatthew Dillon KKASSERT(0); 57*66325755SMatthew Dillon } 58*66325755SMatthew Dillon 59*66325755SMatthew Dillon void 60*66325755SMatthew Dillon hammer_commit_transaction(struct hammer_transaction *trans) 61*66325755SMatthew Dillon { 62*66325755SMatthew Dillon KKASSERT(0); 63*66325755SMatthew Dillon } 64*66325755SMatthew Dillon 65