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