Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | /* |
2 | * Project: HARTIK (HA-rd R-eal TI-me K-ernel) |
||
3 | * |
||
4 | * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
||
5 | * Gerardo Lamastra <gerardo@sssup.it> |
||
6 | * |
||
7 | * Authors : Massimiliano Giorgi <massy@hartik.sssup.it> |
||
8 | * (see authors.txt for full list of hartik's authors) |
||
9 | * |
||
10 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
11 | * |
||
12 | * http://www.sssup.it |
||
13 | * http://retis.sssup.it |
||
14 | * http://hartik.sssup.it |
||
15 | */ |
||
16 | |||
17 | /* |
||
18 | * Copyright (C) 2000 Massimiliano Giorgi |
||
19 | * |
||
20 | * This program is free software; you can redistribute it and/or modify |
||
21 | * it under the terms of the GNU General Public License as published by |
||
22 | * the Free Software Foundation; either version 2 of the License, or |
||
23 | * (at your option) any later version. |
||
24 | * |
||
25 | * This program is distributed in the hope that it will be useful, |
||
26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
28 | * GNU General Public License for more details. |
||
29 | * |
||
30 | * You should have received a copy of the GNU General Public License |
||
31 | * along with this program; if not, write to the Free Software |
||
32 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
33 | * |
||
34 | */ |
||
35 | |||
36 | /* |
||
37 | * CVS : $Id: super.h,v 1.1.1.1 2002-03-29 14:12:50 pj Exp $ |
||
38 | * |
||
39 | * File: $File$ |
||
40 | * Revision: $Revision: 1.1.1.1 $ |
||
41 | * Last update: $Date: 2002-03-29 14:12:50 $ |
||
42 | */ |
||
43 | |||
44 | /*** |
||
45 | This file contains the struct super_block and the functions to manage super blocks. |
||
46 | ***/ |
||
47 | |||
48 | #ifndef __SUPER_H__ |
||
49 | #define __SUPER_H__ |
||
50 | |||
51 | #include <fs/types.h> |
||
52 | #include <fs/fsconf.h> |
||
53 | #include <fs/mount.h> |
||
54 | |||
55 | #ifdef MSDOS_FILESYSTEM |
||
56 | #include "msdos/msdos_s.h" |
||
57 | #endif |
||
58 | |||
59 | struct super_block { |
||
60 | |||
61 | /* this are used to build a tree of superblock */ |
||
62 | |||
63 | /*+ parent of this superblock +*/ |
||
64 | struct super_block *sb_parent; |
||
65 | /*+ childs of this superblock +*/ |
||
66 | struct super_block *sb_childs; |
||
67 | /*+ to build a list of childs +*/ |
||
68 | struct super_block *sb_next; |
||
69 | |||
70 | /*+ device on which the super block reside +*/ |
||
71 | __dev_t sb_dev; |
||
72 | |||
73 | /*+ inode of the root directory entry +*/ |
||
74 | struct inode *sb_root; |
||
75 | /*+ directory entry into the tree of the root directory +*/ |
||
76 | struct dentry *sb_droot; |
||
77 | /*+ file-system of the super block +*/ |
||
78 | struct file_system_type *sb_fs; |
||
79 | /*+ pointer to a super operations structure (see superop.h) +*/ |
||
80 | struct super_operations *sb_op; |
||
81 | /*+ pointer to a dentry operations structure (see dentryop.h) +*/ |
||
82 | struct dentry_operations *sb_dop; |
||
83 | /*+ mount options (see fs/mount.h) +*/ |
||
84 | struct mount_opts sb_mopts; |
||
85 | |||
86 | /*+ busy counter (for every operation in progress using this super) +*/ |
||
87 | int sb_busycount; |
||
88 | |||
89 | /* flags */ |
||
90 | /*+ set if this element is valid and used +*/ |
||
91 | __uint32_t sb_used:1; |
||
92 | /*+ set if blocked (if only one operation must be done) +*/ |
||
93 | __uint32_t sb_blocked:1; |
||
94 | |||
95 | union { |
||
96 | #ifdef MSDOS_FILESYSTEM |
||
97 | /*+ msdos filesystem specific super block data +*/ |
||
98 | struct msdos_super_block msdos_sb; |
||
99 | #endif |
||
100 | /*+ not used +*/ |
||
101 | unsigned dummy; |
||
102 | } u; |
||
103 | }; |
||
104 | |||
105 | /*+ module "super" initialization +*/ |
||
106 | int super_init(void); |
||
107 | |||
108 | struct super_block *super_getblock(void); |
||
109 | void super_freeblock(struct super_block *ptr); |
||
110 | int super_enumdevice(int(*func)(__dev_t)); |
||
111 | |||
112 | struct super_block *get_root_superblock(void); |
||
113 | void set_root_superblock(struct super_block *sb); |
||
114 | static __inline__ __dev_t get_root_device(void) { return get_root_superblock()->sb_dev; } |
||
115 | |||
116 | struct super_block *super_aquire(__dev_t dev); |
||
117 | void super_release(struct super_block *sb); |
||
118 | |||
119 | int super_incbusy(struct super_block *sb); |
||
120 | void super_decbusy(struct super_block *sb); |
||
121 | |||
122 | void super_insertintotree(struct super_block *sb, struct super_block *psb); |
||
123 | void super_removefromtree(struct super_block *sb); |
||
124 | |||
125 | #endif |
||
126 |