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