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, 2012, Whamcloud, Inc.
35 * This file is part of Lustre, http://www.lustre.org/
36 * Lustre is a trademark of Sun Microsystems, Inc.
38 * lustre/mdd/mdd_trans.c
40 * Lustre Metadata Server (mdd) routines
42 * Author: Wang Di <wangdi@clusterfs.com>
46 # define EXPORT_SYMTAB
48 #define DEBUG_SUBSYSTEM S_MDS
50 #include <linux/module.h>
51 #ifdef HAVE_EXT4_LDISKFS
52 #include <ldiskfs/ldiskfs_jbd2.h>
54 #include <linux/jbd.h>
57 #include <obd_class.h>
58 #include <lustre_ver.h>
59 #include <obd_support.h>
60 #include <lprocfs_status.h>
62 #ifdef HAVE_EXT4_LDISKFS
63 #include <ldiskfs/ldiskfs.h>
65 #include <linux/ldiskfs_fs.h>
67 #include <lustre_mds.h>
68 #include <lustre/lustre_idl.h>
70 #include "mdd_internal.h"
72 int mdd_txn_stop_cb(const struct lu_env *env, struct thandle *txn,
75 struct mdd_device *mdd = cookie;
76 struct obd_device *obd = mdd2obd_dev(mdd);
79 return mds_lov_write_objids(obd);
82 struct thandle *mdd_trans_create(const struct lu_env *env,
83 struct mdd_device *mdd)
85 return mdd_child_ops(mdd)->dt_trans_create(env, mdd->mdd_child);
88 int mdd_trans_start(const struct lu_env *env, struct mdd_device *mdd,
91 return mdd_child_ops(mdd)->dt_trans_start(env, mdd->mdd_child, th);
94 void mdd_trans_stop(const struct lu_env *env, struct mdd_device *mdd,
95 int result, struct thandle *handle)
97 handle->th_result = result;
98 mdd_child_ops(mdd)->dt_trans_stop(env, handle);