Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I am trying to start writing a basic VFS module for linux that can be imported directly into the kernel using insmod but I get the following error when ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2014
    Posts
    1

    Smile File System module not compiling?


    Hi, I am trying to start writing a basic VFS module for linux that can be imported directly into the kernel using insmod but I get the following error when compiling: "module.c:9: error: expected ')' before string constant" the error is in the "DECLARE_FSTYPE_DEV" macro I have searched hours to try and fix this now. My code is:

    Code:
    #include <linux/kernel.h>
    #include <linux/init.h>
    #include <linux/module.h>
    #include <linux/pagemap.h>
    #include <linux/fs.h>
    #include <asm/atomic.h>
    #include <asm/uaccess.h>
    
    static DECLARE_FSTYPE_DEV(pipe_fs_type, "pipe", pipe_read_super);
    
    static int __init init_pipe_fs(void)
    {
       return 0;
    }
    
    static void __exit exit_pipe_fs(void)
    {
    
    }
    
    module_init(init_pipe_fs)
    module_exit(exit_pipe_fs)
    And my make file is:

    Code:
    obj-m += module.o
    
    all:
       make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
    
    clean:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean


    If anyone knows why I am getting this error please respond. I am making my own operating system and would much rather access my file system easily. Rather than rely on a user based program to read through it

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    The string constant is, from what I can see, "pipe". Look at the definition of the DECLARE_FSTYPE_DEV() macro to see why this may be happening. Complex macros are a serious PITA, and this sort of situation is not uncommon. Since you don't state which kernel and distribution you are using, that is a good as you can get from me...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •