Example #1
0
static int fuse_get_sb_blk(struct file_system_type *fs_type,
			   int flags, const char *dev_name,
			   void *raw_data, struct vfsmount *mnt)
{
	return get_sb_bdev(fs_type, flags, dev_name, raw_data, fuse_fill_super,
			   mnt);
}
Example #2
0
static int msdos_get_sb(struct file_system_type *fs_type,
			int flags, const char *dev_name,
			void *data, struct vfsmount *mnt)
{
	return get_sb_bdev(fs_type, flags, dev_name, data, msdos_fill_super,
			   mnt);
}
Example #3
0
static struct super_block* lab5fs_get_sb(struct file_system_type *fs_type,
		int flags,
		const char *dev_name,
		void *data)
{
	return get_sb_bdev(fs_type, flags, dev_name, data, lab5fs_fill_super);
}
static int sfs_get_sb(struct file_system_type *fs_type, int flags, const char *devname, void *data, struct vfsmount *vm)
{
	printk(KERN_INFO "sfs: devname = %s\n", devname);

	 /* sfs_fill_super this will be called to fill the super block */
	return get_sb_bdev(fs_type, flags, devname, data, &sfs_fill_super, vm);
}
Example #5
0
/**
 * wufs_get_sb:
 * This routine (pointed to by the file_system_type, above) is called when
 * there is a request to mount the file system.
 *   fs_type has been partially filled out by VFS
 *   flags encodes the mount flags
 *   dev_name is the name of the device being mounted
 *   mnt is a string describing the mount options
 */
static int wufs_get_sb(struct file_system_type *fs_type,
		       int flags, const char *dev_name, void *data,
		       struct vfsmount *mnt)
{
  /* call the generic vfs method (in super.c) with the help of wufs_fill_super */
  return get_sb_bdev(fs_type, flags, dev_name, data, wufs_fill_super, mnt);
}
Example #6
0
/******************************************************************************
 *
 * axfs_get_sb
 *
 * Description:
 *      After testing various mounting options and media mounts the image
 *
 * Parameters:
 *    (IN) fs_type - pointer to file_system_type
 *
 *    (IN) flags - mount flags
 *
 *    (IN) dev_name - block device name passed in from mount
 *
 *    (IN) data - pointer to a string containing mount options
 *
 *    (IN) mnt - VFS mount point
 *
 * Returns:
 *    0 or error number
 *
 *****************************************************************************/
int axfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
	char *secondary_blk_dev;
	struct axfs_fill_super_info *output;
	unsigned long physaddr;
	unsigned long virtaddr;
	int err;

	err = parse_axfs_options((char *)data, &secondary_blk_dev, &physaddr, &virtaddr);
	if(err != 0)
		return err;

#ifdef CONFIG_SNSC_FIRST_MOUNT_AXFS_AS_ROOTFS
	printk("AXFS: Checking AXFS filesystem at virtaddr: 0x%08lx "
	       "(physaddr=0x%08lx).\n", virtaddr, physaddr);
#endif

	/* Check if physaddr is valid */
	output = axfs_get_sb_physaddr(physaddr);
	if(!(IS_ERR(output)))
		goto out;

	/* Check if virtaddr is valid */
	output = axfs_get_sb_virtaddr(virtaddr);
	if(!(IS_ERR(output)))
		goto out;

	/* Next we assume there's a MTD device */
	output = axfs_get_sb_mtd(dev_name);
	if(!(IS_ERR(output)))
		goto out;

	/* Now we assume it's a block device */
	output = axfs_get_sb_block(fs_type, flags, dev_name, secondary_blk_dev);
	if(!(IS_ERR(output)))
	{
		return get_sb_bdev(fs_type, flags, dev_name, output, axfs_fill_super, mnt);
	}

	return PTR_ERR(output);

