From: adilger Date: Wed, 27 Mar 2002 00:46:29 +0000 (+0000) Subject: Simple journal abstractions for the no-journal (ext2) and ext3 cases. X-Git-Tag: 0.4.2~473 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f684e098a84c224f1a9f1c3dcfb52dbf1d9569f7;p=fs%2Flustre-release.git Simple journal abstractions for the no-journal (ext2) and ext3 cases. --- diff --git a/lustre/mds/mds_ext3.c b/lustre/mds/mds_ext3.c new file mode 100644 index 0000000..7f14e30 --- /dev/null +++ b/lustre/mds/mds_ext3.c @@ -0,0 +1,51 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * + * linux/mds/mds_ext3.c + * + * Lustre Metadata Server (mds) journal abstraction routines + * + * Copyright (C) 2002 Cluster File Systems, Inc. + * author: Andreas Dilger + * + * This code is issued under the GNU General Public License. + * See the file COPYING in this distribution + * + */ + +#define DEBUG_SUBSYSTEM S_MDS + +#include +#include +#include +#include +#include + +/* + * We don't currently need any additional blocks for rmdir and + * unlink transactions because we are storing the OST oa_id inside + * the inode (which we will be changing anyways as part of this + * transaction). When we store the oa_id in an EA (which may be + * in an external block) we need to increase nblocks by 1. + */ +static void *mds_ext3_start(struct inode *inode, int op) +{ + int nblocks = 0; + + switch(op) { + case MDS_JOP_RMDIR: + case MDS_JOP_UNLINK: nblocks = EXT3_DELETE_TRANS_BLOCKS; break; + } + + return journal_start(EXT3_JOURNAL(inode), nblocks); +} + +static int mds_ext3_stop(void *handle, struct inode *inode) +{ + return journal_stop((handle_t *)handle); +} + +struct mds_journal_operations mds_ext3_journal_ops = { + tr_start: mds_ext3_start, + tr_commit: mds_ext3_stop, +}; diff --git a/lustre/mds/mds_null.c b/lustre/mds/mds_null.c new file mode 100644 index 0000000..b65605d --- /dev/null +++ b/lustre/mds/mds_null.c @@ -0,0 +1,34 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * + * linux/mds/mds_null.c + * + * Lustre Metadata Server (mds) journal abstraction routines + * + * Copyright (C) 2002 Cluster File Systems, Inc. + * author: Andreas Dilger + * + * This code is issued under the GNU General Public License. + * See the file COPYING in this distribution + * + */ + +#define DEBUG_SUBSYSTEM S_MDS + +#include +#include + +static void *mds_null_start(struct inode *inode, int nblocks) +{ + return 0; +} + +static int mds_null_stop(void *handle, struct inode *inode) +{ + return 0; +} + +struct mds_journal_operations mds_null_journal_ops = { + tr_start: mds_null_start, + tr_commit: mds_null_stop, +};