This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / fs / intermezzo / journal_tmpfs.c
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  *  Copyright (C) 2001 Tacit Networks, Inc. <phil@off.net>
10  *
11  *   This file is part of InterMezzo, http://www.inter-mezzo.org.
12  *
13  *   InterMezzo is free software; you can redistribute it and/or
14  *   modify it under the terms of version 2 of the GNU General Public
15  *   License as published by the Free Software Foundation.
16  *
17  *   InterMezzo is distributed in the hope that it will be useful,
18  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  *   GNU General Public License for more details.
21  *
22  *   You should have received a copy of the GNU General Public License
23  *   along with InterMezzo; if not, write to the Free Software
24  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26
27 #include <linux/types.h>
28 #include <linux/param.h>
29 #include <linux/kernel.h>
30 #include <linux/sched.h>
31 #include <linux/fs.h>
32 #include <linux/slab.h>
33 #include <linux/vmalloc.h>
34 #include <linux/stat.h>
35 #include <linux/errno.h>
36 #include <asm/segment.h>
37 #include <asm/uaccess.h>
38 #include <linux/string.h>
39 #if defined(CONFIG_TMPFS)
40 #include <linux/jbd.h>
41 #if defined(CONFIG_EXT3)
42 #include <linux/ext3_fs.h>
43 #include <linux/ext3_jbd.h>
44 #endif
45 #endif
46
47 #include "intermezzo_fs.h"
48 #include "intermezzo_psdev.h"
49
50 #if defined(CONFIG_TMPFS)
51
52 /* space requirements: 
53    presto_do_truncate: 
54         used to truncate the KML forward to next fset->chunksize boundary
55           - zero partial block
56           - update inode
57    presto_write_record: 
58         write header (< one block) 
59         write one path (< MAX_PATHLEN) 
60         possibly write another path (< MAX_PATHLEN)
61         write suffix (< one block) 
62    presto_update_last_rcvd
63         write one block
64 */
65
66 static loff_t presto_tmpfs_freespace(struct presto_cache *cache,
67                                          struct super_block *sb)
68 {
69         return (1<<30);
70 }
71
72 /* start the filesystem journal operations */
73 static void *presto_tmpfs_trans_start(struct presto_file_set *fset, 
74                                    struct inode *inode, 
75                                    int op)
76 {
77         return (void *)1; 
78 }
79
80 static void presto_tmpfs_trans_commit(struct presto_file_set *fset, void *handle)
81 {
82         return;
83 }
84
85 static void presto_tmpfs_journal_file_data(struct inode *inode)
86 {
87         return; 
88 }
89
90 /* The logic here is a slightly modified version of ext3/inode.c:block_to_path
91  */
92 static int presto_tmpfs_has_all_data(struct inode *inode)
93 {
94         return 0;
95 }
96
97 struct journal_ops presto_tmpfs_journal_ops = {
98         .tr_all_data            = presto_tmpfs_has_all_data,
99         .tr_avail               = presto_tmpfs_freespace,
100         .tr_start               = presto_tmpfs_trans_start,
101         .tr_commit              = presto_tmpfs_trans_commit,
102         .tr_journal_data        = presto_tmpfs_journal_file_data,
103         .tr_ilookup             = presto_tmpfs_ilookup,
104         .tr_add_ilookup         = presto_add_ilookup_dentry
105 };
106
107 #endif /* CONFIG_EXT3_FS */