Re: ramfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Dhaval Shirsath wrote:
>     I have made changes to the code of ramfs,i.e added some printk()
> statements to see which function is invocked when is say mkdir or say
> ls.I wanted to mount ramfs by another name myramfs .I am also facing
> problem in mounting it .How do i do it?

Which version (2.4 or 2.6) are you using?

If 2.6, do the following operations.

(1) Insert ".owner = THIS_MODULE," at
    http://lxr.linux.no/source/fs/ramfs/inode.c#L216
    (Without this, ramfs can't work safely as a module,
     for it doesn't increment module usage counter,
     resulting successful rmmod while mounted
     and subsequent crash.)

(2) Remove rootfs_fs_type and init_rootfs()
    which are for rootfs.

(3) Insert "struct file_operations ramfs_file_operations;"
    at http://lxr.linux.no/source/fs/ramfs/inode.c#L45
    which is the contents of linux/ramfs.h .
    And comment out "#include <linux/ramfs.h>".

(4) Replace all string "ramfs" to "myramfs",
    and save the source as myramfs.c .

If 2.4, do only (2) and (4).

Hope this helps.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux