1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * lustre/lib/fsfilt_smfs.c
5 * Lustre filesystem abstraction routines
7 * Copyright (C) 2004 Cluster File Systems, Inc.
8 * Author: Wang Di <wangdi@clusterfs.com>
10 * This file is part of Lustre, http://www.lustre.org.
12 * Lustre is free software; you can redistribute it and/or
13 * modify it under the terms of version 2 of the GNU General Public
14 * License as published by the Free Software Foundation.
16 * Lustre is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with Lustre; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #define DEBUG_SUBSYSTEM S_FILTER
29 #include <linux/jbd.h>
30 #include <linux/slab.h>
31 #include <linux/pagemap.h>
32 #include <linux/quotaops.h>
33 #include <linux/version.h>
34 #include <linux/kp30.h>
35 #include <linux/lustre_fsfilt.h>
36 #include <linux/lustre_smfs.h>
37 #include <linux/obd.h>
38 #include <linux/obd_class.h>
39 #include <linux/module.h>
40 #include <linux/init.h>
42 #include <linux/lustre_snap.h>
43 #include <linux/lustre_smfs.h>
44 static void *fsfilt_smfs_start(struct inode *inode, int op,
45 void *desc_private, int logs)
48 struct inode *cache_inode = I2CI(inode);
49 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
51 if (cache_fsfilt == NULL)
54 SMFS_TRANS_OP(inode, op);
56 if (!cache_fsfilt->fs_start)
57 return ERR_PTR(-ENOSYS);
59 handle = cache_fsfilt->fs_start(cache_inode, op, desc_private, logs);
63 static void *fsfilt_smfs_brw_start(int objcount, struct fsfilt_objinfo *fso,
64 int niocount, struct niobuf_local *nb,
65 void *desc_private, int logs)
67 struct fsfilt_operations *cache_fsfilt;
68 struct dentry *cache_dentry = NULL;
69 struct inode *cache_inode = NULL;
70 struct fsfilt_objinfo cache_fso;
74 cache_fsfilt = I2FOPS(fso->fso_dentry->d_inode);
75 if (cache_fsfilt == NULL)
78 cache_inode = I2CI(fso->fso_dentry->d_inode);
79 cache_dentry = pre_smfs_dentry(NULL, cache_inode, fso->fso_dentry);
82 GOTO(exit, rc = ERR_PTR(-ENOMEM));
84 cache_fso.fso_dentry = cache_dentry;
85 cache_fso.fso_bufcnt = fso->fso_bufcnt;
87 if (!cache_fsfilt->fs_brw_start)
88 return ERR_PTR(-ENOSYS);
90 rc = cache_fsfilt->fs_brw_start(objcount, &cache_fso, niocount, nb,
93 post_smfs_dentry(cache_dentry);
97 /* FIXME-WANGDI: here we can easily have inode == NULL due to
98 mds_open() behavior. It passes NULL inode to mds_finish_transno()
99 sometimes. Probably we should have spare way to get cache fsfilt
101 static int fsfilt_smfs_commit(struct super_block *sb, struct inode *inode,
102 void *h, int force_sync)
104 struct fsfilt_operations *cache_fsfilt = S2SMI(sb)->sm_cache_fsfilt;
105 struct super_block *csb = S2CSB(sb);
106 struct inode *cache_inode = NULL;
110 cache_inode = I2CI(inode);
112 if (cache_fsfilt == NULL)
115 if (!cache_fsfilt->fs_commit)
118 rc = cache_fsfilt->fs_commit(csb, cache_inode, h, force_sync);
123 static int fsfilt_smfs_commit_async(struct inode *inode, void *h,
126 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
127 struct inode *cache_inode = NULL;
130 cache_inode = I2CI(inode);
131 if (cache_fsfilt == NULL)
134 if (!cache_fsfilt->fs_commit_async)
137 rc = cache_fsfilt->fs_commit_async(cache_inode, h, wait_handle);
142 static int fsfilt_smfs_commit_wait(struct inode *inode, void *h)
144 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
145 struct inode *cache_inode = NULL;
148 cache_inode = I2CI(inode);
149 if (cache_fsfilt == NULL)
152 if (!cache_fsfilt->fs_commit_wait)
155 rc = cache_fsfilt->fs_commit_wait(cache_inode, h);
160 static int fsfilt_smfs_setattr(struct dentry *dentry, void *handle,
161 struct iattr *iattr, int do_trunc)
163 struct fsfilt_operations *cache_fsfilt = I2FOPS(dentry->d_inode);
164 struct dentry *cache_dentry = NULL;
165 struct inode *cache_inode = NULL;
171 cache_inode = I2CI(dentry->d_inode);
173 cache_dentry = pre_smfs_dentry(NULL, cache_inode, dentry);
175 GOTO(exit, rc = -ENOMEM);
177 pre_smfs_inode(dentry->d_inode, cache_inode);
179 if (!cache_fsfilt->fs_setattr)
182 rc = cache_fsfilt->fs_setattr(cache_dentry, handle, iattr, do_trunc);
184 post_smfs_inode(dentry->d_inode, cache_inode);
187 struct super_block *sb = dentry->d_inode->i_sb;
189 if (SMFS_DO_REC(S2SMI(sb)) &&
190 SMFS_DO_INODE_REC(dentry->d_inode)) {
191 rc = smfs_rec_setattr(dentry->d_inode, dentry, iattr);
195 post_smfs_dentry(cache_dentry);
199 static int fsfilt_smfs_iocontrol(struct inode *inode, struct file *file,
200 unsigned int cmd, unsigned long arg)
202 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
203 struct inode *cache_inode = NULL;
204 struct smfs_file_info *sfi = NULL;
211 cache_inode = I2CI(inode);
219 if (sfi->magic != SMFS_FILE_MAGIC)
225 if (!cache_fsfilt->fs_iocontrol)
229 rc = cache_fsfilt->fs_iocontrol(cache_inode, sfi->c_file, cmd,
232 rc = cache_fsfilt->fs_iocontrol(cache_inode, NULL, cmd, arg);
235 /* FIXME-UMKA: Should this be in duplicate_inode()? */
236 if (rc == 0 && cmd == EXT3_IOC_SETFLAGS)
237 inode->i_flags = cache_inode->i_flags;
239 post_smfs_inode(inode, cache_inode);
244 static int fsfilt_smfs_set_md(struct inode *inode, void *handle,
245 void *lmm, int lmm_size)
247 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
248 struct inode *cache_inode = NULL;
254 cache_inode = I2CI(inode);
259 pre_smfs_inode(inode, cache_inode);
261 if (!cache_fsfilt->fs_set_md)
264 down(&cache_inode->i_sem);
265 rc = cache_fsfilt->fs_set_md(cache_inode, handle, lmm, lmm_size);
266 up(&cache_inode->i_sem);
268 post_smfs_inode(inode, cache_inode);
270 smfs_rec_md(inode, lmm, lmm_size);
275 /* Must be called with i_sem held */
276 static int fsfilt_smfs_get_md(struct inode *inode, void *lmm, int lmm_size)
278 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
279 struct inode *cache_inode = NULL;
285 cache_inode = I2CI(inode);
290 pre_smfs_inode(inode, cache_inode);
292 if (!cache_fsfilt->fs_get_md)
295 down(&cache_inode->i_sem);
296 rc = cache_fsfilt->fs_get_md(cache_inode, lmm, lmm_size);
297 up(&cache_inode->i_sem);
299 post_smfs_inode(inode, cache_inode);
304 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
305 static int fsfilt_smfs_send_bio(struct inode *inode, struct bio *bio)
307 static int fsfilt_smfs_send_bio(struct inode *inode, struct kiobuf *bio)
310 struct inode *cache_inode;
311 struct fsfilt_operations *cache_fsfilt;
313 cache_fsfilt = I2FOPS(inode);
317 cache_inode = I2CI(inode);
321 if (!cache_fsfilt->fs_send_bio)
324 return cache_fsfilt->fs_send_bio(cache_inode, bio);
328 fsfilt_smfs_getpage(struct inode *inode, long int index)
330 struct fsfilt_operations *cache_fsfilt;
331 struct inode *cache_inode;
333 cache_fsfilt = I2FOPS(inode);
335 RETURN(ERR_PTR(-EINVAL));
337 cache_inode = I2CI(inode);
339 RETURN(ERR_PTR(-EINVAL));
341 if (!cache_fsfilt->fs_getpage)
342 RETURN(ERR_PTR(-ENOSYS));
344 return cache_fsfilt->fs_getpage(cache_inode, index);
347 static ssize_t fsfilt_smfs_readpage(struct file *file, char *buf,
348 size_t count, loff_t *off)
350 struct fsfilt_operations *cache_fsfilt;
351 struct smfs_file_info *sfi;
352 struct inode *cache_inode;
359 cache_fsfilt = I2FOPS(file->f_dentry->d_inode);
363 cache_inode = I2CI(file->f_dentry->d_inode);
368 if (sfi->magic != SMFS_FILE_MAGIC)
371 if (off != &(file->f_pos))
372 cache_ppos = &tmp_ppos;
374 cache_ppos = &sfi->c_file->f_pos;
377 pre_smfs_inode(file->f_dentry->d_inode, cache_inode);
379 if (cache_fsfilt->fs_readpage)
380 rc = cache_fsfilt->fs_readpage(sfi->c_file, buf, count,
384 post_smfs_inode(file->f_dentry->d_inode, cache_inode);
385 duplicate_file(file, sfi->c_file);
391 static int fsfilt_smfs_add_journal_cb(struct obd_device *obd,
392 struct super_block *sb, __u64 last_rcvd,
393 void *handle, fsfilt_cb_t cb_func,
396 struct fsfilt_operations *cache_fsfilt = S2SMI(sb)->sm_cache_fsfilt;
397 struct super_block *csb = S2CSB(sb);
402 if (cache_fsfilt->fs_add_journal_cb)
403 rc = cache_fsfilt->fs_add_journal_cb(obd, csb, last_rcvd,
404 handle, cb_func, cb_data);
408 static int fsfilt_smfs_statfs(struct super_block *sb, struct obd_statfs *osfs)
410 struct fsfilt_operations *cache_fsfilt = S2SMI(sb)->sm_cache_fsfilt;
411 struct super_block *csb = S2CSB(sb);
417 if (!cache_fsfilt->fs_statfs)
420 rc = cache_fsfilt->fs_statfs(csb, osfs);
421 duplicate_sb(csb, sb);
426 static int fsfilt_smfs_sync(struct super_block *sb)
428 struct fsfilt_operations *cache_fsfilt = S2SMI(sb)->sm_cache_fsfilt;
429 struct super_block *csb = S2CSB(sb);
435 if (!cache_fsfilt->fs_sync)
438 rc = cache_fsfilt->fs_sync(csb);
443 int fsfilt_smfs_map_inode_pages(struct inode *inode, struct page **page,
444 int pages, unsigned long *blocks, int *created,
445 int create, struct semaphore *sem)
447 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
448 struct inode *cache_inode = NULL;
454 cache_inode = I2CI(inode);
459 if (!cache_fsfilt->fs_map_inode_pages)
462 down(&cache_inode->i_sem);
463 rc = cache_fsfilt->fs_map_inode_pages(cache_inode, page, pages, blocks,
464 created, create, sem);
465 up(&cache_inode->i_sem);
470 static int fsfilt_smfs_prep_san_write(struct inode *inode, long *blocks,
471 int nblocks, loff_t newsize)
473 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
474 struct inode *cache_inode = NULL;
480 cache_inode = I2CI(inode);
485 if (!cache_fsfilt->fs_prep_san_write)
488 down(&cache_inode->i_sem);
489 rc = cache_fsfilt->fs_prep_san_write(cache_inode, blocks, nblocks,
491 up(&cache_inode->i_sem);
496 static int fsfilt_smfs_read_record(struct file * file, void *buf,
497 int size, loff_t *offs)
499 struct fsfilt_operations *cache_fsfilt;
500 struct inode *cache_inode;
501 struct smfs_file_info *sfi;
507 cache_fsfilt = I2FOPS(file->f_dentry->d_inode);
511 cache_inode = I2CI(file->f_dentry->d_inode);
517 if (sfi->magic != SMFS_FILE_MAGIC) BUG();
519 if (offs != &(file->f_pos))
520 cache_ppos = &tmp_ppos;
522 cache_ppos = &sfi->c_file->f_pos;
525 pre_smfs_inode(file->f_dentry->d_inode, cache_inode);
527 if (!cache_fsfilt->fs_read_record)
530 rc = cache_fsfilt->fs_read_record(sfi->c_file, buf, size, cache_ppos);
533 post_smfs_inode(file->f_dentry->d_inode, cache_inode);
534 duplicate_file(file, sfi->c_file);
539 static int fsfilt_smfs_write_record(struct file *file, void *buf, int bufsize,
540 loff_t *offs, int force_sync)
542 struct fsfilt_operations *cache_fsfilt;
543 struct inode *cache_inode;
544 struct smfs_file_info *sfi;
551 cache_fsfilt = I2FOPS(file->f_dentry->d_inode);
555 cache_inode = I2CI(file->f_dentry->d_inode);
561 if (sfi->magic != SMFS_FILE_MAGIC)
564 if (offs != &(file->f_pos))
565 cache_ppos = &tmp_ppos;
567 cache_ppos = &sfi->c_file->f_pos;
570 pre_smfs_inode(file->f_dentry->d_inode, cache_inode);
572 if (!cache_fsfilt->fs_write_record)
575 rc = cache_fsfilt->fs_write_record(sfi->c_file, buf,
576 bufsize, cache_ppos, force_sync);
578 post_smfs_inode(file->f_dentry->d_inode, cache_inode);
579 duplicate_file(file, sfi->c_file);
584 static int fsfilt_smfs_post_setup(struct obd_device *obd, struct vfsmount *mnt)
586 struct super_block *sb = NULL;
591 S2SMI(sb)->smsi_exp = obd->obd_self_export;
592 if (SMFS_DO_REC(S2SMI(sb)))
593 rc = smfs_start_rec(sb, mnt);
597 obd->obd_llog_ctxt[LLOG_REINT_ORIG_CTXT] =
598 S2SMI(sb)->smsi_rec_log;
602 CERROR("can not do post setup in obd %p rc=%d", obd, rc);
607 static int fsfilt_smfs_post_cleanup(struct obd_device *obd,
608 struct vfsmount *mnt)
610 struct super_block *sb = NULL;
615 if (SMFS_DO_REC(S2SMI(sb)))
616 rc = smfs_stop_rec(sb);
621 static int fsfilt_smfs_set_fs_flags(struct inode *inode, int flags)
624 if (SMFS_DO_REC(S2SMI(inode->i_sb)) && (flags & SM_DO_REC))
625 SMFS_SET_INODE_REC(inode);
626 if (SMFS_DO_COW(S2SMI(inode->i_sb)) && (flags & SM_DO_COW))
627 SMFS_SET_INODE_COW(inode);
631 static int fsfilt_smfs_clear_fs_flags(struct inode *inode, int flags)
634 if (SMFS_DO_REC(S2SMI(inode->i_sb)) && (flags & SM_DO_REC))
635 SMFS_CLEAN_INODE_REC(inode);
636 if (SMFS_DO_COW(S2SMI(inode->i_sb)) && (flags & SM_DO_COW))
637 SMFS_CLEAN_INODE_COW(inode);
641 static int fsfilt_smfs_set_ost_flags(struct super_block *sb)
644 SET_REC_PACK_TYPE_INDEX(S2SMI(sb)->smsi_flags, PACK_OST);
648 static int fsfilt_smfs_set_mds_flags(struct super_block *sb)
651 SET_REC_PACK_TYPE_INDEX(S2SMI(sb)->smsi_flags, PACK_MDS);
655 static int fsfilt_smfs_get_reint_log_ctxt(struct super_block *sb,
656 struct llog_ctxt **ctxt)
658 struct smfs_super_info *smfs_info = S2SMI(sb);
661 *ctxt = smfs_info->smsi_rec_log;
665 static int fsfilt_smfs_setup(struct obd_device *obd, struct super_block *sb)
667 struct smfs_super_info *smfs_info = S2SMI(sb);
668 struct fsfilt_operations *cache_fsfilt;
669 struct super_block *csb;
672 /* It should be initialized olready by smfs_read_super(). */
673 if (!(cache_fsfilt = smfs_info->sm_cache_fsfilt))
674 cache_fsfilt = fsfilt_get_ops(smfs_info->smsi_cache_ftype);
680 if (cache_fsfilt->fs_setup)
681 rc = cache_fsfilt->fs_setup(obd, csb);
683 duplicate_sb(sb, csb);
688 static int fsfilt_smfs_set_xattr(struct inode *inode, void *handle, char *name,
689 void *buffer, int buffer_size)
691 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
692 struct inode *cache_inode = NULL;
698 cache_inode = I2CI(inode);
702 pre_smfs_inode(inode, cache_inode);
704 if (cache_fsfilt->fs_set_xattr)
705 rc = cache_fsfilt->fs_set_xattr(cache_inode, handle, name,
706 buffer, buffer_size);
707 post_smfs_inode(inode, cache_inode);
712 static int fsfilt_smfs_get_xattr(struct inode *inode, char *name,
713 void *buffer, int buffer_size)
715 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
716 struct inode *cache_inode = NULL;
722 cache_inode = I2CI(inode);
726 pre_smfs_inode(inode, cache_inode);
728 if (cache_fsfilt->fs_get_xattr)
729 rc = cache_fsfilt->fs_get_xattr(cache_inode, name,
730 buffer, buffer_size);
731 post_smfs_inode(inode, cache_inode);
736 static int fsfilt_smfs_insert_extents_ea(struct inode *inode,
737 unsigned long from, unsigned long num)
739 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
740 struct inode *cache_inode = NULL;
746 cache_inode = I2CI(inode);
750 pre_smfs_inode(inode, cache_inode);
752 if (cache_fsfilt->fs_insert_extents_ea)
753 rc = cache_fsfilt->fs_insert_extents_ea(cache_inode, from, num);
755 post_smfs_inode(inode, cache_inode);
759 static int fsfilt_smfs_remove_extents_ea(struct inode *inode,
760 unsigned long from, unsigned long num)
762 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
763 struct inode *cache_inode = NULL;
769 cache_inode = I2CI(inode);
773 pre_smfs_inode(inode, cache_inode);
775 if (cache_fsfilt->fs_remove_extents_ea)
776 rc = cache_fsfilt->fs_remove_extents_ea(cache_inode, from, num);
778 post_smfs_inode(inode, cache_inode);
782 static int fsfilt_smfs_init_extents_ea(struct inode *inode)
784 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
785 struct inode *cache_inode = NULL;
791 cache_inode = I2CI(inode);
795 pre_smfs_inode(inode, cache_inode);
797 if (cache_fsfilt->fs_init_extents_ea)
798 rc = cache_fsfilt->fs_init_extents_ea(cache_inode);
800 post_smfs_inode(inode, cache_inode);
804 static int fsfilt_smfs_free_extents(struct super_block *sb, ino_t ino,
805 char *pbuf, int size)
807 OBD_FREE(pbuf, size * (sizeof(struct ldlm_extent)));
811 static int fsfilt_smfs_write_extents(struct dentry *dentry,
812 unsigned long from, unsigned long num)
816 if (SMFS_DO_REC(S2SMI(dentry->d_inode->i_sb)))
817 rc = smfs_write_extents(dentry->d_inode, dentry, from, num);
822 static int fsfilt_smfs_precreate_rec(struct dentry *dentry, int *count,
827 if (SMFS_DO_REC(S2SMI(dentry->d_inode->i_sb)))
828 rc = smfs_rec_precreate(dentry, count, oa);
833 static int fsfilt_smfs_get_ino_write_extents(struct super_block *sb, ino_t ino,
834 char **pbuf, int *size)
836 struct fs_extent *fs_extents;
837 struct ldlm_extent *extents = NULL;
839 struct inode *cache_inode;
840 struct fsfilt_operations *cache_fsfilt = NULL;
841 struct lvfs_run_ctxt saved;
842 int rc = 0, fs_ex_size, ex_num, flags;
843 char *buf = NULL, *ex_buf = NULL;
845 push_ctxt(&saved, S2SMI(sb)->smsi_ctxt, NULL);
847 inode = iget(sb, ino);
849 if (!inode || is_bad_inode(inode)) {
850 CWARN("Can not get inode %lu ino\n", ino);
853 cache_inode = I2CI(inode);
854 cache_fsfilt = I2FOPS(inode);
856 rc = cache_fsfilt->fs_get_xattr(cache_inode, REINT_EXTENTS_FLAGS,
857 &flags, sizeof(int));
858 if (!(flags & SMFS_OVER_WRITE) && !(flags & SMFS_DIRTY_WRITE)) {
860 } else if (flags & SMFS_OVER_WRITE) {
862 OBD_ALLOC(ex_buf, sizeof(struct ldlm_extent));
864 GOTO(out, rc=-ENOMEM);
865 extents = (struct ldlm_extent*)(ex_buf);
867 extents->end = 0xffffffff;
871 rc = cache_fsfilt->fs_get_write_extents_num(cache_inode, &fs_ex_size);
874 OBD_ALLOC(buf, fs_ex_size);
876 GOTO(out, rc=-ENOMEM);
878 rc = cache_fsfilt->fs_get_inode_write_extents(cache_inode, &buf,
883 ex_num = fs_ex_size / sizeof(struct fs_extent);
885 OBD_ALLOC(ex_buf, ex_num* sizeof(struct ldlm_extent));
887 GOTO(out, rc=-ENOMEM);
889 fs_extents = (struct fs_extent*)(buf);
890 extents = (struct ldlm_extent*)(ex_buf);
892 int blk_size = I2CI(inode)->i_blksize;
894 extents->start = fs_extents->e_block * blk_size;
895 extents->end = extents->start + fs_extents->e_num * blk_size;
904 OBD_FREE(buf, fs_ex_size);
906 OBD_FREE(ex_buf, (*size) * (sizeof(struct ldlm_extent)));
907 pop_ctxt(&saved, S2SMI(sb)->smsi_ctxt, NULL);
911 static int fsfilt_smfs_set_snap_item(struct super_block *sb, char *name)
917 rc = smfs_add_snap_item(sb, name);
922 static struct fsfilt_operations fsfilt_smfs_ops = {
924 .fs_owner = THIS_MODULE,
925 .fs_start = fsfilt_smfs_start,
926 .fs_brw_start = fsfilt_smfs_brw_start,
927 .fs_commit = fsfilt_smfs_commit,
928 .fs_commit_async = fsfilt_smfs_commit_async,
929 .fs_commit_wait = fsfilt_smfs_commit_wait,
930 .fs_setattr = fsfilt_smfs_setattr,
931 .fs_iocontrol = fsfilt_smfs_iocontrol,
932 .fs_set_md = fsfilt_smfs_set_md,
933 .fs_get_md = fsfilt_smfs_get_md,
934 .fs_readpage = fsfilt_smfs_readpage,
935 .fs_getpage = fsfilt_smfs_getpage,
936 .fs_add_journal_cb = fsfilt_smfs_add_journal_cb,
937 .fs_statfs = fsfilt_smfs_statfs,
938 .fs_sync = fsfilt_smfs_sync,
939 .fs_map_inode_pages = fsfilt_smfs_map_inode_pages,
940 .fs_prep_san_write = fsfilt_smfs_prep_san_write,
941 .fs_write_record = fsfilt_smfs_write_record,
942 .fs_read_record = fsfilt_smfs_read_record,
943 .fs_setup = fsfilt_smfs_setup,
944 .fs_post_setup = fsfilt_smfs_post_setup,
945 .fs_post_cleanup = fsfilt_smfs_post_cleanup,
946 .fs_set_fs_flags = fsfilt_smfs_set_fs_flags,
947 .fs_clear_fs_flags = fsfilt_smfs_clear_fs_flags,
948 .fs_set_ost_flags = fsfilt_smfs_set_ost_flags,
949 .fs_set_mds_flags = fsfilt_smfs_set_mds_flags,
950 .fs_precreate_rec = fsfilt_smfs_precreate_rec,
951 .fs_get_reint_log_ctxt = fsfilt_smfs_get_reint_log_ctxt,
952 .fs_send_bio = fsfilt_smfs_send_bio,
953 .fs_set_xattr = fsfilt_smfs_set_xattr,
954 .fs_get_xattr = fsfilt_smfs_get_xattr,
955 .fs_init_extents_ea = fsfilt_smfs_init_extents_ea,
956 .fs_insert_extents_ea = fsfilt_smfs_insert_extents_ea,
957 .fs_remove_extents_ea = fsfilt_smfs_remove_extents_ea,
958 .fs_get_ino_write_extents = fsfilt_smfs_get_ino_write_extents,
959 .fs_free_write_extents = fsfilt_smfs_free_extents,
960 .fs_write_extents = fsfilt_smfs_write_extents,
961 .fs_set_snap_item = fsfilt_smfs_set_snap_item,
963 /* FIXME-UMKA: probably fsfilt_smfs_get_op_len() should be
967 static int __init fsfilt_smfs_init(void)
971 rc = fsfilt_register_ops(&fsfilt_smfs_ops);
975 static void __exit fsfilt_smfs_exit(void)
977 fsfilt_unregister_ops(&fsfilt_smfs_ops);
980 module_init(fsfilt_smfs_init);
981 module_exit(fsfilt_smfs_exit);
983 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
984 MODULE_DESCRIPTION("Lustre SMFS Filesystem Helper v0.1");
985 MODULE_LICENSE("GPL");