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_kml_flags(struct inode *inode)
624 if (SMFS_DO_REC(S2SMI(inode->i_sb)))
625 SMFS_SET_INODE_REC(inode);
629 static int fsfilt_smfs_clear_kml_flags(struct inode *inode)
632 if (SMFS_DO_REC(S2SMI(inode->i_sb)))
633 SMFS_CLEAN_INODE_REC(inode);
637 static int fsfilt_smfs_set_ost_flags(struct super_block *sb)
640 SET_REC_PACK_TYPE_INDEX(S2SMI(sb)->smsi_flags, PACK_OST);
644 static int fsfilt_smfs_set_mds_flags(struct super_block *sb)
647 SET_REC_PACK_TYPE_INDEX(S2SMI(sb)->smsi_flags, PACK_MDS);
651 static int fsfilt_smfs_get_reint_log_ctxt(struct super_block *sb,
652 struct llog_ctxt **ctxt)
654 struct smfs_super_info *smfs_info = S2SMI(sb);
657 *ctxt = smfs_info->smsi_rec_log;
661 static int fsfilt_smfs_setup(struct obd_device *obd, struct super_block *sb)
663 struct smfs_super_info *smfs_info = S2SMI(sb);
664 struct fsfilt_operations *cache_fsfilt;
665 struct super_block *csb;
668 /* It should be initialized olready by smfs_read_super(). */
669 if (!(cache_fsfilt = smfs_info->sm_cache_fsfilt))
670 cache_fsfilt = fsfilt_get_ops(smfs_info->smsi_cache_ftype);
676 if (cache_fsfilt->fs_setup)
677 rc = cache_fsfilt->fs_setup(obd, csb);
681 static int fsfilt_smfs_set_xattr(struct inode *inode, void *handle, char *name,
682 void *buffer, int buffer_size)
684 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
685 struct inode *cache_inode = NULL;
691 cache_inode = I2CI(inode);
695 pre_smfs_inode(inode, cache_inode);
697 if (cache_fsfilt->fs_set_xattr)
698 rc = cache_fsfilt->fs_set_xattr(cache_inode, handle, name,
699 buffer, buffer_size);
700 post_smfs_inode(inode, cache_inode);
705 static int fsfilt_smfs_get_xattr(struct inode *inode, char *name,
706 void *buffer, int buffer_size)
708 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
709 struct inode *cache_inode = NULL;
715 cache_inode = I2CI(inode);
719 pre_smfs_inode(inode, cache_inode);
721 if (cache_fsfilt->fs_get_xattr)
722 rc = cache_fsfilt->fs_get_xattr(cache_inode, name,
723 buffer, buffer_size);
724 post_smfs_inode(inode, cache_inode);
729 static int fsfilt_smfs_insert_extents_ea(struct inode *inode,
730 unsigned long from, unsigned long num)
732 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
733 struct inode *cache_inode = NULL;
739 cache_inode = I2CI(inode);
743 pre_smfs_inode(inode, cache_inode);
745 if (cache_fsfilt->fs_insert_extents_ea)
746 rc = cache_fsfilt->fs_insert_extents_ea(cache_inode, from, num);
748 post_smfs_inode(inode, cache_inode);
752 static int fsfilt_smfs_remove_extents_ea(struct inode *inode,
753 unsigned long from, unsigned long num)
755 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
756 struct inode *cache_inode = NULL;
762 cache_inode = I2CI(inode);
766 pre_smfs_inode(inode, cache_inode);
768 if (cache_fsfilt->fs_remove_extents_ea)
769 rc = cache_fsfilt->fs_remove_extents_ea(cache_inode, from, num);
771 post_smfs_inode(inode, cache_inode);
775 static int fsfilt_smfs_init_extents_ea(struct inode *inode)
777 struct fsfilt_operations *cache_fsfilt = I2FOPS(inode);
778 struct inode *cache_inode = NULL;
784 cache_inode = I2CI(inode);
788 pre_smfs_inode(inode, cache_inode);
790 if (cache_fsfilt->fs_init_extents_ea)
791 rc = cache_fsfilt->fs_init_extents_ea(cache_inode);
793 post_smfs_inode(inode, cache_inode);
797 static int fsfilt_smfs_free_extents(struct super_block *sb, ino_t ino,
798 char *pbuf, int size)
800 OBD_FREE(pbuf, size * (sizeof(struct ldlm_extent)));
804 static int fsfilt_smfs_write_extents(struct dentry *dentry,
805 unsigned long from, unsigned long num)
809 if (SMFS_DO_REC(S2SMI(dentry->d_inode->i_sb)))
810 rc = smfs_write_extents(dentry->d_inode, dentry, from, num);
815 static int fsfilt_smfs_precreate_rec(struct dentry *dentry, int *count,
820 if (SMFS_DO_REC(S2SMI(dentry->d_inode->i_sb)))
821 rc = smfs_rec_precreate(dentry, count, oa);
826 static int fsfilt_smfs_get_ino_write_extents(struct super_block *sb, ino_t ino,
827 char **pbuf, int *size)
829 struct fs_extent *fs_extents;
830 struct ldlm_extent *extents = NULL;
832 struct inode *cache_inode;
833 struct fsfilt_operations *cache_fsfilt = NULL;
834 struct lvfs_run_ctxt saved;
835 int rc = 0, fs_ex_size, ex_num, flags;
836 char *buf = NULL, *ex_buf = NULL;
838 push_ctxt(&saved, S2SMI(sb)->smsi_ctxt, NULL);
840 inode = iget(sb, ino);
842 if (!inode || is_bad_inode(inode)) {
843 CWARN("Can not get inode %lu ino\n", ino);
846 cache_inode = I2CI(inode);
847 cache_fsfilt = I2FOPS(inode);
849 rc = cache_fsfilt->fs_get_xattr(cache_inode, REINT_EXTENTS_FLAGS,
850 &flags, sizeof(int));
851 if (!(flags & SMFS_OVER_WRITE) && !(flags & SMFS_DIRTY_WRITE)) {
853 } else if (flags & SMFS_OVER_WRITE) {
855 OBD_ALLOC(ex_buf, sizeof(struct ldlm_extent));
857 GOTO(out, rc=-ENOMEM);
858 extents = (struct ldlm_extent*)(ex_buf);
860 extents->end = 0xffffffff;
864 rc = cache_fsfilt->fs_get_write_extents_num(cache_inode, &fs_ex_size);
867 OBD_ALLOC(buf, fs_ex_size);
869 GOTO(out, rc=-ENOMEM);
871 rc = cache_fsfilt->fs_get_inode_write_extents(cache_inode, &buf,
876 ex_num = fs_ex_size / sizeof(struct fs_extent);
878 OBD_ALLOC(ex_buf, ex_num* sizeof(struct ldlm_extent));
880 GOTO(out, rc=-ENOMEM);
882 fs_extents = (struct fs_extent*)(buf);
883 extents = (struct ldlm_extent*)(ex_buf);
885 int blk_size = I2CI(inode)->i_blksize;
887 extents->start = fs_extents->e_block * blk_size;
888 extents->end = extents->start + fs_extents->e_num * blk_size;
897 OBD_FREE(buf, fs_ex_size);
899 OBD_FREE(ex_buf, (*size) * (sizeof(struct ldlm_extent)));
900 pop_ctxt(&saved, S2SMI(sb)->smsi_ctxt, NULL);
904 static int fsfilt_smfs_set_snap_item(struct super_block *sb, char *name)
910 rc = smfs_add_snap_item(sb, name);
915 static struct fsfilt_operations fsfilt_smfs_ops = {
917 .fs_owner = THIS_MODULE,
918 .fs_start = fsfilt_smfs_start,
919 .fs_brw_start = fsfilt_smfs_brw_start,
920 .fs_commit = fsfilt_smfs_commit,
921 .fs_commit_async = fsfilt_smfs_commit_async,
922 .fs_commit_wait = fsfilt_smfs_commit_wait,
923 .fs_setattr = fsfilt_smfs_setattr,
924 .fs_iocontrol = fsfilt_smfs_iocontrol,
925 .fs_set_md = fsfilt_smfs_set_md,
926 .fs_get_md = fsfilt_smfs_get_md,
927 .fs_readpage = fsfilt_smfs_readpage,
928 .fs_getpage = fsfilt_smfs_getpage,
929 .fs_add_journal_cb = fsfilt_smfs_add_journal_cb,
930 .fs_statfs = fsfilt_smfs_statfs,
931 .fs_sync = fsfilt_smfs_sync,
932 .fs_map_inode_pages = fsfilt_smfs_map_inode_pages,
933 .fs_prep_san_write = fsfilt_smfs_prep_san_write,
934 .fs_write_record = fsfilt_smfs_write_record,
935 .fs_read_record = fsfilt_smfs_read_record,
936 .fs_setup = fsfilt_smfs_setup,
937 .fs_post_setup = fsfilt_smfs_post_setup,
938 .fs_post_cleanup = fsfilt_smfs_post_cleanup,
939 .fs_set_kml_flags = fsfilt_smfs_set_kml_flags,
940 .fs_clear_kml_flags = fsfilt_smfs_clear_kml_flags,
941 .fs_set_ost_flags = fsfilt_smfs_set_ost_flags,
942 .fs_set_mds_flags = fsfilt_smfs_set_mds_flags,
943 .fs_precreate_rec = fsfilt_smfs_precreate_rec,
944 .fs_get_reint_log_ctxt = fsfilt_smfs_get_reint_log_ctxt,
945 .fs_send_bio = fsfilt_smfs_send_bio,
946 .fs_set_xattr = fsfilt_smfs_set_xattr,
947 .fs_get_xattr = fsfilt_smfs_get_xattr,
948 .fs_init_extents_ea = fsfilt_smfs_init_extents_ea,
949 .fs_insert_extents_ea = fsfilt_smfs_insert_extents_ea,
950 .fs_remove_extents_ea = fsfilt_smfs_remove_extents_ea,
951 .fs_get_ino_write_extents = fsfilt_smfs_get_ino_write_extents,
952 .fs_free_write_extents = fsfilt_smfs_free_extents,
953 .fs_write_extents = fsfilt_smfs_write_extents,
954 .fs_set_snap_item = fsfilt_smfs_set_snap_item,
956 /* FIXME-UMKA: probably fsfilt_smfs_get_op_len() should be
960 static int __init fsfilt_smfs_init(void)
964 rc = fsfilt_register_ops(&fsfilt_smfs_ops);
968 static void __exit fsfilt_smfs_exit(void)
970 fsfilt_unregister_ops(&fsfilt_smfs_ops);
973 module_init(fsfilt_smfs_init);
974 module_exit(fsfilt_smfs_exit);
976 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
977 MODULE_DESCRIPTION("Lustre SMFS Filesystem Helper v0.1");
978 MODULE_LICENSE("GPL");