]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - fs/xfs/linux-2.6/xfs_vfs.h
[XFS] move syncing related members from struct bhv_vfs to struct xfs_mount
[linux-2.6-omap-h63xx.git] / fs / xfs / linux-2.6 / xfs_vfs.h
1 /*
2  * Copyright (c) 2000-2006 Silicon Graphics, Inc.
3  * All Rights Reserved.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it would be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write the Free Software Foundation,
16  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18 #ifndef __XFS_VFS_H__
19 #define __XFS_VFS_H__
20
21 #include <linux/vfs.h>
22 #include "xfs_fs.h"
23
24 struct bhv_vfs;
25 struct inode;
26
27 struct fid;
28 struct cred;
29 struct seq_file;
30 struct super_block;
31 struct xfs_inode;
32 struct xfs_mount;
33 struct xfs_mount_args;
34
35 typedef struct kstatfs  bhv_statvfs_t;
36
37 typedef struct bhv_vfs_sync_work {
38         struct list_head        w_list;
39         struct xfs_mount        *w_mount;
40         void                    *w_data;        /* syncer routine argument */
41         void                    (*w_syncer)(struct xfs_mount *, void *);
42 } bhv_vfs_sync_work_t;
43
44 typedef struct bhv_vfs {
45         struct xfs_mount        *vfs_mount;
46         struct super_block      *vfs_super;     /* generic superblock pointer */
47 } bhv_vfs_t;
48
49 #define SYNC_ATTR               0x0001  /* sync attributes */
50 #define SYNC_CLOSE              0x0002  /* close file system down */
51 #define SYNC_DELWRI             0x0004  /* look at delayed writes */
52 #define SYNC_WAIT               0x0008  /* wait for i/o to complete */
53 #define SYNC_BDFLUSH            0x0010  /* BDFLUSH is calling -- don't block */
54 #define SYNC_FSDATA             0x0020  /* flush fs data (e.g. superblocks) */
55 #define SYNC_REFCACHE           0x0040  /* prune some of the nfs ref cache */
56 #define SYNC_REMOUNT            0x0080  /* remount readonly, no dummy LRs */
57 #define SYNC_IOWAIT             0x0100  /* wait for all I/O to complete */
58 #define SYNC_SUPER              0x0200  /* flush superblock to disk */
59
60 /*
61  * When remounting a filesystem read-only or freezing the filesystem,
62  * we have two phases to execute. This first phase is syncing the data
63  * before we quiesce the fielsystem, and the second is flushing all the
64  * inodes out after we've waited for all the transactions created by
65  * the first phase to complete. The second phase uses SYNC_INODE_QUIESCE
66  * to ensure that the inodes are written to their location on disk
67  * rather than just existing in transactions in the log. This means
68  * after a quiesce there is no log replay required to write the inodes
69  * to disk (this is the main difference between a sync and a quiesce).
70  */
71 #define SYNC_DATA_QUIESCE       (SYNC_DELWRI|SYNC_FSDATA|SYNC_WAIT|SYNC_IOWAIT)
72 #define SYNC_INODE_QUIESCE      (SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT)
73
74 #define SHUTDOWN_META_IO_ERROR  0x0001  /* write attempt to metadata failed */
75 #define SHUTDOWN_LOG_IO_ERROR   0x0002  /* write attempt to the log failed */
76 #define SHUTDOWN_FORCE_UMOUNT   0x0004  /* shutdown from a forced unmount */
77 #define SHUTDOWN_CORRUPT_INCORE 0x0008  /* corrupt in-memory data structures */
78 #define SHUTDOWN_REMOTE_REQ     0x0010  /* shutdown came from remote cell */
79 #define SHUTDOWN_DEVICE_REQ     0x0020  /* failed all paths to the device */
80
81 #define vfs_test_for_freeze(vfs)        ((vfs)->vfs_super->s_frozen)
82 #define vfs_wait_for_freeze(vfs,l)      vfs_check_frozen((vfs)->vfs_super, (l))
83  
84 extern bhv_vfs_t *vfs_allocate(struct super_block *);
85 extern bhv_vfs_t *vfs_from_sb(struct super_block *);
86 extern void vfs_deallocate(bhv_vfs_t *);
87
88 #endif  /* __XFS_VFS_H__ */