1/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
3 *
4 *  Copyright (C) 1998 Peter J. Braam <braam@clusterfs.com>
5 *  Copyright (C) 2000 Red Hat, Inc.
6 *  Copyright (C) 2000 Los Alamos National Laboratory
7 *  Copyright (C) 2000 TurboLinux, Inc.
8 *  Copyright (C) 2001 Mountain View Data, Inc.
9 *
10 *   This file is part of InterMezzo, http://www.inter-mezzo.org.
11 *
12 *   InterMezzo is free software; you can redistribute it and/or
13 *   modify it under the terms of version 2 of the GNU General Public
14 *   License as published by the Free Software Foundation.
15 *
16 *   InterMezzo is distributed in the hope that it will be useful,
17 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
18 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 *   GNU General Public License for more details.
20 *
21 *   You should have received a copy of the GNU General Public License
22 *   along with InterMezzo; if not, write to the Free Software
23 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#include <linux/types.h>
27#include <linux/param.h>
28#include <linux/kernel.h>
29#include <linux/sched.h>
30#include <linux/fs.h>
31#include <linux/slab.h>
32#include <linux/vmalloc.h>
33#include <linux/stat.h>
34#include <linux/errno.h>
35#include <linux/locks.h>
36#include <asm/segment.h>
37#include <asm/uaccess.h>
38#include <linux/string.h>
39#ifdef CONFIG_OBDFS_FS
40#include /usr/src/obd/include/linux/obdfs.h
41#endif
42
43#include <linux/intermezzo_fs.h>
44#include <linux/intermezzo_psdev.h>
45
46#ifdef CONFIG_OBDFS_FS
47
48
49static unsigned long presto_obdfs_freespace(struct presto_file_set *fset,
50                                         struct super_block *sb)
51{
52        return 0x0fffff;
53}
54
55/* start the filesystem journal operations */
56static void *presto_obdfs_trans_start(struct presto_file_set *fset,
57                                   struct inode *inode,
58                                   int op)
59{
60
61        return (void *) 1;
62}
63
64
65void presto_obdfs_trans_commit(struct presto_file_set *fset, void *handle)
66{
67}
68
69void presto_obdfs_journal_file_data(struct inode *inode)
70{
71#ifdef EXT3_JOURNAL_DATA_FL
72        inode->u.ext3_i.i_flags |= EXT3_JOURNAL_DATA_FL;
73#else
74#warning You must have a facility to enable journaled writes for recovery!
75#endif
76}
77
78struct journal_ops presto_obdfs_journal_ops = {
79        .tr_avail        = presto_obdfs_freespace,
80        .tr_start        =  presto_obdfs_trans_start,
81        .tr_commit       = presto_obdfs_trans_commit,
82        .tr_journal_data = presto_obdfs_journal_file_data
83};
84
85#endif
86