From: Chinmaya Mishra <chinmaya4@gmail.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: How to mount own file system in linux
Date: Wed, 19 Jul 2006 14:19:31 +0530 [thread overview]
Message-ID: <44BDF21B.60207@innomedia.soft.net> (raw)
Hi all,
I want to create new file system in linux 2.6.10 kernel just to
print the super block information.
Can you suggest me where I can get some good documents to proceed or any
dummy code if any.
I have tried this with the following code but it gives some warning
messages during compilation. The file system is registered but during
the mount command segmentation fault occurs.
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/fs.h>
#include <linux/sched.h>
static struct super_block *rfs_read_super( struct super_block *sb, void
*buf, int size);
static struct file_system_type rfs = {"rfs", 0, rfs_read_super, NULL};
/*--------------------------------------------------------------------------------------------*/
static struct super_block *rfs_read_super( struct super_block *sb, void
*buf, int size) {
printk("rkfs: read_super returning a valid super_block\n" );
sb->s_blocksize = 1024;
sb->s_blocksize_bits = 10;
return sb;
}
/*--------------------------------------------------------------------------------------------*/
int init_module(void) {
int err;
err = register_filesystem(&rfs);
printk("rkfs: file system registered\n" );
return err;
}
/*--------------------------------------------------------------------------------------------*/
void cleanup_module(void) {
unregister_filesystem(&rfs);
printk("rkfs: file system unregistered\n" );
}
/*--------------------------------------------------------------------------------------------*/
MODULE_LICENSE("GPL");
regards,
chinmaya
next reply other threads:[~2006-07-19 8:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-19 8:49 Chinmaya Mishra [this message]
2006-07-19 8:56 ` How to mount own file system in linux Pekka Enberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44BDF21B.60207@innomedia.soft.net \
--to=chinmaya4@gmail.com \
--cc=chinmaya@innomedia.soft.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.