1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
30 * Use is subject to license terms.
32 * Copyright (c) 2011 Whamcloud, Inc.
36 * This file is part of Lustre, http://www.lustre.org/
37 * Lustre is a trademark of Sun Microsystems, Inc.
39 * lustre/mdd/mdd_trans.c
41 * Lustre Metadata Server (mdd) routines
43 * Author: Wang Di <wangdi@clusterfs.com>
47 # define EXPORT_SYMTAB
49 #define DEBUG_SUBSYSTEM S_MDS
51 #include <linux/module.h>
52 #ifdef HAVE_EXT4_LDISKFS
53 #include <ldiskfs/ldiskfs_jbd2.h>
55 #include <linux/jbd.h>
58 #include <obd_class.h>
59 #include <lustre_ver.h>
60 #include <obd_support.h>
61 #include <lprocfs_status.h>
63 #ifdef HAVE_EXT4_LDISKFS
64 #include <ldiskfs/ldiskfs.h>
66 #include <linux/ldiskfs_fs.h>
68 #include <lustre_mds.h>
69 #include <lustre/lustre_idl.h>
71 #include "mdd_internal.h"
73 int mdd_txn_stop_cb(const struct lu_env *env, struct thandle *txn,
76 struct mdd_device *mdd = cookie;
77 struct obd_device *obd = mdd2obd_dev(mdd);
80 return mds_lov_write_objids(obd);
83 struct thandle *mdd_trans_create(const struct lu_env *env,
84 struct mdd_device *mdd)
86 return mdd_child_ops(mdd)->dt_trans_create(env, mdd->mdd_child);
89 int mdd_trans_start(const struct lu_env *env, struct mdd_device *mdd,
92 return mdd_child_ops(mdd)->dt_trans_start(env, mdd->mdd_child, th);
95 void mdd_trans_stop(const struct lu_env *env, struct mdd_device *mdd,
96 int result, struct thandle *handle)
98 handle->th_result = result;
99 mdd_child_ops(mdd)->dt_trans_stop(env, handle);