out:
	if(secondary_blk_dev) {
		return get_sb_bdev(fs_type, flags, secondary_blk_dev, output, axfs_fill_super, mnt);
	}
	return get_sb_nodev(fs_type, flags, output, axfs_fill_super, mnt);
}
Example #7
0
// read info for the super block from the disk
// create inode for the root
// data: options passed in by kernel, probably be NULL (no options at all)
static int msdos_get_sb(struct file_system_type *fs_type,
			int flags, const char *dev_name,
			void *data, struct vfsmount *mnt)
{
        printk (KERN_INFO "fat: msdos_get_sb, dev is %s\n", dev_name);
        // get_sb_bdev is linux general function
	return get_sb_bdev(fs_type, flags, dev_name, data, msdos_fill_super,
			   mnt);
}
Example #8
0
/*
 * get a superblock for mounting
 */
static int romfs_get_sb(struct file_system_type *fs_type,
			int flags, const char *dev_name,
			void *data, struct vfsmount *mnt)
{
	int ret = -EINVAL;

#ifdef CONFIG_ROMFS_ON_MTD
	ret = get_sb_mtd(fs_type, flags, dev_name, data, romfs_fill_super,
			 mnt);
#endif
#ifdef CONFIG_ROMFS_ON_BLOCK
	if (ret == -EINVAL)
		ret = get_sb_bdev(fs_type, flags, dev_name, data,
				  romfs_fill_super, mnt);
#endif
	return ret;
}
Example #9
0
static int f2fs_mount(struct file_system_type *fs_type, int flags,
			const char *dev_name, void *data, struct vfsmount *mnt)
{
	//return mount_bdev(fs_type, flags, dev_name, data, f2fs_fill_super);
	return get_sb_bdev(fs_type, flags, dev_name, data, f2fs_fill_super, mnt);
}
Example #10
0
static int simplefs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name,
			   void *data, struct vfsmount *mnt) {
	printk(KERN_INFO "simplefs_get_sb\n");
	return get_sb_bdev(fs_type, flags, dev_name, data, simplefs_fill_super, mnt);
}
Example #11
0
static int cdfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt) {
  return get_sb_bdev(fs_type, flags, dev_name, data, cdfs_fill_super, mnt);
#else
static struct super_block *cdfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) {
  return get_sb_bdev(fs_type, flags, dev_name, data, cdfs_fill_super);
#endif
}

static struct file_system_type cdfs_fs_type = {
  .owner    = THIS_MODULE,
  .name     = "cdfs",
  .get_sb   = cdfs_get_sb,
  .kill_sb  = kill_block_super,
  .fs_flags = FS_REQUIRES_DEV
};
#endif

/******************************************************/

MODULE_AUTHOR("Michiel Ronsse ([email protected])");
MODULE_DESCRIPTION("CDfs: a CD filesystem");
MODULE_LICENSE("GPL"); 

#ifdef OLD_KERNEL
EXPORT_NO_SYMBOLS;
#endif

/******************************************************************/

static int __init cdfs_init(void) {
  int err;
  PRINT("init_module (insmod)\n");

  printk(FSNAME" "VERSION" loaded.\n");
 
  // register file system
  err = register_filesystem(&cdfs_fs_type);
  if (err < 0) return err;

  // register /proc entry
  if ((cdfs_proc_entry = create_proc_entry(FSNAME, 0, NULL )))
    cdfs_proc_entry->proc_fops = &proc_cdfs_operations;
  cdfs_proc_cd=NULL;

  // start kernel thread
  if ((kcdfsd_pid = kernel_thread(kcdfsd_thread, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND)) >0 ) {
    return 0;
  } else {
    printk(FSNAME" kernel_thread failed.\n");
    if (cdfs_proc_entry) remove_proc_entry(FSNAME, NULL);
    unregister_filesystem(&cdfs_fs_type);
    return -1;
  }
}

/******************************************************************/

static void __exit cdfs_exit(void) {
  PRINT("cleanup_module (rmmod)\n");
  kcdfsd_cleanup_thread();
  if (cdfs_proc_entry) remove_proc_entry(FSNAME, NULL);
  unregister_filesystem(&cdfs_fs_type);
}