2 * linux/fs/befs/linuxvfs.c
4 * Copyright (C) 2001 Will Dyson <will_dyson@pobox.com
8 #include <linux/blkdev.h>
9 #include <linux/init.h>
10 #include <linux/module.h>
11 #include <linux/slab.h>
12 #include <linux/errno.h>
14 #include <linux/stat.h>
15 #include <linux/string.h>
16 #include <linux/nls.h>
21 #include "datastream.h"
27 MODULE_DESCRIPTION("BeOS File System (BeFS) driver");
28 MODULE_AUTHOR("Will Dyson");
29 MODULE_LICENSE("GPL");
31 /* The units the vfs expects inode->i_blocks to be in */
32 #define VFS_BLOCK_SIZE 512
34 static int befs_readdir(struct file *, void *, filldir_t);
35 static int befs_get_block(struct inode *, long, struct buffer_head *, int);
36 static int befs_readpage(struct file *file, struct page *page);
37 static int befs_bmap(struct address_space *mapping, long block);
38 static struct dentry *befs_lookup(struct inode *, struct dentry *);
39 static void befs_read_inode(struct inode *ino);
40 static void befs_clear_inode(struct inode *ino);
41 static int befs_init_inodecache(void);
42 static void befs_destroy_inodecache(void);
44 static int befs_readlink(struct dentry *, char *, int);
45 static int befs_follow_link(struct dentry *, struct nameidata *nd);
47 static int befs_utf2nls(struct super_block *sb, const char *in, int in_len,
48 char **out, int *out_len);
49 static int befs_nls2utf(struct super_block *sb, const char *in, int in_len,
50 char **out, int *out_len);
52 static void befs_put_super(struct super_block *);
53 static struct super_block *befs_read_super(struct super_block *, void *, int);
54 static int befs_remount(struct super_block *, int *, char *);
55 static int befs_statfs(struct super_block *, struct statfs *);
56 static int parse_options(char *, befs_mount_options *);
58 /* slab cache for befs_inode_info objects */
59 static kmem_cache_t *befs_inode_cachep;
61 static const struct super_operations befs_sops = {
62 read_inode:befs_read_inode, /* initialize & read inode */
63 clear_inode:befs_clear_inode, /* uninit inode */
64 put_super:befs_put_super, /* uninit super */
65 statfs:befs_statfs, /* statfs */
66 remount_fs:befs_remount,
69 struct file_operations befs_dir_operations = {
70 read:generic_read_dir,
74 struct inode_operations befs_dir_inode_operations = {
78 struct file_operations befs_file_operations = {
79 llseek:default_llseek,
80 read:generic_file_read,
81 mmap:generic_file_mmap,
84 struct inode_operations befs_file_inode_operations = {
87 struct address_space_operations befs_aops = {
88 readpage:befs_readpage,
89 sync_page:block_sync_page,
93 static struct inode_operations befs_symlink_inode_operations = {
94 readlink:befs_readlink,
95 follow_link:befs_follow_link,
99 * Called by generic_file_read() to read a page of data
101 * In turn, simply calls a generic block read function and
102 * passes it the address of befs_get_block, for mapping file
103 * positions to disk blocks.
106 befs_readpage(struct file *file, struct page *page)
108 return block_read_full_page(page, befs_get_block);
112 befs_bmap(struct address_space *mapping, long block)
114 return generic_block_bmap(mapping, block, befs_get_block);
118 * Generic function to map a file position (block) to a
119 * disk offset (passed back in bh_result).
121 * Used by many higher level functions.
123 * Calls befs_fblock2brun() in datastream.c to do the real work.
129 befs_get_block(struct inode *inode, long block,
130 struct buffer_head *bh_result, int create)
132 struct super_block *sb = inode->i_sb;
133 befs_data_stream *ds = &BEFS_I(inode)->i_data.ds;
134 befs_block_run run = BAD_IADDR;
138 befs_debug(sb, "---> befs_get_block() for inode %lu, block %ld",
139 inode->i_ino, block);
142 befs_error(sb, "befs_get_block() was asked for a block "
143 "number less than zero: block %ld in inode %lu",
144 block, inode->i_ino);
149 befs_error(sb, "befs_get_block() was asked to write to "
150 "block %ld in inode %lu", block, inode->i_ino);
154 res = befs_fblock2brun(sb, ds, block, &run);
155 if (res != BEFS_OK) {
157 "<--- befs_get_block() for inode %lu, block "
158 "%ld ERROR", inode->i_ino, block);
162 disk_off = (ulong) iaddr2blockno(sb, &run);
164 bh_result->b_dev = inode->i_dev;
165 bh_result->b_blocknr = disk_off;
166 bh_result->b_state |= (1UL << BH_Mapped);
168 befs_debug(sb, "<--- befs_get_block() for inode %lu, block %ld, "
169 "disk address %lu", inode->i_ino, block, disk_off);
174 static struct dentry *
175 befs_lookup(struct inode *dir, struct dentry *dentry)
177 struct inode *inode = NULL;
178 struct super_block *sb = dir->i_sb;
179 befs_data_stream *ds = &BEFS_I(dir)->i_data.ds;
184 const char *name = dentry->d_name.name;
186 befs_debug(sb, "---> befs_lookup() "
187 "name %s inode %ld", dentry->d_name.name, dir->i_ino);
189 /* Convert to UTF-8 */
190 if (BEFS_SB(sb)->nls) {
192 befs_nls2utf(sb, name, strlen(name), &utfname, &utfnamelen);
194 befs_debug(sb, "<--- befs_lookup() ERROR");
197 ret = befs_btree_find(sb, ds, utfname, &offset);
201 ret = befs_btree_find(sb, ds, dentry->d_name.name, &offset);
204 if (ret == BEFS_BT_NOT_FOUND) {
205 befs_debug(sb, "<--- befs_lookup() %s not found",
206 dentry->d_name.name);
207 return ERR_PTR(-ENOENT);
209 } else if (ret != BEFS_OK || offset == 0) {
210 befs_warning(sb, "<--- befs_lookup() Error");
211 return ERR_PTR(-ENODATA);
214 inode = iget(dir->i_sb, (ino_t) offset);
216 return ERR_PTR(-EACCES);
218 d_add(dentry, inode);
220 befs_debug(sb, "<--- befs_lookup()");
226 befs_readdir(struct file *filp, void *dirent, filldir_t filldir)
228 struct inode *inode = filp->f_dentry->d_inode;
229 struct super_block *sb = inode->i_sb;
230 befs_data_stream *ds = &BEFS_I(inode)->i_data.ds;
234 unsigned char d_type;
235 char keybuf[BEFS_NAME_LEN + 1];
238 const char *dirname = filp->f_dentry->d_name.name;
240 befs_debug(sb, "---> befs_readdir() "
241 "name %s, inode %ld, filp->f_pos %Ld",
242 dirname, inode->i_ino, filp->f_pos);
244 result = befs_btree_read(sb, ds, filp->f_pos, BEFS_NAME_LEN + 1,
245 keybuf, &keysize, &value);
247 if (result == BEFS_ERR) {
248 befs_debug(sb, "<--- befs_readdir() ERROR");
249 befs_error(sb, "IO error reading %s (inode %lu)",
250 dirname, inode->i_ino);
253 } else if (result == BEFS_BT_END) {
254 befs_debug(sb, "<--- befs_readdir() END");
257 } else if (result == BEFS_BT_EMPTY) {
258 befs_debug(sb, "<--- befs_readdir() Empty directory");
265 if (BEFS_SB(sb)->nls) {
267 befs_utf2nls(sb, keybuf, keysize, &nlsname, &nlsnamelen);
269 befs_debug(sb, "<--- befs_readdir() ERROR");
272 result = filldir(dirent, nlsname, nlsnamelen, filp->f_pos,
273 (ino_t) value, d_type);
277 result = filldir(dirent, keybuf, keysize, filp->f_pos,
278 (ino_t) value, d_type);
283 befs_debug(sb, "<--- befs_readdir() filp->f_pos %Ld", filp->f_pos);
289 befs_clear_inode(struct inode *inode)
291 befs_inode_info *b_ino = BEFS_I(inode);
292 inode->u.generic_ip = NULL;
295 kmem_cache_free(befs_inode_cachep, b_ino);
301 befs_read_inode(struct inode *inode)
303 struct buffer_head *bh = NULL;
304 befs_inode *raw_inode = NULL;
306 struct super_block *sb = inode->i_sb;
307 befs_sb_info *befs_sb = BEFS_SB(sb);
308 befs_inode_info *befs_ino = NULL;
310 befs_debug(sb, "---> befs_read_inode() " "inode = %lu", inode->i_ino);
312 inode->u.generic_ip = kmem_cache_alloc(befs_inode_cachep, GFP_NOFS);
313 if (inode->u.generic_ip == NULL) {
314 befs_error(sb, "Unable to allocate memory for private "
315 "portion of inode %lu.", inode->i_ino);
318 befs_ino = BEFS_I(inode);
320 /* convert from vfs's inode number to befs's inode number */
321 befs_ino->i_inode_num = blockno2iaddr(sb, inode->i_ino);
323 befs_debug(sb, " real inode number [%u, %hu, %hu]",
324 befs_ino->i_inode_num.allocation_group,
325 befs_ino->i_inode_num.start, befs_ino->i_inode_num.len);
327 bh = befs_bread_iaddr(sb, befs_ino->i_inode_num);
329 befs_error(sb, "unable to read inode block - "
330 "inode = %lu", inode->i_ino);
331 goto unaquire_ino_info;
334 raw_inode = (befs_inode *) bh->b_data;
336 befs_dump_inode(sb, raw_inode);
338 if (befs_check_inode(sb, raw_inode, inode->i_ino) != BEFS_OK) {
339 befs_error(sb, "Bad inode: %lu", inode->i_ino);
343 inode->i_mode = (umode_t) fs32_to_cpu(sb, raw_inode->mode);
346 * set uid and gid. But since current BeOS is single user OS, so
347 * you can change by "uid" or "gid" options.
350 inode->i_uid = befs_sb->mount_opts.use_uid ?
351 befs_sb->mount_opts.uid : (uid_t) fs32_to_cpu(sb, raw_inode->uid);
352 inode->i_gid = befs_sb->mount_opts.use_gid ?
353 befs_sb->mount_opts.gid : (gid_t) fs32_to_cpu(sb, raw_inode->gid);
358 * BEFS's time is 64 bits, but current VFS is 32 bits...
359 * BEFS don't have access time. Nor inode change time. VFS
360 * doesn't have creation time.
364 (time_t) (fs64_to_cpu(sb, raw_inode->last_modified_time) >> 16);
365 inode->i_ctime = inode->i_mtime;
366 inode->i_atime = inode->i_mtime;
367 inode->i_blkbits = befs_sb->block_shift;
368 inode->i_blksize = befs_sb->block_size;
370 befs_ino->i_inode_num = fsrun_to_cpu(sb, raw_inode->inode_num);
371 befs_ino->i_parent = fsrun_to_cpu(sb, raw_inode->parent);
372 befs_ino->i_attribute = fsrun_to_cpu(sb, raw_inode->attributes);
373 befs_ino->i_flags = fs32_to_cpu(sb, raw_inode->flags);
375 if (S_ISLNK(inode->i_mode) && !(inode->i_flags & BEFS_LONG_SYMLINK)) {
377 inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE;
378 strncpy(befs_ino->i_data.symlink, raw_inode->data.symlink,
383 befs_ino->i_data.ds =
384 fsds_to_cpu(sb, raw_inode->data.datastream);
386 num_blks = befs_count_blocks(sb, &befs_ino->i_data.ds);
388 num_blks * (befs_sb->block_size / VFS_BLOCK_SIZE);
389 inode->i_size = befs_ino->i_data.ds.size;
392 inode->i_mapping->a_ops = &befs_aops;
394 if (S_ISREG(inode->i_mode)) {
395 inode->i_fop = &befs_file_operations;
396 inode->i_op = &befs_file_inode_operations;
397 } else if (S_ISDIR(inode->i_mode)) {
398 inode->i_op = &befs_dir_inode_operations;
399 inode->i_fop = &befs_dir_operations;
400 } else if (S_ISLNK(inode->i_mode)) {
401 inode->i_op = &befs_symlink_inode_operations;
403 befs_error(sb, "Inode %lu is not a regular file, "
404 "directory or symlink. THAT IS WRONG! BeFS has no "
405 "on disk special files", inode->i_ino);
410 befs_debug(sb, "<--- befs_read_inode()");
417 kmem_cache_free(befs_inode_cachep, inode->u.generic_ip);
420 make_bad_inode(inode);
421 inode->u.generic_ip = NULL;
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,
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 struct super_block *sb = dentry->d_sb;
467 befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
471 if (befs_ino->i_flags & BEFS_LONG_SYMLINK) {
472 befs_data_stream *data = &befs_ino->i_data.ds;
473 befs_off_t linklen = data->size;
475 befs_debug(sb, "Follow long symlink");
477 link = kmalloc(linklen, GFP_NOFS);
481 if (befs_read_lsymlink(sb, data, link, linklen) != linklen) {
483 befs_error(sb, "Failed to read entire long symlink");
487 res = vfs_follow_link(nd, link);
491 link = befs_ino->i_data.symlink;
492 res = vfs_follow_link(nd, link);
499 befs_readlink(struct dentry *dentry, char *buffer, int buflen)
501 struct super_block *sb = dentry->d_sb;
502 befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
506 if (befs_ino->i_flags & BEFS_LONG_SYMLINK) {
507 befs_data_stream *data = &befs_ino->i_data.ds;
508 befs_off_t linklen = data->size;
510 befs_debug(sb, "Read long symlink");
512 link = kmalloc(linklen, GFP_NOFS);
516 if (befs_read_lsymlink(sb, data, link, linklen) != linklen) {
518 befs_error(sb, "Failed to read entire long symlink");
522 res = vfs_readlink(dentry, buffer, buflen, link);
526 link = befs_ino->i_data.symlink;
527 res = vfs_readlink(dentry, buffer, buflen, link);
534 * UTF-8 to NLS charset convert routine
536 * Changed 8/10/01 by Will Dyson. Now use uni2char() / char2uni() rather than
537 * the nls tables directly
541 befs_utf2nls(struct super_block *sb, const char *in,
542 int in_len, char **out, int *out_len)
544 struct nls_table *nls = BEFS_SB(sb)->nls;
549 int maxlen = in_len; /* The utf8->nls conversion cant make more chars */
551 befs_debug(sb, "---> utf2nls()");
554 befs_error(sb, "befs_utf2nls called with no NLS table loaded");
558 *out = result = kmalloc(maxlen, GFP_NOFS);
560 befs_error(sb, "befs_utf2nls() cannot allocate memory");
565 for (i = o = 0; i < in_len; i += utflen, o += unilen) {
567 /* convert from UTF-8 to Unicode */
568 utflen = utf8_mbtowc(&uni, &in[i], in_len - i);
573 /* convert from Unicode to nls */
574 unilen = nls->uni2char(uni, &result[o], 1);
582 befs_debug(sb, "<--- utf2nls()");
587 befs_error(sb, "Name using charecter set %s contains a charecter that "
588 "cannot be converted to unicode.", nls->charset);
589 befs_debug(sb, "<--- utf2nls()");
595 * befs_nls2utf - Convert NLS string to utf8 encodeing
597 * @src: Input string buffer in NLS format
598 * @srclen: Length of input string in bytes
599 * @dest: The output string in UTF8 format
600 * @destlen: Length of the output buffer
602 * Converts input string @src, which is in the format of the loaded NLS map,
603 * into a utf8 string.
605 * The destination string @dest is allocated by this function and the caller is
606 * responsible for freeing it with kfree()
608 * On return, *@destlen is the length of @dest in bytes.
610 * On success, the return value is the number of utf8 charecters written to
611 * the ouput buffer @dest.
613 * On Failure, a negative number coresponding to the error code is returned.
617 befs_nls2utf(struct super_block *sb, const char *in,
618 int in_len, char **out, int *out_len)
620 struct nls_table *nls = BEFS_SB(sb)->nls;
625 int maxlen = 3 * in_len;
627 befs_debug(sb, "---> nls2utf()\n");
630 befs_error(sb, "befs_nls2utf called with no NLS table loaded.");
634 *out = result = kmalloc(maxlen, GFP_NOFS);
636 befs_error(sb, "befs_nls2utf() cannot allocate memory");
641 for (i = o = 0; i < in_len; i += unilen, o += utflen) {
643 /* convert from nls to unicode */
644 unilen = nls->char2uni(&in[i], in_len - i, &uni);
649 /* convert from unicode to UTF-8 */
650 utflen = utf8_wctomb(&result[o], uni, 3);
659 befs_debug(sb, "<--- nls2utf()");
664 befs_error(sb, "Name using charecter set %s contains a charecter that "
665 "cannot be converted to unicode.", nls->charset);
666 befs_debug(sb, "<--- nls2utf()");
674 parse_options(char *options, befs_mount_options * opts)
680 /* Initialize options */
685 opts->iocharset = NULL;
691 for (this_char = strtok(options, ","); this_char != NULL;
692 this_char = strtok(NULL, ",")) {
694 if ((value = strchr(this_char, '=')) != NULL)
697 if (!strcmp(this_char, "uid")) {
698 if (!value || !*value) {
701 opts->uid = simple_strtoul(value, &value, 0);
704 printk(KERN_ERR "BEFS: Invalid uid "
705 "option: %s\n", value);
709 } else if (!strcmp(this_char, "gid")) {
710 if (!value || !*value)
713 opts->gid = simple_strtoul(value, &value, 0);
717 "BEFS: Invalid gid option: "
722 } else if (!strcmp(this_char, "iocharset") && value) {
726 while (*value && *value != ',')
730 char *buffer = kmalloc(len + 1, GFP_NOFS);
732 opts->iocharset = buffer;
733 memcpy(buffer, p, len);
737 printk(KERN_ERR "BEFS: "
738 "cannot allocate memory\n");
742 } else if (!strcmp(this_char, "debug")) {
750 /* This function has the responsibiltiy of getting the
751 * filesystem ready for unmounting.
752 * Basicly, we free everything that we allocated in
756 befs_put_super(struct super_block *sb)
758 if (BEFS_SB(sb)->mount_opts.iocharset) {
759 kfree(BEFS_SB(sb)->mount_opts.iocharset);
760 BEFS_SB(sb)->mount_opts.iocharset = NULL;
763 if (BEFS_SB(sb)->nls) {
764 unload_nls(BEFS_SB(sb)->nls);
765 BEFS_SB(sb)->nls = NULL;
768 if (sb->u.generic_sbp) {
769 kfree(sb->u.generic_sbp);
770 sb->u.generic_sbp = NULL;
775 /* Allocate private field of the superblock, fill it.
777 * Finish filling the public superblock fields
778 * Make the root directory
779 * Load a set of NLS translations if needed.
781 static struct super_block *
782 befs_read_super(struct super_block *sb, void *data, int silent)
784 struct buffer_head *bh;
785 befs_sb_info *befs_sb;
786 befs_super_block *disk_sb;
789 const unsigned long sb_block = 0;
790 const off_t x86_sb_off = 512;
792 sb->u.generic_sbp = kmalloc(sizeof (struct befs_sb_info), GFP_NOFS);
793 if (sb->u.generic_sbp == NULL) {
795 "BeFS(%s): Unable to allocate memory for private "
796 "portion of superblock. Bailing.\n",
797 kdevname(sb->s_dev));
800 befs_sb = BEFS_SB(sb);
802 if (!parse_options((char *) data, &befs_sb->mount_opts)) {
803 befs_error(sb, "cannot parse mount options");
804 goto unaquire_priv_sbp;
807 befs_debug(sb, "---> befs_read_super()");
809 #ifndef CONFIG_BEFS_RW
810 if (!(sb->s_flags & MS_RDONLY)) {
812 "No write support. Marking filesystem read-only");
813 sb->s_flags |= MS_RDONLY;
815 #endif /* CONFIG_BEFS_RW */
818 * Set dummy blocksize to read super block.
819 * Will be set to real fs blocksize later.
821 * Linux 2.4.10 and later refuse to read blocks smaller than
822 * the hardsect size for the device. But we also need to read at
823 * least 1k to get the second 512 bytes of the volume.
826 blocksize = max_t(int, get_hardsect_size(sb->s_dev), 1024);
827 set_blocksize(sb->s_dev, blocksize);
829 if (!(bh = bread(sb->s_dev, sb_block, blocksize))) {
830 befs_error(sb, "unable to read superblock");
831 goto unaquire_priv_sbp;
834 /* account for offset of super block on x86 */
835 disk_sb = (befs_super_block *) bh->b_data;
836 if ((le32_to_cpu(disk_sb->magic1) == BEFS_SUPER_MAGIC1) ||
837 (be32_to_cpu(disk_sb->magic1) == BEFS_SUPER_MAGIC1)) {
838 befs_debug(sb, "Using PPC superblock location");
840 befs_debug(sb, "Using x86 superblock location");
842 (befs_super_block *) ((void *) bh->b_data + x86_sb_off);
845 if (befs_load_sb(sb, disk_sb) != BEFS_OK)
848 befs_dump_super_block(sb, disk_sb);
852 if (befs_check_sb(sb) != BEFS_OK)
853 goto unaquire_priv_sbp;
856 * set up enough so that it can read an inode
857 * Fill in kernel superblock fields from private sb
859 sb->s_magic = BEFS_SUPER_MAGIC;
860 sb->s_blocksize = (ulong) befs_sb->block_size;
861 sb->s_blocksize_bits = (unsigned char) befs_sb->block_shift;
862 sb->s_op = (struct super_operations *) &befs_sops;
864 d_alloc_root(iget(sb, iaddr2blockno(sb, &(befs_sb->root_dir))));
866 befs_error(sb, "get root inode failed");
867 goto unaquire_priv_sbp;
870 /* load nls library */
871 if (befs_sb->mount_opts.iocharset) {
872 befs_debug(sb, "Loading nls: %s",
873 befs_sb->mount_opts.iocharset);
874 befs_sb->nls = load_nls(befs_sb->mount_opts.iocharset);
876 befs_warning(sb, "Cannot load nls %s"
877 "loding default nls",
878 befs_sb->mount_opts.iocharset);
879 befs_sb->nls = load_nls_default();
883 /* Set real blocksize of fs */
884 set_blocksize(sb->s_dev, (int) befs_sb->block_size);
892 kfree(sb->u.generic_sbp);
896 sb->u.generic_sbp = NULL;
901 befs_remount(struct super_block *sb, int *flags, char *data)
903 if (!(*flags & MS_RDONLY))
909 befs_statfs(struct super_block *sb, struct statfs *buf)
912 befs_debug(sb, "---> befs_statfs()");
914 buf->f_type = BEFS_SUPER_MAGIC;
915 buf->f_bsize = sb->s_blocksize;
916 buf->f_blocks = BEFS_SB(sb)->num_blocks;
917 buf->f_bfree = BEFS_SB(sb)->num_blocks - BEFS_SB(sb)->used_blocks;
918 buf->f_bavail = buf->f_bfree;
919 buf->f_files = 0; /* UNKNOWN */
920 buf->f_ffree = 0; /* UNKNOWN */
921 buf->f_namelen = BEFS_NAME_LEN;
923 befs_debug(sb, "<--- befs_statfs()");
929 Makes a variable of type file_system_type,
930 named befs_fs_tipe, identified by the "befs" string,
931 and containing a reference to the befs_read_super function
933 Macro declared in <linux/fs.h>
935 static DECLARE_FSTYPE_DEV(befs_fs_type, "befs", befs_read_super);
942 printk(KERN_INFO "BeFS version: %s\n", BEFS_VERSION);
944 err = befs_init_inodecache();
948 return register_filesystem(&befs_fs_type);
954 befs_destroy_inodecache();
956 unregister_filesystem(&befs_fs_type);
960 Macros that typecheck the init and exit functions,
961 ensures that they are called at init and cleanup,
962 and eliminates warnings about unused functions.
964 module_init(init_befs_fs)
965 module_exit(exit_befs_fs)