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