2 * linux/fs/befs/linuxvfs.c
4 * Copyright (C) 2001 Will Dyson <will_dyson@pobox.com
8 #include <linux/module.h>
9 #include <linux/slab.h>
11 #include <linux/errno.h>
12 #include <linux/stat.h>
13 #include <linux/nls.h>
14 #include <linux/buffer_head.h>
15 #include <linux/vfs.h>
16 #include <linux/parser.h>
21 #include "datastream.h"
26 MODULE_DESCRIPTION("BeOS File System (BeFS) driver");
27 MODULE_AUTHOR("Will Dyson");
28 MODULE_LICENSE("GPL");
30 /* The units the vfs expects inode->i_blocks to be in */
31 #define VFS_BLOCK_SIZE 512
33 static int befs_readdir(struct file *, void *, filldir_t);
34 static int befs_get_block(struct inode *, sector_t, struct buffer_head *, int);
35 static int befs_readpage(struct file *file, struct page *page);
36 static sector_t befs_bmap(struct address_space *mapping, sector_t block);
37 static struct dentry *befs_lookup(struct inode *, struct dentry *, struct nameidata *);
38 static void befs_read_inode(struct inode *ino);
39 static struct inode *befs_alloc_inode(struct super_block *sb);
40 static void befs_destroy_inode(struct inode *inode);
41 static int befs_init_inodecache(void);
42 static void befs_destroy_inodecache(void);
43 static int befs_follow_link(struct dentry *, struct nameidata *);
44 static void befs_put_link(struct dentry *, struct nameidata *);
45 static int befs_utf2nls(struct super_block *sb, const char *in, int in_len,
46 char **out, int *out_len);
47 static int befs_nls2utf(struct super_block *sb, const char *in, int in_len,
48 char **out, int *out_len);
49 static void befs_put_super(struct super_block *);
50 static int befs_remount(struct super_block *, int *, char *);
51 static int befs_statfs(struct super_block *, struct kstatfs *);
52 static int parse_options(char *, befs_mount_options *);
54 static const struct super_operations befs_sops = {
55 .read_inode = befs_read_inode, /* initialize & read inode */
56 .alloc_inode = befs_alloc_inode, /* allocate a new inode */
57 .destroy_inode = befs_destroy_inode, /* deallocate an inode */
58 .put_super = befs_put_super, /* uninit super */
59 .statfs = befs_statfs, /* statfs */
60 .remount_fs = befs_remount,
63 /* slab cache for befs_inode_info objects */
64 static kmem_cache_t *befs_inode_cachep;
66 struct file_operations befs_dir_operations = {
67 .read = generic_read_dir,
68 .readdir = befs_readdir,
71 struct inode_operations befs_dir_inode_operations = {
72 .lookup = befs_lookup,
75 struct file_operations befs_file_operations = {
76 .llseek = default_llseek,
77 .read = generic_file_read,
78 .mmap = generic_file_readonly_mmap,
81 struct address_space_operations befs_aops = {
82 .readpage = befs_readpage,
83 .sync_page = block_sync_page,
87 static struct inode_operations befs_symlink_inode_operations = {
88 .readlink = generic_readlink,
89 .follow_link = befs_follow_link,
90 .put_link = befs_put_link,
94 * Called by generic_file_read() to read a page of data
96 * In turn, simply calls a generic block read function and
97 * passes it the address of befs_get_block, for mapping file
98 * positions to disk blocks.
101 befs_readpage(struct file *file, struct page *page)
103 return block_read_full_page(page, befs_get_block);
107 befs_bmap(struct address_space *mapping, sector_t block)
109 return generic_block_bmap(mapping, block, befs_get_block);
113 * Generic function to map a file position (block) to a
114 * disk offset (passed back in bh_result).
116 * Used by many higher level functions.
118 * Calls befs_fblock2brun() in datastream.c to do the real work.
124 befs_get_block(struct inode *inode, sector_t block,
125 struct buffer_head *bh_result, int create)
127 struct super_block *sb = inode->i_sb;
128 befs_data_stream *ds = &BEFS_I(inode)->i_data.ds;
129 befs_block_run run = BAD_IADDR;
133 befs_debug(sb, "---> befs_get_block() for inode %lu, block %ld",
134 inode->i_ino, block);
137 befs_error(sb, "befs_get_block() was asked for a block "
138 "number less than zero: block %ld in inode %lu",
139 block, inode->i_ino);
144 befs_error(sb, "befs_get_block() was asked to write to "
145 "block %ld in inode %lu", block, inode->i_ino);
149 res = befs_fblock2brun(sb, ds, block, &run);
150 if (res != BEFS_OK) {
152 "<--- befs_get_block() for inode %lu, block "
153 "%ld ERROR", inode->i_ino, block);
157 disk_off = (ulong) iaddr2blockno(sb, &run);
159 map_bh(bh_result, inode->i_sb, disk_off);
161 befs_debug(sb, "<--- befs_get_block() for inode %lu, block %ld, "
162 "disk address %lu", inode->i_ino, block, disk_off);
167 static struct dentry *
168 befs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
170 struct inode *inode = NULL;
171 struct super_block *sb = dir->i_sb;
172 befs_data_stream *ds = &BEFS_I(dir)->i_data.ds;
177 const char *name = dentry->d_name.name;
179 befs_debug(sb, "---> befs_lookup() "
180 "name %s inode %ld", dentry->d_name.name, dir->i_ino);
182 /* Convert to UTF-8 */
183 if (BEFS_SB(sb)->nls) {
185 befs_nls2utf(sb, name, strlen(name), &utfname, &utfnamelen);
187 befs_debug(sb, "<--- befs_lookup() ERROR");
190 ret = befs_btree_find(sb, ds, utfname, &offset);
194 ret = befs_btree_find(sb, ds, dentry->d_name.name, &offset);
197 if (ret == BEFS_BT_NOT_FOUND) {
198 befs_debug(sb, "<--- befs_lookup() %s not found",
199 dentry->d_name.name);
200 return ERR_PTR(-ENOENT);
202 } else if (ret != BEFS_OK || offset == 0) {
203 befs_warning(sb, "<--- befs_lookup() Error");
204 return ERR_PTR(-ENODATA);
207 inode = iget(dir->i_sb, (ino_t) offset);
209 return ERR_PTR(-EACCES);
211 d_add(dentry, inode);
213 befs_debug(sb, "<--- befs_lookup()");
219 befs_readdir(struct file *filp, void *dirent, filldir_t filldir)
221 struct inode *inode = filp->f_dentry->d_inode;
222 struct super_block *sb = inode->i_sb;
223 befs_data_stream *ds = &BEFS_I(inode)->i_data.ds;
227 unsigned char d_type;
228 char keybuf[BEFS_NAME_LEN + 1];
231 const char *dirname = filp->f_dentry->d_name.name;
233 befs_debug(sb, "---> befs_readdir() "
234 "name %s, inode %ld, filp->f_pos %Ld",
235 dirname, inode->i_ino, filp->f_pos);
237 result = befs_btree_read(sb, ds, filp->f_pos, BEFS_NAME_LEN + 1,
238 keybuf, &keysize, &value);
240 if (result == BEFS_ERR) {
241 befs_debug(sb, "<--- befs_readdir() ERROR");
242 befs_error(sb, "IO error reading %s (inode %lu)",
243 dirname, inode->i_ino);
246 } else if (result == BEFS_BT_END) {
247 befs_debug(sb, "<--- befs_readdir() END");
250 } else if (result == BEFS_BT_EMPTY) {
251 befs_debug(sb, "<--- befs_readdir() Empty directory");
258 if (BEFS_SB(sb)->nls) {
260 befs_utf2nls(sb, keybuf, keysize, &nlsname, &nlsnamelen);
262 befs_debug(sb, "<--- befs_readdir() ERROR");
265 result = filldir(dirent, nlsname, nlsnamelen, filp->f_pos,
266 (ino_t) value, d_type);
270 result = filldir(dirent, keybuf, keysize, filp->f_pos,
271 (ino_t) value, d_type);
276 befs_debug(sb, "<--- befs_readdir() filp->f_pos %Ld", filp->f_pos);
281 static struct inode *
282 befs_alloc_inode(struct super_block *sb)
284 struct befs_inode_info *bi;
285 bi = (struct befs_inode_info *)kmem_cache_alloc(befs_inode_cachep,
289 return &bi->vfs_inode;
293 befs_destroy_inode(struct inode *inode)
295 kmem_cache_free(befs_inode_cachep, BEFS_I(inode));
298 static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
300 struct befs_inode_info *bi = (struct befs_inode_info *) foo;
302 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
303 SLAB_CTOR_CONSTRUCTOR) {
304 inode_init_once(&bi->vfs_inode);
309 befs_read_inode(struct inode *inode)
311 struct buffer_head *bh = NULL;
312 befs_inode *raw_inode = NULL;
314 struct super_block *sb = inode->i_sb;
315 befs_sb_info *befs_sb = BEFS_SB(sb);
316 befs_inode_info *befs_ino = NULL;
318 befs_debug(sb, "---> befs_read_inode() " "inode = %lu", inode->i_ino);
320 befs_ino = BEFS_I(inode);
322 /* convert from vfs's inode number to befs's inode number */
323 befs_ino->i_inode_num = blockno2iaddr(sb, inode->i_ino);
325 befs_debug(sb, " real inode number [%u, %hu, %hu]",
326 befs_ino->i_inode_num.allocation_group,
327 befs_ino->i_inode_num.start, befs_ino->i_inode_num.len);
329 bh = befs_bread(sb, inode->i_ino);
331 befs_error(sb, "unable to read inode block - "
332 "inode = %lu", inode->i_ino);
336 raw_inode = (befs_inode *) bh->b_data;
338 befs_dump_inode(sb, raw_inode);
340 if (befs_check_inode(sb, raw_inode, inode->i_ino) != BEFS_OK) {
341 befs_error(sb, "Bad inode: %lu", inode->i_ino);
345 inode->i_mode = (umode_t) fs32_to_cpu(sb, raw_inode->mode);
348 * set uid and gid. But since current BeOS is single user OS, so
349 * you can change by "uid" or "gid" options.
352 inode->i_uid = befs_sb->mount_opts.use_uid ?
353 befs_sb->mount_opts.uid : (uid_t) fs32_to_cpu(sb, raw_inode->uid);
354 inode->i_gid = befs_sb->mount_opts.use_gid ?
355 befs_sb->mount_opts.gid : (gid_t) fs32_to_cpu(sb, raw_inode->gid);
360 * BEFS's time is 64 bits, but current VFS is 32 bits...
361 * BEFS don't have access time. Nor inode change time. VFS
362 * doesn't have creation time.
363 * Also, the lower 16 bits of the last_modified_time and
364 * create_time are just a counter to help ensure uniqueness
365 * for indexing purposes. (PFD, page 54)
368 inode->i_mtime.tv_sec =
369 fs64_to_cpu(sb, raw_inode->last_modified_time) >> 16;
370 inode->i_mtime.tv_nsec = 0; /* lower 16 bits are not a time */
371 inode->i_ctime = inode->i_mtime;
372 inode->i_atime = inode->i_mtime;
373 inode->i_blksize = befs_sb->block_size;
375 befs_ino->i_inode_num = fsrun_to_cpu(sb, raw_inode->inode_num);
376 befs_ino->i_parent = fsrun_to_cpu(sb, raw_inode->parent);
377 befs_ino->i_attribute = fsrun_to_cpu(sb, raw_inode->attributes);
378 befs_ino->i_flags = fs32_to_cpu(sb, raw_inode->flags);
380 if (S_ISLNK(inode->i_mode) && !(befs_ino->i_flags & BEFS_LONG_SYMLINK)){
382 inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE;
383 strncpy(befs_ino->i_data.symlink, raw_inode->data.symlink,
388 befs_ino->i_data.ds =
389 fsds_to_cpu(sb, raw_inode->data.datastream);
391 num_blks = befs_count_blocks(sb, &befs_ino->i_data.ds);
393 num_blks * (befs_sb->block_size / VFS_BLOCK_SIZE);
394 inode->i_size = befs_ino->i_data.ds.size;
397 inode->i_mapping->a_ops = &befs_aops;
399 if (S_ISREG(inode->i_mode)) {
400 inode->i_fop = &befs_file_operations;
401 } else if (S_ISDIR(inode->i_mode)) {
402 inode->i_op = &befs_dir_inode_operations;
403 inode->i_fop = &befs_dir_operations;
404 } else if (S_ISLNK(inode->i_mode)) {
405 inode->i_op = &befs_symlink_inode_operations;
407 befs_error(sb, "Inode %lu is not a regular file, "
408 "directory or symlink. THAT IS WRONG! BeFS has no "
409 "on disk special files", inode->i_ino);
414 befs_debug(sb, "<--- befs_read_inode()");
421 make_bad_inode(inode);
422 befs_debug(sb, "<--- befs_read_inode() - Bad inode");
426 /* Initialize the inode cache. Called at fs setup.
428 * Taken from NFS implementation by Al Viro.
431 befs_init_inodecache(void)
433 befs_inode_cachep = kmem_cache_create("befs_inode_cache",
434 sizeof (struct befs_inode_info),
435 0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
437 if (befs_inode_cachep == NULL) {
438 printk(KERN_ERR "befs_init_inodecache: "
439 "Couldn't initalize inode slabcache\n");
446 /* Called at fs teardown.
448 * Taken from NFS implementation by Al Viro.
451 befs_destroy_inodecache(void)
453 if (kmem_cache_destroy(befs_inode_cachep))
454 printk(KERN_ERR "befs_destroy_inodecache: "
455 "not all structures were freed\n");
459 * The inode of symbolic link is different to data stream.
460 * The data stream become link name. Unless the LONG_SYMLINK
464 befs_follow_link(struct dentry *dentry, struct nameidata *nd)
466 befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
469 if (befs_ino->i_flags & BEFS_LONG_SYMLINK) {
470 struct super_block *sb = dentry->d_sb;
471 befs_data_stream *data = &befs_ino->i_data.ds;
472 befs_off_t len = data->size;
474 befs_debug(sb, "Follow long symlink");
476 link = kmalloc(len, GFP_NOFS);
478 link = ERR_PTR(-ENOMEM);
479 } else if (befs_read_lsymlink(sb, data, link, len) != len) {
481 befs_error(sb, "Failed to read entire long symlink");
482 link = ERR_PTR(-EIO);
485 link = befs_ino->i_data.symlink;
488 nd_set_link(nd, link);
492 static void befs_put_link(struct dentry *dentry, struct nameidata *nd)
494 befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
495 if (befs_ino->i_flags & BEFS_LONG_SYMLINK) {
496 char *p = nd_get_link(nd);
503 * UTF-8 to NLS charset convert routine
506 * Changed 8/10/01 by Will Dyson. Now use uni2char() / char2uni() rather than
507 * the nls tables directly
511 befs_utf2nls(struct super_block *sb, const char *in,
512 int in_len, char **out, int *out_len)
514 struct nls_table *nls = BEFS_SB(sb)->nls;
519 int maxlen = in_len; /* The utf8->nls conversion can't make more chars */
521 befs_debug(sb, "---> utf2nls()");
524 befs_error(sb, "befs_utf2nls called with no NLS table loaded");
528 *out = result = kmalloc(maxlen, GFP_NOFS);
530 befs_error(sb, "befs_utf2nls() cannot allocate memory");
535 for (i = o = 0; i < in_len; i += utflen, o += unilen) {
537 /* convert from UTF-8 to Unicode */
538 utflen = utf8_mbtowc(&uni, &in[i], in_len - i);
543 /* convert from Unicode to nls */
544 unilen = nls->uni2char(uni, &result[o], in_len - o);
552 befs_debug(sb, "<--- utf2nls()");
557 befs_error(sb, "Name using character set %s contains a character that "
558 "cannot be converted to unicode.", nls->charset);
559 befs_debug(sb, "<--- utf2nls()");
565 * befs_nls2utf - Convert NLS string to utf8 encodeing
567 * @src: Input string buffer in NLS format
568 * @srclen: Length of input string in bytes
569 * @dest: The output string in UTF8 format
570 * @destlen: Length of the output buffer
572 * Converts input string @src, which is in the format of the loaded NLS map,
573 * into a utf8 string.
575 * The destination string @dest is allocated by this function and the caller is
576 * responsible for freeing it with kfree()
578 * On return, *@destlen is the length of @dest in bytes.
580 * On success, the return value is the number of utf8 characters written to
581 * the output buffer @dest.
583 * On Failure, a negative number coresponding to the error code is returned.
587 befs_nls2utf(struct super_block *sb, const char *in,
588 int in_len, char **out, int *out_len)
590 struct nls_table *nls = BEFS_SB(sb)->nls;
595 int maxlen = 3 * in_len;
597 befs_debug(sb, "---> nls2utf()\n");
600 befs_error(sb, "befs_nls2utf called with no NLS table loaded.");
604 *out = result = kmalloc(maxlen, GFP_NOFS);
606 befs_error(sb, "befs_nls2utf() cannot allocate memory");
611 for (i = o = 0; i < in_len; i += unilen, o += utflen) {
613 /* convert from nls to unicode */
614 unilen = nls->char2uni(&in[i], in_len - i, &uni);
619 /* convert from unicode to UTF-8 */
620 utflen = utf8_wctomb(&result[o], uni, 3);
629 befs_debug(sb, "<--- nls2utf()");
634 befs_error(sb, "Name using charecter set %s contains a charecter that "
635 "cannot be converted to unicode.", nls->charset);
636 befs_debug(sb, "<--- nls2utf()");
646 Opt_uid, Opt_gid, Opt_charset, Opt_debug, Opt_err,
649 static match_table_t befs_tokens = {
652 {Opt_charset, "iocharset=%s"},
653 {Opt_debug, "debug"},
658 parse_options(char *options, befs_mount_options * opts)
661 substring_t args[MAX_OPT_ARGS];
664 /* Initialize options */
669 opts->iocharset = NULL;
675 while ((p = strsep(&options, ",")) != NULL) {
680 token = match_token(p, befs_tokens, args);
683 if (match_int(&args[0], &option))
686 printk(KERN_ERR "BeFS: Invalid uid %d, "
687 "using default\n", option);
694 if (match_int(&args[0], &option))
697 printk(KERN_ERR "BeFS: Invalid gid %d, "
698 "using default\n", option);
705 kfree(opts->iocharset);
706 opts->iocharset = match_strdup(&args[0]);
707 if (!opts->iocharset) {
708 printk(KERN_ERR "BeFS: allocation failure for "
709 "iocharset string\n");
717 printk(KERN_ERR "BeFS: Unrecognized mount option \"%s\" "
718 "or missing value\n", p);
725 /* This function has the responsibiltiy of getting the
726 * filesystem ready for unmounting.
727 * Basicly, we free everything that we allocated in
731 befs_put_super(struct super_block *sb)
733 if (BEFS_SB(sb)->mount_opts.iocharset) {
734 kfree(BEFS_SB(sb)->mount_opts.iocharset);
735 BEFS_SB(sb)->mount_opts.iocharset = NULL;
738 if (BEFS_SB(sb)->nls) {
739 unload_nls(BEFS_SB(sb)->nls);
740 BEFS_SB(sb)->nls = NULL;
744 kfree(sb->s_fs_info);
745 sb->s_fs_info = NULL;
750 /* Allocate private field of the superblock, fill it.
752 * Finish filling the public superblock fields
753 * Make the root directory
754 * Load a set of NLS translations if needed.
757 befs_fill_super(struct super_block *sb, void *data, int silent)
759 struct buffer_head *bh;
760 befs_sb_info *befs_sb;
761 befs_super_block *disk_sb;
764 const unsigned long sb_block = 0;
765 const off_t x86_sb_off = 512;
767 sb->s_fs_info = kmalloc(sizeof (*befs_sb), GFP_KERNEL);
768 if (sb->s_fs_info == NULL) {
770 "BeFS(%s): Unable to allocate memory for private "
771 "portion of superblock. Bailing.\n", sb->s_id);
774 befs_sb = BEFS_SB(sb);
775 memset(befs_sb, 0, sizeof(befs_sb_info));
777 if (!parse_options((char *) data, &befs_sb->mount_opts)) {
778 befs_error(sb, "cannot parse mount options");
779 goto unaquire_priv_sbp;
782 befs_debug(sb, "---> befs_fill_super()");
784 #ifndef CONFIG_BEFS_RW
785 if (!(sb->s_flags & MS_RDONLY)) {
787 "No write support. Marking filesystem read-only");
788 sb->s_flags |= MS_RDONLY;
790 #endif /* CONFIG_BEFS_RW */
793 * Set dummy blocksize to read super block.
794 * Will be set to real fs blocksize later.
796 * Linux 2.4.10 and later refuse to read blocks smaller than
797 * the hardsect size for the device. But we also need to read at
798 * least 1k to get the second 512 bytes of the volume.
801 sb_min_blocksize(sb, 1024);
803 if (!(bh = sb_bread(sb, sb_block))) {
804 befs_error(sb, "unable to read superblock");
805 goto unaquire_priv_sbp;
808 /* account for offset of super block on x86 */
809 disk_sb = (befs_super_block *) bh->b_data;
810 if ((le32_to_cpu(disk_sb->magic1) == BEFS_SUPER_MAGIC1) ||
811 (be32_to_cpu(disk_sb->magic1) == BEFS_SUPER_MAGIC1)) {
812 befs_debug(sb, "Using PPC superblock location");
814 befs_debug(sb, "Using x86 superblock location");
816 (befs_super_block *) ((void *) bh->b_data + x86_sb_off);
819 if (befs_load_sb(sb, disk_sb) != BEFS_OK)
822 befs_dump_super_block(sb, disk_sb);
826 if (befs_check_sb(sb) != BEFS_OK)
827 goto unaquire_priv_sbp;
829 if( befs_sb->num_blocks > ~((sector_t)0) ) {
830 befs_error(sb, "blocks count: %Lu "
831 "is larger than the host can use",
832 befs_sb->num_blocks);
833 goto unaquire_priv_sbp;
837 * set up enough so that it can read an inode
838 * Fill in kernel superblock fields from private sb
840 sb->s_magic = BEFS_SUPER_MAGIC;
841 /* Set real blocksize of fs */
842 sb_set_blocksize(sb, (ulong) befs_sb->block_size);
843 sb->s_op = (struct super_operations *) &befs_sops;
844 root = iget(sb, iaddr2blockno(sb, &(befs_sb->root_dir)));
845 sb->s_root = d_alloc_root(root);
848 befs_error(sb, "get root inode failed");
849 goto unaquire_priv_sbp;
852 /* load nls library */
853 if (befs_sb->mount_opts.iocharset) {
854 befs_debug(sb, "Loading nls: %s",
855 befs_sb->mount_opts.iocharset);
856 befs_sb->nls = load_nls(befs_sb->mount_opts.iocharset);
858 befs_warning(sb, "Cannot load nls %s"
859 "loding default nls",
860 befs_sb->mount_opts.iocharset);
861 befs_sb->nls = load_nls_default();
871 kfree(sb->s_fs_info);
874 sb->s_fs_info = NULL;
879 befs_remount(struct super_block *sb, int *flags, char *data)
881 if (!(*flags & MS_RDONLY))
887 befs_statfs(struct super_block *sb, struct kstatfs *buf)
890 befs_debug(sb, "---> befs_statfs()");
892 buf->f_type = BEFS_SUPER_MAGIC;
893 buf->f_bsize = sb->s_blocksize;
894 buf->f_blocks = BEFS_SB(sb)->num_blocks;
895 buf->f_bfree = BEFS_SB(sb)->num_blocks - BEFS_SB(sb)->used_blocks;
896 buf->f_bavail = buf->f_bfree;
897 buf->f_files = 0; /* UNKNOWN */
898 buf->f_ffree = 0; /* UNKNOWN */
899 buf->f_namelen = BEFS_NAME_LEN;
901 befs_debug(sb, "<--- befs_statfs()");
906 static struct super_block *
907 befs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name,
910 return get_sb_bdev(fs_type, flags, dev_name, data, befs_fill_super);
913 static struct file_system_type befs_fs_type = {
914 .owner = THIS_MODULE,
916 .get_sb = befs_get_sb,
917 .kill_sb = kill_block_super,
918 .fs_flags = FS_REQUIRES_DEV,
926 printk(KERN_INFO "BeFS version: %s\n", BEFS_VERSION);
928 err = befs_init_inodecache();
932 err = register_filesystem(&befs_fs_type);
934 goto unaquire_inodecache;
939 befs_destroy_inodecache();
948 befs_destroy_inodecache();
950 unregister_filesystem(&befs_fs_type);
954 Macros that typecheck the init and exit functions,
955 ensures that they are called at init and cleanup,
956 and eliminates warnings about unused functions.
958 module_init(init_befs_fs)
959 module_exit(exit_befs_fs)