Whamcloud - gitweb
update .snap on smfs
[fs/lustre-release.git] / lustre / include / linux / lustre_smfs.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2001-2003 Cluster File Systems, Inc. <info@clusterfs.com>
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  *   smfs data structures.
22  *   See also lustre_idl.h for wire formats of requests.
23  *
24  */
25
26 #ifndef __LUSTRE_SMFS_H
27 #define __LUSTRE_SMFS_H
28
29 struct snap_inode_info {
30         int sn_flags;           /*the flags indicated inode type */
31         int sn_gen;             /*the inode generation*/
32         int sn_index;           /*the inode snap_index*/
33         ino_t sn_root_ino;        /*the root ino of this snap*/
34 };
35 struct smfs_inode_info {
36         struct inode *smi_inode;
37         __u32  smi_flags;
38         struct snap_inode_info sm_sninfo;
39 };
40
41 struct journal_operations {
42         void *(*tr_start)(struct inode *, int op);
43         void (*tr_commit)(void *handle);
44 };
45
46 struct sm_operations {
47         /* operations on the file store */
48         struct super_operations sm_sb_ops;
49         struct inode_operations sm_dir_iops;
50         struct inode_operations sm_file_iops;
51         struct inode_operations sm_sym_iops;
52         struct file_operations sm_dir_fops;
53         struct file_operations sm_file_fops;
54         struct file_operations sm_sym_fops;
55         struct dentry_operations sm_dentry_ops;
56         struct journal_operations sm_journal_ops;
57 };
58
59 /*smfs rec*/
60 typedef int (*smfs_pack_rec_func)(char *buffer, struct dentry *dentry,
61                                   struct inode *dir, void *data1,
62                                   void *data2, int op);
63 typedef enum {
64         PACK_NORMAL = 0,
65         PACK_OST = 1,
66         PACK_MDS = 2,
67         PACK_MAX = 3,
68 } pack_func_t;
69
70 struct mds_kml_pack_info {
71         int mpi_bufcount;
72         int mpi_size[4];
73         int mpi_total_size;
74 };
75 typedef int (*smfs_hook_func)(struct inode *inode, struct dentry *dentry,
76                              void *data1, void *data2, int op, void *handle);
77 struct smfs_hook_ops {
78         struct list_head smh_list;
79         char *           smh_name;
80         smfs_hook_func   smh_post_op;
81         smfs_hook_func   smh_pre_op;
82 };
83 struct smfs_super_info {
84         struct super_block       *smsi_sb;
85         struct vfsmount          *smsi_mnt;         /* mount the cache kern */
86         struct fsfilt_operations *sm_cache_fsfilt;  /* fsfilt operations */
87         struct fsfilt_operations *sm_fsfilt;        /* fsfilt operations */
88         struct sm_operations     *sm_ops;           /* cache ops */
89         struct lvfs_run_ctxt     *smsi_ctxt;
90         struct llog_ctxt         *smsi_rec_log;     /* smfs kml llog */
91         struct dentry            *smsi_logs_dir;
92         struct dentry            *smsi_objects_dir;
93         struct dentry            *smsi_delete_dir;  /* for delete inode dir */
94         char                     *smsi_cache_ftype; /* cache file system type */
95         char                     *smsi_ftype;       /* file system type */
96         struct obd_export        *smsi_exp;         /* file system obd exp */
97         struct snap_super_info   *smsi_snap_info;   /* snap table cow */
98         smfs_pack_rec_func       smsi_pack_rec[PACK_MAX]; /* sm_pack_rec type ops */
99         __u32                    smsi_flags;        /* flags */
100         __u32                    smsi_ops_check;
101         struct list_head         smsi_hook_list;
102         kmem_cache_t *           smsi_inode_cachep;  /*inode_cachep*/
103 };
104
105
106 #define SMFS_FILE_TYPE         "smfs"
107 #define SMFS_FILE_MAGIC        0x19760218
108
109 struct smfs_file_info {
110         struct file        *c_file;
111         int                 magic;
112 };
113
114 struct smfs_proc_args {
115         struct super_block *sr_sb;
116         int                 sr_count;
117         int                 sr_flags;
118         void               *sr_data;
119 };
120 struct fs_extent{
121         __u32   e_block;        /* first logical block extent covers */
122         __u32   e_start;        /* first physical block extents lives */
123         __u32   e_num;          /* number of blocks covered by extent */
124 };
125
126 #define I2SMI(inode)  ((struct smfs_inode_info *) ((inode->u.generic_ip)))
127
128 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
129 #define S2SMI(sb)   ((struct smfs_super_info *) ((sb->u.generic_sbp)))
130 #define S2CSB(sb)   (((struct smfs_super_info *)((sb->u.generic_sbp)))->smsi_sb)
131 #else
132 #define S2SMI(sb)   ((struct smfs_super_info *) (sb->s_fs_info))
133 #define S2CSB(sb)   (((struct smfs_super_info *) (sb->s_fs_info))->smsi_sb)
134 #endif
135
136 #define I2CI(inode) (((struct smfs_inode_info*) ((inode->u.generic_ip)))->smi_inode)
137
138 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
139 #define I2CSB(inode) ((struct smfs_super_info *) ((inode->i_sb->u.generic_sbp)))
140 #else
141 #define I2CSB(inode) ((struct smfs_super_info *) (inode->i_sb->s_fs_info))
142 #endif
143
144 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
145 #define I2FOPS(inode) (((struct smfs_super_info *) \
146                         ((inode->i_sb->u.generic_sbp)))->sm_cache_fsfilt)
147 #else
148 #define I2FOPS(inode) (((struct smfs_super_info *) \
149                         (inode->i_sb->s_fs_info))->sm_cache_fsfilt)
150 #endif
151
152 #define I2SNAPI(inode) (&(I2SMI(inode)->sm_sninfo))
153 #define I2SNAPCOPS(inode) ((S2SMI(inode->i_sb))->smsi_snap_info->snap_cache_fsfilt) 
154 #define I2SNAPOPS(inode) ((S2SMI(inode->i_sb))->smsi_snap_info->snap_fsfilt) 
155
156 #define S2SNAPI(sb) (S2SMI(sb)->smsi_snap_info)
157 #define F2SMFI(file) ((struct smfs_file_info *)((file->private_data)))
158 #define F2CF(file) (((struct smfs_file_info *) ((file->private_data)))->c_file)
159 #define SIZE2BLKS(size, inode) ((size + (I2CI(inode)->i_blksize)) >> (I2CI(inode)->i_blkbits))
160 #define OFF2BLKS(off, inode) (off >> (I2CI(inode)->i_blkbits))
161
162 #define SM_DO_REC               0x1
163 #define SM_INIT_REC             0x2
164 #define SM_CACHE_HOOK           0x4
165 #define SM_OVER_WRITE           0x8
166 #define SM_DIRTY_WRITE          0x10
167 #define SM_DO_COW               0x20
168 #define SM_DO_COWED             0x40
169
170 #define SMFS_DO_REC(smfs_info) (smfs_info->smsi_flags & SM_DO_REC)
171 #define SMFS_SET_REC(smfs_info) (smfs_info->smsi_flags |= SM_DO_REC)
172 #define SMFS_CLEAN_REC(smfs_info) (smfs_info->smsi_flags &= ~SM_DO_REC)
173
174 #define SMFS_INIT_REC(smfs_info) (smfs_info->smsi_flags & SM_INIT_REC)
175 #define SMFS_SET_INIT_REC(smfs_info) (smfs_info->smsi_flags |= SM_INIT_REC)
176 #define SMFS_CLEAN_INIT_REC(smfs_info) (smfs_info->smsi_flags &= ~SM_INIT_REC)
177
178 #define SMFS_SET_INODE_REC(inode) (I2SMI(inode)->smi_flags |= SM_DO_REC)
179 #define SMFS_DO_INODE_REC(inode) (I2SMI(inode)->smi_flags & SM_DO_REC)
180 #define SMFS_CLEAN_INODE_REC(inode) (I2SMI(inode)->smi_flags &= ~SM_DO_REC)
181
182 #define SMFS_CACHE_HOOK(smfs_info) (smfs_info->smsi_flags & SM_CACHE_HOOK)
183 #define SMFS_SET_CACHE_HOOK(smfs_info) (smfs_info->smsi_flags |= SM_CACHE_HOOK)
184 #define SMFS_CLEAN_CACHE_HOOK(smfs_info) (smfs_info->smsi_flags &= ~SM_CACHE_HOOK)
185
186 #define SMFS_INODE_CACHE_HOOK(inode) (I2SMI(inode)->smi_flags & SM_CACHE_HOOK)
187 #define SMFS_SET_INODE_CACHE_HOOK(inode) (I2SMI(inode)->smi_flags |= SM_CACHE_HOOK)
188 #define SMFS_CLEAN_INODE_CACHE_HOOK(inode) (I2SMI(inode)->smi_flags &= ~SM_CACHE_HOOK)
189
190 #define SMFS_INODE_OVER_WRITE(inode) (I2SMI(inode)->smi_flags & SM_OVER_WRITE)
191 #define SMFS_SET_INODE_OVER_WRITE(inode) (I2SMI(inode)->smi_flags |= SM_OVER_WRITE)
192 #define SMFS_CLEAN_INODE_OVER_WRITE(inode) (I2SMI(inode)->smi_flags &= ~SM_OVER_WRITE)
193
194 #define SMFS_INODE_DIRTY_WRITE(inode) (I2SMI(inode)->smi_flags & SM_DIRTY_WRITE)
195 #define SMFS_SET_INODE_DIRTY_WRITE(inode) (I2SMI(inode)->smi_flags |= SM_DIRTY_WRITE)
196 #define SMFS_CLEAN_INODE_DIRTY_WRITE(inode) (I2SMI(inode)->smi_flags &= ~SM_DIRTY_WRITE)
197
198 #define SMFS_DO_COW(smfs_info) (smfs_info->smsi_flags & SM_DO_COW)
199 #define SMFS_SET_COW(smfs_info) (smfs_info->smsi_flags |= SM_DO_COW)
200 #define SMFS_CLEAN_COW(smfs_info) (smfs_info->smsi_flags &= ~SM_DO_COW)
201
202 #define SMFS_SET_INODE_COW(inode) (I2SMI(inode)->smi_flags |= SM_DO_COW)
203 #define SMFS_DO_INODE_COW(inode) (I2SMI(inode)->smi_flags & SM_DO_COW)
204 #define SMFS_CLEAN_INODE_COW(inode) (I2SMI(inode)->smi_flags &= ~SM_DO_COW)
205
206 #define SMFS_SET_INODE_COWED(inode) (I2SMI(inode)->smi_flags |= SM_DO_COWED)
207 #define SMFS_DO_INODE_COWED(inode) (I2SMI(inode)->smi_flags & SM_DO_COWED)
208 #define SMFS_CLEAN_INODE_COWED(inode) (I2SMI(inode)->smi_flags &= ~SM_DO_COWED)
209
210
211 #define LVFS_SMFS_BACK_ATTR "lvfs_back_attr"
212
213
214 #define REC_COUNT_BIT       0
215 #define REC_COUNT_MASK      0x01 /*0001*/
216 #define REC_OP_BIT          1
217 #define REC_OP_MASK         0x06 /*0110*/
218 #define REC_WRITE_KML_BIT   3
219 #define REC_WRITE_KML_MASK  0x08 /*1000*/
220 #define REC_DEC_LINK_BIT    4
221 #define REC_DEC_LINK_MASK   0x10 /*10000* different with unlink*/
222 #define REC_GET_OID_BIT     5
223 #define REC_GET_OID_MASK    0x20 /*100000*/
224
225 #define REC_PACK_TYPE_BIT   6
226 #define REC_PACK_TYPE_MASK  0x1C0 /*111000000*/
227
228 #define SET_REC_COUNT_FLAGS(flag, count_flag) \
229                 (flag |= count_flag << REC_COUNT_BIT)
230 #define GET_REC_COUNT_FLAGS(flag) \
231                 ((flag & REC_COUNT_MASK) >> REC_COUNT_BIT)
232
233 #define SET_REC_OP_FLAGS(flag, op_flag) \
234                 (flag |= op_flag << REC_OP_BIT)
235 #define GET_REC_OP_FLAGS(flag) \
236                 ((flag & REC_OP_MASK) >> REC_OP_BIT)
237
238 #define SET_REC_WRITE_KML_FLAGS(flag, op_flag) \
239                 (flag |= op_flag << REC_OP_BIT)
240 #define GET_REC_WRITE_KML_FLAGS(flag) \
241                 ((flag & REC_WRITE_KML_MASK) >> REC_WRITE_KML_BIT)
242
243 #define SET_REC_DEC_LINK_FLAGS(flag, op_flag) \
244                 (flag |= op_flag << REC_DEC_LINK_BIT)
245 #define GET_REC_DEC_LINK_FLAGS(flag) \
246                 ((flag & REC_DEC_LINK_MASK) >> REC_DEC_LINK_BIT)
247
248 #define SET_REC_GET_ID_FLAGS(flag, op_flag) \
249                 (flag |= op_flag << REC_GET_OID_BIT)
250 #define GET_REC_GET_OID_FLAGS(flag) \
251                 ((flag & REC_GET_OID_MASK) >> REC_GET_OID_BIT)
252
253 #define SET_REC_PACK_TYPE_INDEX(flag, op_flag) \
254                 (flag |= op_flag << REC_PACK_TYPE_BIT)
255 #define GET_REC_PACK_TYPE_INDEX(flag) \
256                 ((flag & REC_PACK_TYPE_MASK) >> REC_PACK_TYPE_BIT)
257
258 #define SMFS_REC_ALL             0x1
259 #define SMFS_REC_BY_COUNT        0x0
260
261 #define SMFS_REINT_REC           0x1
262 #define SMFS_UNDO_REC            0x2
263
264 #define SMFS_WRITE_KML           0x1
265 #define SMFS_DEC_LINK            0x1
266 #define SMFS_GET_OID             0x1
267
268 #define SMFS_DO_REINT_REC(flag) \
269          (GET_REC_OP_FLAGS(flag) == SMFS_REINT_REC)
270 #define SMFS_DO_UNDO_REC(flag) \
271          (GET_REC_OP_FLAGS(flag) == SMFS_UNDO_REC)
272 #define SMFS_DO_REC_ALL(flag) \
273         (GET_REC_COUNT_FLAGS(flag) == SMFS_REC_ALL)
274 #define SMFS_DO_REC_BY_COUNT(flag) \
275         (GET_REC_COUNT_FLAGS(flag) == SMFS_REC_BY_COUNT)
276 #define SMFS_DO_WRITE_KML(flag) \
277         (GET_REC_WRITE_KML_FLAGS(flag) == SMFS_WRITE_KML)
278 #define SMFS_DO_DEC_LINK(flag) \
279         (GET_REC_DEC_LINK_FLAGS(flag) == SMFS_DEC_LINK)
280
281 #define SMFS_DO_GET_OID(flag) \
282         (GET_REC_GET_OID_FLAGS(flag) == SMFS_GET_OID)
283
284 /*DIRTY flags of write ops*/
285 #define REINT_EXTENTS_FLAGS         "replay_flags"
286 #define SMFS_DIRTY_WRITE        0x01
287 #define SMFS_OVER_WRITE         0x02
288
289
290 static inline void duplicate_inode(struct inode *dst_inode,
291                                    struct inode *src_inode)
292 {
293         dst_inode->i_mode = src_inode->i_mode;
294         dst_inode->i_uid = src_inode->i_uid;
295         dst_inode->i_gid = src_inode->i_gid;
296         dst_inode->i_nlink = src_inode->i_nlink;
297         dst_inode->i_size = src_inode->i_size;
298         dst_inode->i_atime = src_inode->i_atime;
299         dst_inode->i_ctime = src_inode->i_ctime;
300         dst_inode->i_mtime = src_inode->i_mtime;
301         dst_inode->i_blksize = src_inode->i_blksize;
302         dst_inode->i_version = src_inode->i_version;
303         dst_inode->i_state = src_inode->i_state;
304         dst_inode->i_generation = src_inode->i_generation;
305
306         /* This is to make creating special files working. */
307         dst_inode->i_rdev = src_inode->i_rdev;
308 }
309
310 static inline void post_smfs_inode(struct inode *inode,
311                                    struct inode *cache_inode)
312 {
313         if (inode && cache_inode) {
314                 duplicate_inode(inode, cache_inode);
315                 /*Here we must release the cache_inode,
316                  *Otherwise we will have no chance to
317                  *do it
318                  */
319                 cache_inode->i_state &=~I_LOCK;
320                 inode->i_blocks = cache_inode->i_blocks;
321         }
322 }
323
324 static inline void pre_smfs_inode(struct inode *inode,
325                                   struct inode *cache_inode)
326 {
327         if (inode && cache_inode)
328                 duplicate_inode(cache_inode, inode);
329 }
330
331 /* instantiate a file handle to the cache file */
332 static inline void duplicate_file(struct file *dst_file, struct file *src_file)
333 {
334         if (dst_file && src_file) {
335                 dst_file->f_pos = src_file->f_pos;
336                 dst_file->f_mode = src_file->f_mode;
337                 dst_file->f_flags = src_file->f_flags;
338                 dst_file->f_owner  = src_file->f_owner;
339                 dst_file->f_vfsmnt = src_file->f_vfsmnt;
340
341         #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
342                 dst_file->f_reada = src_file->f_reada;
343                 dst_file->f_ramax = src_file->f_ramax;
344                 dst_file->f_raend = src_file->f_raend;
345                 dst_file->f_ralen = src_file->f_ralen;
346                 dst_file->f_rawin = src_file->f_rawin;
347         #else
348                 dst_file->f_ra = src_file->f_ra;
349         #endif
350         }
351 }
352
353 static inline void duplicate_sb(struct super_block *dst_sb,
354                                 struct super_block *src_sb)
355 {
356         dst_sb->s_blocksize = src_sb->s_blocksize;
357         dst_sb->s_magic = src_sb->s_magic;
358         dst_sb->s_blocksize_bits = src_sb->s_blocksize_bits;
359         dst_sb->s_maxbytes = src_sb->s_maxbytes;
360         dst_sb->s_flags = src_sb->s_flags;
361 }
362
363 static inline void d_unalloc(struct dentry *dentry)
364 {
365 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
366         list_del(&dentry->d_hash);
367         INIT_LIST_HEAD(&dentry->d_hash);
368 #else
369         hlist_del_init(&dentry->d_hash);
370         dentry->d_flags |= DCACHE_UNHASHED;
371 #endif
372         dput(dentry); /* this will free the dentry memory */
373 }
374
375 static inline int smfs_get_dentry_name_index(struct dentry *dentry,
376                                              struct qstr  *str,
377                                              int *index)
378 {
379         char *name = (char *)dentry->d_name.name;
380         unsigned long hash;
381         unsigned char c;
382         char *str_name;
383         int len = 0, name_len = 0;
384
385         name_len = dentry->d_name.len;
386         if (!name_len)
387                 return 0;
388         hash = init_name_hash();
389         while (name_len--) {
390                 c = *(const unsigned char *)name++;
391                 if (c == ':' || c == '\0')
392                         break;
393                 hash = partial_name_hash(c, hash);
394                 len ++;
395         }
396         str->hash = end_name_hash(hash);
397         OBD_ALLOC(str_name, len + 1);
398         memcpy(str_name, dentry->d_name.name, len);
399         str->len = len; 
400         str->name = str_name;
401         if (index && c == ':') {
402                 *index = simple_strtoul(name, 0, 0);         
403         }
404         return 0;
405 }
406
407 static inline void smfs_free_dentry_name(struct qstr *str)
408 {
409         char *name = (char*)str->name;
410         OBD_FREE(name, str->len + 1);
411 }
412
413 static inline struct dentry *pre_smfs_dentry(struct dentry *parent_dentry,
414                                              struct inode *cache_inode,
415                                              struct dentry *dentry)
416 {
417         struct dentry *cache_dentry = NULL;
418         
419         cache_dentry = d_alloc(parent_dentry, &dentry->d_name);
420         if (!cache_dentry)
421                 RETURN(NULL);
422         if (!parent_dentry)
423                 cache_dentry->d_parent = cache_dentry;
424         if (cache_inode)
425                 d_add(cache_dentry, cache_inode);
426         RETURN(cache_dentry);
427 }
428
429 static inline void post_smfs_dentry(struct dentry *cache_dentry)
430 {
431         if (!cache_dentry)
432                 return;
433         if (cache_dentry->d_inode)
434                 igrab(cache_dentry->d_inode);
435         d_unalloc(cache_dentry);
436 }
437
438 static inline int lookup_by_path(char *path, int flags, struct nameidata *nd)
439 {
440         struct dentry *dentry = NULL;
441         int rc = 0;
442
443 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
444         if (path_init(path, flags, nd)) {
445 #else
446         if (path_lookup(path, flags, nd)) {
447 #endif
448                 rc = path_walk(path, nd);
449                 if (rc)
450                         RETURN(rc);
451         } else {
452                 RETURN(-EINVAL);
453         }
454
455         dentry = nd->dentry;
456
457         if (!dentry->d_inode || is_bad_inode(dentry->d_inode)) {
458                 path_release(nd);
459                 RETURN(-ENODEV);
460         }
461         RETURN(rc);
462 }
463
464 /*FIXME there should be more conditions in this check*/
465 static inline int smfs_do_rec(struct inode *inode)
466 {
467         struct super_block *sb = inode->i_sb;
468         struct smfs_super_info *smfs_info = S2SMI(sb);
469
470         if (SMFS_DO_REC(smfs_info) && SMFS_INIT_REC(smfs_info) &&
471             SMFS_DO_INODE_REC(inode))
472                 return 1;
473         return 0;
474 }
475
476 static inline int smfs_cache_hook(struct inode *inode)
477 {
478         struct smfs_super_info  *smfs_info = I2CSB(inode);
479
480         if (SMFS_CACHE_HOOK(smfs_info) && SMFS_INIT_REC(smfs_info) &&
481             SMFS_INODE_CACHE_HOOK(inode))
482                 return 1;
483         else
484                 return 0;
485 }
486
487 static inline int smfs_do_cow(struct inode *inode)
488 {
489         struct super_block *sb = inode->i_sb;
490         struct smfs_super_info *smfs_info = S2SMI(sb);
491
492         if (SMFS_DO_COW(smfs_info) && SMFS_DO_INODE_COW(inode))
493                 return 1;
494         return 0;
495 }
496
497
498 /* XXX BUG 3188 -- must return to one set of opcodes */
499 #define SMFS_TRANS_OP(inode, op)                \
500 {                                               \
501         if (smfs_do_rec(inode))                 \
502                 op = op | 0x10;                 \
503         if (smfs_cache_hook(inode))             \
504                 op = op | 0x20;                 \
505 }
506
507 extern int smfs_start_rec(struct super_block *sb, struct vfsmount *mnt);
508 extern int smfs_stop_rec(struct super_block *sb);
509 extern int smfs_write_extents(struct inode *dir, struct dentry *dentry,
510                               unsigned long from, unsigned long num);
511 extern int smfs_rec_setattr(struct inode *dir, struct dentry *dentry,
512                             struct iattr *attr);
513 extern int smfs_rec_precreate(struct dentry *dentry, int *num, struct obdo *oa);
514 extern int smfs_rec_md(struct inode *inode, void * lmm, int lmm_size);
515 extern int smfs_rec_unpack(struct smfs_proc_args *args, char *record,
516                            char **pbuf, int *opcode);
517         
518
519 extern int smfs_post_setup(struct super_block *sb, struct vfsmount *mnt);
520 extern int smfs_post_cleanup(struct super_block *sb);
521 extern struct inode *smfs_get_inode (struct super_block *sb, ino_t hash,
522                                      struct inode *dir, int index);
523
524 extern int is_smfs_sb(struct super_block *sb);
525 #endif /* _LUSTRE_SMFS_H */