Whamcloud - gitweb
7af645b76d3cbc64cd0f026850c17baab8259c17
[fs/lustre-release.git] / lustre / llite / super25.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Lustre Light Super operations
5  *
6  * This code is issued under the GNU General Public License.
7  * See the file COPYING in this distribution
8  *
9  * Copryright (C) 2002 Cluster File Systems, Inc.
10  */
11
12 #define DEBUG_SUBSYSTEM S_LLITE
13
14 #include <linux/module.h>
15 #include <linux/random.h>
16 #include <linux/version.h>
17 #include <linux/lustre_lite.h>
18 #include <linux/lustre_ha.h>
19 #include <linux/obd_lov.h>
20 #include <linux/lustre_dlm.h>
21 #include <linux/init.h>
22 #include <linux/fs.h>
23
24 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
25 kmem_cache_t *ll_file_data_slab;
26 extern struct address_space_operations ll_aops;
27 extern struct address_space_operations ll_dir_aops;
28 struct super_operations ll_super_operations;
29
30 extern int ll_init_inodecache(void);
31 extern void ll_destroy_inodecache(void);
32 extern int ll_recover(struct recovd_data *, int);
33 extern int ll_commitcbd_setup(struct ll_sb_info *);
34 extern int ll_commitcbd_cleanup(struct ll_sb_info *);
35 int ll_read_inode2(struct inode *inode, void *opaque);
36
37 static char *ll_read_opt(const char *opt, char *data)
38 {
39         char *value;
40         char *retval;
41         ENTRY;
42
43         CDEBUG(D_SUPER, "option: %s, data %s\n", opt, data);
44         if ( strncmp(opt, data, strlen(opt)) )
45                 RETURN(NULL);
46         if ( (value = strchr(data, '=')) == NULL )
47                 RETURN(NULL);
48
49         value++;
50         OBD_ALLOC(retval, strlen(value) + 1);
51         if ( !retval ) {
52                 CERROR("out of memory!\n");
53                 RETURN(NULL);
54         }
55
56         memcpy(retval, value, strlen(value)+1);
57         CDEBUG(D_SUPER, "Assigned option: %s, value %s\n", opt, retval);
58         RETURN(retval);
59 }
60
61 static int ll_set_opt(const char *opt, char *data, int fl)
62 {
63         ENTRY;
64
65         CDEBUG(D_SUPER, "option: %s, data %s\n", opt, data);
66         if ( strncmp(opt, data, strlen(opt)) )
67                 RETURN(0);
68         else
69                 RETURN(fl);
70 }
71
72 static void ll_options(char *options, char **ost, char **mds, int *flags)
73 {
74         char *opt_ptr = options;
75         char *this_char;
76         ENTRY;
77
78         if (!options) {
79                 EXIT;
80                 return;
81         }
82
83         while ((this_char = strsep (&opt_ptr, ",")) != NULL) {
84                 CDEBUG(D_SUPER, "this_char %s\n", this_char);
85                 if ( (!*ost && (*ost = ll_read_opt("osc", this_char)))||
86                      (!*mds && (*mds = ll_read_opt("mdc", this_char)))||
87                      (!(*flags & LL_SBI_NOLCK) && ((*flags) = (*flags) | 
88                       ll_set_opt("nolock", this_char, LL_SBI_NOLCK))) )
89                         continue;
90         }
91         EXIT;
92 }
93
94 #ifndef log2
95 #define log2(n) ffz(~(n))
96 #endif
97
98
99 static int ll_fill_super(struct super_block *sb, void *data, int silent)
100 {
101         struct inode *root = 0;
102         struct obd_device *obd;
103         struct ll_sb_info *sbi;
104         char *osc = NULL;
105         char *mdc = NULL;
106         int err;
107         struct ll_fid rootfid;
108         struct obd_statfs osfs;
109         struct ptlrpc_request *request = NULL;
110         struct ptlrpc_connection *mdc_conn;
111         struct ll_read_inode2_cookie lic;
112         class_uuid_t uuid;
113
114         ENTRY;
115         MOD_INC_USE_COUNT;
116
117         OBD_ALLOC(sbi, sizeof(*sbi));
118         if (!sbi) {
119                 MOD_DEC_USE_COUNT;
120                 RETURN(-ENOMEM);
121         }
122
123         INIT_LIST_HEAD(&sbi->ll_conn_chain);
124         generate_random_uuid(uuid);
125         class_uuid_unparse(uuid, sbi->ll_sb_uuid);
126
127         sb->s_fs_info = sbi;
128
129         ll_options(data, &osc, &mdc, &sbi->ll_flags);
130
131         if (!osc) {
132                 CERROR("no osc\n");
133                 GOTO(out_free, sb = NULL);
134         }
135
136         if (!mdc) {
137                 CERROR("no mdc\n");
138                 GOTO(out_free, sb = NULL);
139         }
140
141         obd = class_uuid2obd(mdc);
142         if (!obd) {
143                 CERROR("MDC %s: not setup or attached\n", mdc);
144                 GOTO(out_free, sb = NULL);
145         }
146
147         err = obd_connect(&sbi->ll_mdc_conn, obd, sbi->ll_sb_uuid,
148                           ptlrpc_recovd, ll_recover);
149         if (err) {
150                 CERROR("cannot connect to %s: rc = %d\n", mdc, err);
151                 GOTO(out_free, sb = NULL);
152         }
153
154 #warning Peter: is this the right place to raise the connection level?
155         mdc_conn = sbi2mdc(sbi)->cl_import.imp_connection;
156         mdc_conn->c_level = LUSTRE_CONN_FULL;
157         list_add(&mdc_conn->c_sb_chain, &sbi->ll_conn_chain);
158
159         obd = class_uuid2obd(osc);
160         if (!obd) {
161                 CERROR("OSC %s: not setup or attached\n", osc);
162                 GOTO(out_mdc, sb = NULL);
163         }
164
165         err = obd_connect(&sbi->ll_osc_conn, obd, sbi->ll_sb_uuid,
166                           ptlrpc_recovd, ll_recover);
167         if (err) {
168                 CERROR("cannot connect to %s: rc = %d\n", osc, err);
169                 GOTO(out_mdc, sb = NULL);
170         }
171
172         err = mdc_getstatus(&sbi->ll_mdc_conn, &rootfid);
173         if (err) {
174                 CERROR("cannot mds_connect: rc = %d\n", err);
175                 GOTO(out_mdc, sb = NULL);
176         }
177         CDEBUG(D_SUPER, "rootfid "LPU64"\n", rootfid.id);
178         sbi->ll_rootino = rootfid.id;
179
180         memset(&osfs, 0, sizeof(osfs));
181         err = mdc_statfs(&sbi->ll_mdc_conn, &osfs);
182         sb->s_blocksize = osfs.os_bsize;
183         sb->s_blocksize_bits = log2(osfs.os_bsize);
184         sb->s_magic = LL_SUPER_MAGIC;
185         sb->s_maxbytes = (1ULL << (32 + 9)) - osfs.os_bsize;
186
187         sb->s_op = &ll_super_operations;
188
189         /* make root inode */
190         err = mdc_getattr(&sbi->ll_mdc_conn, sbi->ll_rootino, S_IFDIR,
191                           OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, 0, &request);
192         if (err) {
193                 CERROR("mdc_getattr failed for root: rc = %d\n", err);
194                 GOTO(out_request, sb = NULL);
195         }
196
197         /* initialize committed transaction callback daemon */
198         spin_lock_init(&sbi->ll_commitcbd_lock);
199         init_waitqueue_head(&sbi->ll_commitcbd_waitq);
200         init_waitqueue_head(&sbi->ll_commitcbd_ctl_waitq);
201         sbi->ll_commitcbd_flags = 0;
202         err = ll_commitcbd_setup(sbi);
203         if (err) {
204                 CERROR("failed to start commit callback daemon: rc = %d\n",err);
205                 GOTO(out_request, sb = NULL);
206         }
207
208         lic.lic_body = lustre_msg_buf(request->rq_repmsg, 0);
209         lic.lic_lmm = NULL;
210         root = iget5_locked(sb, sbi->ll_rootino, NULL,
211                             ll_read_inode2, &lic);
212
213         if (root) {
214                 sb->s_root = d_alloc_root(root);
215         } else {
216                 CERROR("lustre_lite: bad iget4 for root\n");
217                 GOTO(out_cdb, sb = NULL);
218         }
219
220         ptlrpc_req_finished(request);
221         request = NULL;
222
223 out_dev:
224         if (mdc)
225                 OBD_FREE(mdc, strlen(mdc) + 1);
226         if (osc)
227                 OBD_FREE(osc, strlen(osc) + 1);
228
229         RETURN(0);
230
231 out_cdb:
232         ll_commitcbd_cleanup(sbi);
233 out_request:
234         ptlrpc_req_finished(request);
235         obd_disconnect(&sbi->ll_osc_conn);
236 out_mdc:
237         obd_disconnect(&sbi->ll_mdc_conn);
238 out_free:
239         OBD_FREE(sbi, sizeof(*sbi));
240
241         MOD_DEC_USE_COUNT;
242         goto out_dev;
243 } /* ll_fill_super */
244
245 struct super_block * ll_get_sb(struct file_system_type *fs_type, 
246                                    int flags, char *devname, void * data)
247 {
248         return get_sb_nodev(fs_type, flags, data, ll_fill_super);
249 }
250
251 static void ll_put_super(struct super_block *sb)
252 {
253         struct ll_sb_info *sbi = ll_s2sbi(sb);
254         struct ll_fid rootfid;
255         ENTRY;
256
257         list_del(&sbi->ll_conn_chain);
258         ll_commitcbd_cleanup(sbi);
259         obd_disconnect(&sbi->ll_osc_conn);
260
261         /* NULL request to force sync on the MDS, and get the last_committed
262          * value to flush remaining RPCs from the pending queue on client.
263          *
264          * XXX This should be an mdc_sync() call to sync the whole MDS fs,
265          *     which we can call for other reasons as well.
266          */
267         mdc_getstatus(&sbi->ll_mdc_conn, &rootfid);
268
269         obd_disconnect(&sbi->ll_mdc_conn);
270         OBD_FREE(sbi, sizeof(*sbi));
271
272         MOD_DEC_USE_COUNT;
273         EXIT;
274 } /* ll_put_super */
275
276 static void ll_clear_inode(struct inode *inode)
277 {
278         ENTRY;
279
280         if (atomic_read(&inode->i_count) == 0) {
281                 struct ll_inode_info *lli = ll_i2info(inode);
282                 struct lov_stripe_md *lsm = lli->lli_smd;
283                 char *symlink_name = lli->lli_symlink_name;
284
285                 if (lsm) {
286                         OBD_FREE(lsm, ll_ost_easize(inode->i_sb));
287                         lli->lli_smd = NULL;
288                 }
289                 if (symlink_name) {
290                         OBD_FREE(symlink_name, strlen(symlink_name) + 1);
291                         lli->lli_symlink_name = NULL;
292                 }
293         }
294         EXIT;
295 }
296
297 static void ll_delete_inode(struct inode *inode)
298 {
299         ENTRY;
300         if (S_ISREG(inode->i_mode)) {
301                 int err;
302                 struct obdo *oa;
303                 struct lov_stripe_md *lsm = ll_i2info(inode)->lli_smd;
304
305                 if (!lsm)
306                         GOTO(out, -EINVAL);
307
308                 if (lsm->lsm_object_id == 0) {
309                         CERROR("This really happens\n");
310                         /* No obdo was ever created */
311                         GOTO(out, 0);
312                 }
313
314                 oa = obdo_alloc();
315                 if (oa == NULL)
316                         GOTO(out, -ENOMEM);
317
318                 oa->o_id = lsm->lsm_object_id;
319                 oa->o_easize = ll_mds_easize(inode->i_sb);
320                 oa->o_mode = inode->i_mode;
321                 oa->o_valid = OBD_MD_FLID | OBD_MD_FLEASIZE | OBD_MD_FLTYPE;
322
323                 err = obd_destroy(ll_i2obdconn(inode), oa, lsm);
324                 obdo_free(oa);
325                 CDEBUG(D_SUPER, "obd destroy of objid "LPX64" error %d\n",
326                        lsm->lsm_object_id, err);
327         }
328 out:
329         clear_inode(inode);
330         EXIT;
331 }
332
333 /* like inode_setattr, but doesn't mark the inode dirty */
334 static int ll_attr2inode(struct inode * inode, struct iattr * attr, int trunc)
335 {
336         unsigned int ia_valid = attr->ia_valid;
337         int error = 0;
338
339         if ((ia_valid & ATTR_SIZE) && trunc) {
340                 error = vmtruncate(inode, attr->ia_size);
341                 if (error)
342                         goto out;
343         } else if (ia_valid & ATTR_SIZE)
344                 inode->i_size = attr->ia_size;
345
346         if (ia_valid & ATTR_UID)
347                 inode->i_uid = attr->ia_uid;
348         if (ia_valid & ATTR_GID)
349                 inode->i_gid = attr->ia_gid;
350         if (ia_valid & ATTR_ATIME)
351                 inode->i_atime = attr->ia_atime;
352         if (ia_valid & ATTR_MTIME)
353                 inode->i_mtime = attr->ia_mtime;
354         if (ia_valid & ATTR_CTIME)
355                 inode->i_ctime = attr->ia_ctime;
356         if (ia_valid & ATTR_MODE) {
357                 inode->i_mode = attr->ia_mode;
358                 if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
359                         inode->i_mode &= ~S_ISGID;
360         }
361 out:
362         return error;
363 }
364
365 int ll_inode_setattr(struct inode *inode, struct iattr *attr, int do_trunc)
366 {
367         struct ptlrpc_request *request = NULL;
368         struct ll_sb_info *sbi = ll_i2sbi(inode);
369         int err;
370
371         ENTRY;
372
373         /* change incore inode */
374         ll_attr2inode(inode, attr, do_trunc);
375
376         err = mdc_setattr(&sbi->ll_mdc_conn, inode, attr, &request);
377         if (err)
378                 CERROR("mdc_setattr fails (%d)\n", err);
379
380         ptlrpc_req_finished(request);
381
382         RETURN(err);
383 }
384
385 int ll_setattr(struct dentry *de, struct iattr *attr)
386 {
387         int rc = inode_change_ok(de->d_inode, attr);
388
389         if (rc)
390                 return rc;
391
392         return ll_inode_setattr(de->d_inode, attr, 1);
393 }
394
395 static int ll_statfs(struct super_block *sb, struct statfs *sfs)
396 {
397         struct ll_sb_info *sbi = ll_s2sbi(sb);
398         struct obd_statfs osfs;
399         int rc;
400         ENTRY;
401
402         memset(sfs, 0, sizeof(*sfs));
403         rc = obd_statfs(&sbi->ll_mdc_conn, &osfs);
404         statfs_unpack(sfs, &osfs);
405         if (rc)
406                 CERROR("mdc_statfs fails: rc = %d\n", rc);
407         else
408                 CDEBUG(D_SUPER, "mdc_statfs shows blocks "LPU64"/"LPU64
409                        " objects "LPU64"/"LPU64"\n",
410                        osfs.os_bavail, osfs.os_blocks,
411                        osfs.os_ffree, osfs.os_files);
412
413         /* temporary until mds_statfs returns statfs info for all OSTs */
414         if (!rc) {
415                 rc = obd_statfs(&sbi->ll_osc_conn, &osfs);
416                 if (rc) {
417                         CERROR("obd_statfs fails: rc = %d\n", rc);
418                         GOTO(out, rc);
419                 }
420                 CDEBUG(D_SUPER, "obd_statfs shows blocks "LPU64"/"LPU64
421                        " objects "LPU64"/"LPU64"\n",
422                        osfs.os_bavail, osfs.os_blocks,
423                        osfs.os_ffree, osfs.os_files);
424
425                 while (osfs.os_blocks > ~0UL) {
426                         sfs->f_bsize <<= 1;
427
428                         osfs.os_blocks >>= 1;
429                         osfs.os_bfree >>= 1;
430                         osfs.os_bavail >>= 1;
431                 }
432                 sfs->f_blocks = osfs.os_blocks;
433                 sfs->f_bfree = osfs.os_bfree;
434                 sfs->f_bavail = osfs.os_bavail;
435                 if (osfs.os_ffree < (__u64)sfs->f_ffree)
436                         sfs->f_ffree = osfs.os_ffree;
437         }
438
439 out:
440         RETURN(rc);
441 }
442
443 void ll_update_inode(struct inode *inode, struct mds_body *body)
444 {
445         if (body->valid & OBD_MD_FLID)
446                 inode->i_ino = body->ino;
447         if (body->valid & OBD_MD_FLATIME)
448                 inode->i_atime = body->atime;
449         if (body->valid & OBD_MD_FLMTIME)
450                 inode->i_mtime = body->mtime;
451         if (body->valid & OBD_MD_FLCTIME)
452                 inode->i_ctime = body->ctime;
453         if (body->valid & OBD_MD_FLMODE)
454                 inode->i_mode = (inode->i_mode & S_IFMT)|(body->mode & ~S_IFMT);
455         if (body->valid & OBD_MD_FLTYPE)
456                 inode->i_mode = (inode->i_mode & ~S_IFMT)|(body->mode & S_IFMT);
457         if (body->valid & OBD_MD_FLUID)
458                 inode->i_uid = body->uid;
459         if (body->valid & OBD_MD_FLGID)
460                 inode->i_gid = body->gid;
461         if (body->valid & OBD_MD_FLFLAGS)
462                 inode->i_flags = body->flags;
463         if (body->valid & OBD_MD_FLNLINK)
464                 inode->i_nlink = body->nlink;
465         if (body->valid & OBD_MD_FLGENER)
466                 inode->i_generation = body->generation;
467         if (body->valid & OBD_MD_FLRDEV)
468                 inode->i_rdev = to_kdev_t(body->rdev);
469         if (body->valid & OBD_MD_FLSIZE)
470                 inode->i_size = body->size;
471 }
472
473 int ll_read_inode2(struct inode *inode, void *opaque)
474 {
475         struct ll_read_inode2_cookie *lic = opaque;
476         struct mds_body *body = lic->lic_body;
477         struct ll_inode_info *lli = ll_i2info(inode);
478         ENTRY;
479
480         sema_init(&lli->lli_open_sem, 1);
481
482         /* core attributes first */
483         ll_update_inode(inode, body);
484
485         //if (body->valid & OBD_MD_FLEASIZE)
486         if (lic && lic->lic_lmm) {
487                 struct lov_mds_md *lmm = lic->lic_lmm;
488                 int size;
489
490                 /* XXX This should probably not be an error in the future,
491                  *     when we allow LOV OSTs to be added.
492                  */
493                 if (lmm->lmm_easize != ll_mds_easize(inode->i_sb)) {
494                         CERROR("Striping metadata size error %ld\n",
495                                inode->i_ino);
496                         LBUG();
497                 }
498                 size = ll_ost_easize(inode->i_sb);
499                 OBD_ALLOC(lli->lli_smd, size);
500                 if (!lli->lli_smd) {
501                         CERROR("No memory for %d\n", size);
502                         LBUG();
503                 }
504                 lov_unpackmd(lli->lli_smd, lmm);
505         } else {
506                 lli->lli_smd = NULL;
507         }
508
509         /* Get the authoritative file size */
510         if (lli->lli_smd && (inode->i_mode & S_IFREG)) {
511                 int rc;
512
513                 rc = ll_file_size(inode, lli->lli_smd);
514                 if (rc) {
515                         CERROR("ll_file_size: %d\n", rc);
516                         /* FIXME: need to somehow prevent inode creation */
517                         LBUG();
518                 }
519         }
520
521         /* OIDEBUG(inode); */
522
523         if (S_ISREG(inode->i_mode)) {
524                 inode->i_op = &ll_file_inode_operations;
525                 inode->i_fop = &ll_file_operations;
526                 inode->i_mapping->a_ops = &ll_aops;
527                 EXIT;
528         } else if (S_ISDIR(inode->i_mode)) {
529                 inode->i_op = &ll_dir_inode_operations;
530                 inode->i_fop = &ll_dir_operations;
531                 inode->i_mapping->a_ops = &ll_dir_aops;
532                 EXIT;
533         } else if (S_ISLNK(inode->i_mode)) {
534                 inode->i_op = &ll_fast_symlink_inode_operations;
535                 EXIT;
536         } else {
537                 init_special_inode(inode, inode->i_mode,
538                                    kdev_t_to_nr(inode->i_rdev));
539                 EXIT;
540         }
541         return 0;
542 }
543
544 static inline void invalidate_request_list(struct list_head *req_list)
545 {
546         struct list_head *tmp, *n;
547         list_for_each_safe(tmp, n, req_list) {
548                 struct ptlrpc_request *req = 
549                         list_entry(tmp, struct ptlrpc_request, rq_list);
550                 CERROR("invalidating req xid %d op %d to %s:%d\n",
551                        (unsigned long long)req->rq_xid, req->rq_reqmsg->opc,
552                        req->rq_connection->c_remote_uuid,
553                        req->rq_import->imp_client->cli_request_portal);
554                 req->rq_flags |= PTL_RPC_FL_ERR;
555                 wake_up(&req->rq_wait_for_rep);
556         }
557 }
558
559 void ll_umount_begin(struct super_block *sb)
560 {
561         struct ll_sb_info *sbi = ll_s2sbi(sb);
562         struct list_head *ctmp;
563
564         ENTRY;
565        
566         list_for_each(ctmp, &sbi->ll_conn_chain) {
567                 struct ptlrpc_connection *conn;
568                 conn = list_entry(ctmp, struct ptlrpc_connection, c_sb_chain);
569
570                 spin_lock(&conn->c_lock);
571                 conn->c_flags |= CONN_INVALID;
572                 invalidate_request_list(&conn->c_sending_head);
573                 invalidate_request_list(&conn->c_delayed_head);
574                 spin_unlock(&conn->c_lock);
575         }
576
577         EXIT;
578 }
579
580
581 static kmem_cache_t *ll_inode_cachep;
582
583 static struct inode *ll_alloc_inode(struct super_block *sb)
584 {
585         struct ll_inode_info *lli;
586         lli = kmem_cache_alloc(ll_inode_cachep, SLAB_KERNEL);
587         if (!lli)
588                 return NULL;
589
590         memset(lli, 0, (char *)&lli->lli_vfs_inode - (char *)lli);
591         sema_init(&lli->lli_open_sem, 1);
592
593         return &lli->lli_vfs_inode;
594 }
595
596 static void ll_destroy_inode(struct inode *inode)
597 {
598         kmem_cache_free(ll_inode_cachep, ll_i2info(inode));
599 }
600
601 static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
602 {
603         struct ll_inode_info *lli = foo;
604
605         if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
606             SLAB_CTOR_CONSTRUCTOR)
607                 inode_init_once(&lli->lli_vfs_inode);
608 }
609
610 int ll_init_inodecache(void)
611 {
612         ll_inode_cachep = kmem_cache_create("lustre_inode_cache",
613                                             sizeof(struct ll_inode_info),
614                                             0, SLAB_HWCACHE_ALIGN,
615                                             init_once, NULL);
616         if (ll_inode_cachep == NULL)
617                 return -ENOMEM;
618         return 0;
619 }
620
621 void ll_destroy_inodecache(void)
622 {
623         if (kmem_cache_destroy(ll_inode_cachep))
624                 CERROR("ll_inode_cache: not all structures were freed\n");
625 }
626
627
628
629 /* exported operations */
630 struct super_operations ll_super_operations =
631 {
632         alloc_inode: ll_alloc_inode,
633         destroy_inode: ll_destroy_inode,
634         clear_inode: ll_clear_inode,
635         delete_inode: ll_delete_inode,
636         put_super: ll_put_super,
637         statfs: ll_statfs,
638         umount_begin: ll_umount_begin
639 };
640
641 struct file_system_type lustre_lite_fs_type = {
642         .owner  = THIS_MODULE,
643         .name =   "lustre_lite", 
644         .get_sb = ll_get_sb,
645         .kill_sb = kill_litter_super,
646 };
647
648 static int __init init_lustre_lite(void)
649 {
650         int rc;
651         printk(KERN_INFO "Lustre Lite 0.5.14, info@clusterfs.com\n");
652         rc = ll_init_inodecache();
653         if (rc) 
654                 return -ENOMEM;
655         ll_file_data_slab = kmem_cache_create("ll_file_data",
656                                               sizeof(struct ll_file_data), 0,
657                                               SLAB_HWCACHE_ALIGN, NULL, NULL);
658         if (ll_file_data_slab == NULL) { 
659                 ll_destroy_inodecache();
660                 return -ENOMEM;
661         }
662         return register_filesystem(&lustre_lite_fs_type);
663 }
664
665 static void __exit exit_lustre_lite(void)
666 {
667         unregister_filesystem(&lustre_lite_fs_type);
668         ll_destroy_inodecache();
669         kmem_cache_destroy(ll_file_data_slab);
670 }
671
672 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
673 MODULE_DESCRIPTION("Lustre Lite Client File System v1.0");
674 MODULE_LICENSE("GPL");
675
676 module_init(init_lustre_lite);
677 module_exit(exit_lustre_lite);
678 #endif