2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
5 * Ported the filesystem routines to 2.5.
6 * 2003-02-10 Petr Baudis <pasky@ucw.cz>
9 #include <linux/stddef.h>
11 #include <linux/version.h>
12 #include <linux/module.h>
13 #include <linux/init.h>
14 #include <linux/slab.h>
15 #include <linux/pagemap.h>
16 #include <linux/blkdev.h>
17 #include <linux/list.h>
18 #include <linux/root_dev.h>
19 #include <linux/statfs.h>
20 #include <linux/kdev_t.h>
21 #include <asm/uaccess.h>
23 #include "kern_util.h"
25 #include "user_util.h"
26 #include "2_5compat.h"
29 struct hostfs_inode_info
{
33 struct inode vfs_inode
;
36 static inline struct hostfs_inode_info
*HOSTFS_I(struct inode
*inode
)
38 return(list_entry(inode
, struct hostfs_inode_info
, vfs_inode
));
41 #define FILE_HOSTFS_I(file) HOSTFS_I((file)->f_dentry->d_inode)
43 int hostfs_d_delete(struct dentry
*dentry
)
48 struct dentry_operations hostfs_dentry_ops
= {
49 .d_delete
= hostfs_d_delete
,
52 /* Changed in hostfs_args before the kernel starts running */
53 static char *root_ino
= "/";
54 static int append
= 0;
56 #define HOSTFS_SUPER_MAGIC 0x00c0ffee
58 static struct inode_operations hostfs_iops
;
59 static struct inode_operations hostfs_dir_iops
;
60 static struct address_space_operations hostfs_link_aops
;
63 static int __init
hostfs_args(char *options
, int *add
)
67 ptr
= strchr(options
, ',');
75 ptr
= strchr(options
, ',');
79 if(!strcmp(options
, "append"))
81 else printf("hostfs_args - unsupported option - %s\n",
89 __uml_setup("hostfs=", hostfs_args
,
90 "hostfs=<root dir>,<flags>,...\n"
91 " This is used to set hostfs parameters. The root directory argument\n"
92 " is used to confine all hostfs mounts to within the specified directory\n"
93 " tree on the host. If this isn't specified, then a user inside UML can\n"
94 " mount anything on the host that's accessible to the user that's running\n"
96 " The only flag currently supported is 'append', which specifies that all\n"
97 " files opened by hostfs will be opened in append mode.\n\n"
101 static char *dentry_name(struct dentry
*dentry
, int extra
)
103 struct dentry
*parent
;
109 while(parent
->d_parent
!= parent
){
110 len
+= parent
->d_name
.len
+ 1;
111 parent
= parent
->d_parent
;
114 root
= HOSTFS_I(parent
->d_inode
)->host_filename
;
116 name
= kmalloc(len
+ extra
+ 1, GFP_KERNEL
);
117 if(name
== NULL
) return(NULL
);
121 while(parent
->d_parent
!= parent
){
122 len
-= parent
->d_name
.len
+ 1;
124 strncpy(&name
[len
+ 1], parent
->d_name
.name
,
126 parent
= parent
->d_parent
;
128 strncpy(name
, root
, strlen(root
));
132 static char *inode_name(struct inode
*ino
, int extra
)
134 struct dentry
*dentry
;
136 dentry
= list_entry(ino
->i_dentry
.next
, struct dentry
, d_alias
);
137 return(dentry_name(dentry
, extra
));
140 static int read_name(struct inode
*ino
, char *name
)
142 /* The non-int inode fields are copied into ints by stat_file and
143 * then copied into the inode because passing the actual pointers
144 * in and having them treated as int * breaks on big-endian machines
147 int i_mode
, i_nlink
, i_blksize
;
148 unsigned long long i_size
;
149 unsigned long long i_ino
;
150 unsigned long long i_blocks
;
152 err
= stat_file(name
, &i_ino
, &i_mode
, &i_nlink
, &ino
->i_uid
,
153 &ino
->i_gid
, &i_size
, &ino
->i_atime
, &ino
->i_mtime
,
154 &ino
->i_ctime
, &i_blksize
, &i_blocks
);
159 ino
->i_mode
= i_mode
;
160 ino
->i_nlink
= i_nlink
;
161 ino
->i_size
= i_size
;
162 ino
->i_blksize
= i_blksize
;
163 ino
->i_blocks
= i_blocks
;
164 if((ino
->i_sb
->s_dev
== ROOT_DEV
) && (ino
->i_uid
== getuid()))
169 static char *follow_link(char *link
)
172 char *name
, *resolved
, *end
;
177 name
= kmalloc(len
, GFP_KERNEL
);
181 n
= do_readlink(link
, name
, len
);
193 end
= strrchr(link
, '/');
198 len
= strlen(link
) + strlen(name
) + 1;
200 resolved
= kmalloc(len
, GFP_KERNEL
);
201 if(resolved
== NULL
){
206 sprintf(resolved
, "%s%s", link
, name
);
217 static int read_inode(struct inode
*ino
)
222 /* Unfortunately, we are called from iget() when we don't have a dentry
225 if(list_empty(&ino
->i_dentry
))
229 name
= inode_name(ino
, 0);
233 if(file_type(name
, NULL
, NULL
) == OS_TYPE_SYMLINK
){
234 name
= follow_link(name
);
241 err
= read_name(ino
, name
);
247 int hostfs_statfs(struct super_block
*sb
, struct kstatfs
*sf
)
249 /* do_statfs uses struct statfs64 internally, but the linux kernel
250 * struct statfs still has 32-bit versions for most of these fields,
251 * so we convert them here
260 err
= do_statfs(HOSTFS_I(sb
->s_root
->d_inode
)->host_filename
,
261 &sf
->f_bsize
, &f_blocks
, &f_bfree
, &f_bavail
, &f_files
,
262 &f_ffree
, &sf
->f_fsid
, sizeof(sf
->f_fsid
),
263 &sf
->f_namelen
, sf
->f_spare
);
265 sf
->f_blocks
= f_blocks
;
266 sf
->f_bfree
= f_bfree
;
267 sf
->f_bavail
= f_bavail
;
268 sf
->f_files
= f_files
;
269 sf
->f_ffree
= f_ffree
;
270 sf
->f_type
= HOSTFS_SUPER_MAGIC
;
274 static struct inode
*hostfs_alloc_inode(struct super_block
*sb
)
276 struct hostfs_inode_info
*hi
;
278 hi
= kmalloc(sizeof(*hi
), GFP_KERNEL
);
282 *hi
= ((struct hostfs_inode_info
) { .host_filename
= NULL
,
285 inode_init_once(&hi
->vfs_inode
);
286 return(&hi
->vfs_inode
);
289 static void hostfs_delete_inode(struct inode
*inode
)
291 if(HOSTFS_I(inode
)->fd
!= -1) {
292 close_file(&HOSTFS_I(inode
)->fd
);
293 HOSTFS_I(inode
)->fd
= -1;
298 static void hostfs_destroy_inode(struct inode
*inode
)
300 if(HOSTFS_I(inode
)->host_filename
)
301 kfree(HOSTFS_I(inode
)->host_filename
);
303 /*XXX: This should not happen, probably. The check is here for
304 * additional safety.*/
305 if(HOSTFS_I(inode
)->fd
!= -1) {
306 close_file(&HOSTFS_I(inode
)->fd
);
307 printk(KERN_DEBUG
"Closing host fd in .destroy_inode\n");
310 kfree(HOSTFS_I(inode
));
313 static void hostfs_read_inode(struct inode
*inode
)
318 static struct super_operations hostfs_sbops
= {
319 .alloc_inode
= hostfs_alloc_inode
,
320 .drop_inode
= generic_delete_inode
,
321 .delete_inode
= hostfs_delete_inode
,
322 .destroy_inode
= hostfs_destroy_inode
,
323 .read_inode
= hostfs_read_inode
,
324 .statfs
= hostfs_statfs
,
327 int hostfs_readdir(struct file
*file
, void *ent
, filldir_t filldir
)
331 unsigned long long next
, ino
;
334 name
= dentry_name(file
->f_dentry
, 0);
335 if(name
== NULL
) return(-ENOMEM
);
336 dir
= open_dir(name
, &error
);
338 if(dir
== NULL
) return(-error
);
340 while((name
= read_dir(dir
, &next
, &ino
, &len
)) != NULL
){
341 error
= (*filldir
)(ent
, name
, len
, file
->f_pos
,
350 int hostfs_file_open(struct inode
*ino
, struct file
*file
)
353 int mode
= 0, r
= 0, w
= 0, fd
;
355 mode
= file
->f_mode
& (FMODE_READ
| FMODE_WRITE
);
356 if((mode
& HOSTFS_I(ino
)->mode
) == mode
)
359 /* The file may already have been opened, but with the wrong access,
360 * so this resets things and reopens the file with the new access.
362 if(HOSTFS_I(ino
)->fd
!= -1){
363 close_file(&HOSTFS_I(ino
)->fd
);
364 HOSTFS_I(ino
)->fd
= -1;
367 HOSTFS_I(ino
)->mode
|= mode
;
368 if(HOSTFS_I(ino
)->mode
& FMODE_READ
)
370 if(HOSTFS_I(ino
)->mode
& FMODE_WRITE
)
375 name
= dentry_name(file
->f_dentry
, 0);
379 fd
= open_file(name
, r
, w
, append
);
381 if(fd
< 0) return(fd
);
382 FILE_HOSTFS_I(file
)->fd
= fd
;
387 int hostfs_fsync(struct file
*file
, struct dentry
*dentry
, int datasync
)
392 static struct file_operations hostfs_file_fops
= {
393 .llseek
= generic_file_llseek
,
394 .read
= generic_file_read
,
395 .sendfile
= generic_file_sendfile
,
396 .aio_read
= generic_file_aio_read
,
397 .aio_write
= generic_file_aio_write
,
398 .readv
= generic_file_readv
,
399 .writev
= generic_file_writev
,
400 .write
= generic_file_write
,
401 .mmap
= generic_file_mmap
,
402 .open
= hostfs_file_open
,
404 .fsync
= hostfs_fsync
,
407 static struct file_operations hostfs_dir_fops
= {
408 .llseek
= generic_file_llseek
,
409 .readdir
= hostfs_readdir
,
410 .read
= generic_read_dir
,
413 int hostfs_writepage(struct page
*page
, struct writeback_control
*wbc
)
415 struct address_space
*mapping
= page
->mapping
;
416 struct inode
*inode
= mapping
->host
;
418 unsigned long long base
;
419 int count
= PAGE_CACHE_SIZE
;
420 int end_index
= inode
->i_size
>> PAGE_CACHE_SHIFT
;
423 if (page
->index
>= end_index
)
424 count
= inode
->i_size
& (PAGE_CACHE_SIZE
-1);
427 base
= ((unsigned long long) page
->index
) << PAGE_CACHE_SHIFT
;
429 err
= write_file(HOSTFS_I(inode
)->fd
, &base
, buffer
, count
);
431 ClearPageUptodate(page
);
435 if (base
> inode
->i_size
)
436 inode
->i_size
= base
;
439 ClearPageError(page
);
449 int hostfs_readpage(struct file
*file
, struct page
*page
)
455 start
= (long long) page
->index
<< PAGE_CACHE_SHIFT
;
457 err
= read_file(FILE_HOSTFS_I(file
)->fd
, &start
, buffer
,
459 if(err
< 0) goto out
;
461 memset(&buffer
[err
], 0, PAGE_CACHE_SIZE
- err
);
463 flush_dcache_page(page
);
464 SetPageUptodate(page
);
465 if (PageError(page
)) ClearPageError(page
);
473 int hostfs_prepare_write(struct file
*file
, struct page
*page
,
474 unsigned int from
, unsigned int to
)
477 long long start
, tmp
;
480 start
= (long long) page
->index
<< PAGE_CACHE_SHIFT
;
484 err
= read_file(FILE_HOSTFS_I(file
)->fd
, &tmp
, buffer
,
486 if(err
< 0) goto out
;
488 if(to
!= PAGE_CACHE_SIZE
){
490 err
= read_file(FILE_HOSTFS_I(file
)->fd
, &start
, buffer
+ to
,
491 PAGE_CACHE_SIZE
- to
);
492 if(err
< 0) goto out
;
500 int hostfs_commit_write(struct file
*file
, struct page
*page
, unsigned from
,
503 struct address_space
*mapping
= page
->mapping
;
504 struct inode
*inode
= mapping
->host
;
509 start
= (long long) (page
->index
<< PAGE_CACHE_SHIFT
) + from
;
511 err
= write_file(FILE_HOSTFS_I(file
)->fd
, &start
, buffer
+ from
,
514 if(!err
&& (start
> inode
->i_size
))
515 inode
->i_size
= start
;
521 static struct address_space_operations hostfs_aops
= {
522 .writepage
= hostfs_writepage
,
523 .readpage
= hostfs_readpage
,
524 /* .set_page_dirty = __set_page_dirty_nobuffers, */
525 .prepare_write
= hostfs_prepare_write
,
526 .commit_write
= hostfs_commit_write
529 static int init_inode(struct inode
*inode
, struct dentry
*dentry
)
532 int type
, err
= -ENOMEM
;
537 name
= dentry_name(dentry
, 0);
540 type
= file_type(name
, &maj
, &min
);
541 /*Reencode maj and min with the kernel encoding.*/
542 rdev
= MKDEV(maj
, min
);
545 else type
= OS_TYPE_DIR
;
548 if(type
== OS_TYPE_SYMLINK
)
549 inode
->i_op
= &page_symlink_inode_operations
;
550 else if(type
== OS_TYPE_DIR
)
551 inode
->i_op
= &hostfs_dir_iops
;
552 else inode
->i_op
= &hostfs_iops
;
554 if(type
== OS_TYPE_DIR
) inode
->i_fop
= &hostfs_dir_fops
;
555 else inode
->i_fop
= &hostfs_file_fops
;
557 if(type
== OS_TYPE_SYMLINK
)
558 inode
->i_mapping
->a_ops
= &hostfs_link_aops
;
559 else inode
->i_mapping
->a_ops
= &hostfs_aops
;
562 case OS_TYPE_CHARDEV
:
563 init_special_inode(inode
, S_IFCHR
, rdev
);
565 case OS_TYPE_BLOCKDEV
:
566 init_special_inode(inode
, S_IFBLK
, rdev
);
569 init_special_inode(inode
, S_IFIFO
, 0);
572 init_special_inode(inode
, S_IFSOCK
, 0);
579 int hostfs_create(struct inode
*dir
, struct dentry
*dentry
, int mode
,
580 struct nameidata
*nd
)
587 inode
= iget(dir
->i_sb
, 0);
588 if(inode
== NULL
) goto out
;
590 error
= init_inode(inode
, dentry
);
595 name
= dentry_name(dentry
, 0);
599 fd
= file_create(name
,
600 mode
& S_IRUSR
, mode
& S_IWUSR
, mode
& S_IXUSR
,
601 mode
& S_IRGRP
, mode
& S_IWGRP
, mode
& S_IXGRP
,
602 mode
& S_IROTH
, mode
& S_IWOTH
, mode
& S_IXOTH
);
605 else error
= read_name(inode
, name
);
611 HOSTFS_I(inode
)->fd
= fd
;
612 HOSTFS_I(inode
)->mode
= FMODE_READ
| FMODE_WRITE
;
613 d_instantiate(dentry
, inode
);
622 struct dentry
*hostfs_lookup(struct inode
*ino
, struct dentry
*dentry
,
623 struct nameidata
*nd
)
630 inode
= iget(ino
->i_sb
, 0);
634 err
= init_inode(inode
, dentry
);
639 name
= dentry_name(dentry
, 0);
643 err
= read_name(inode
, name
);
652 d_add(dentry
, inode
);
653 dentry
->d_op
= &hostfs_dentry_ops
;
659 return(ERR_PTR(err
));
662 static char *inode_dentry_name(struct inode
*ino
, struct dentry
*dentry
)
667 file
= inode_name(ino
, dentry
->d_name
.len
+ 1);
668 if(file
== NULL
) return(NULL
);
671 strncat(file
, dentry
->d_name
.name
, dentry
->d_name
.len
);
672 file
[len
+ dentry
->d_name
.len
] = '\0';
676 int hostfs_link(struct dentry
*to
, struct inode
*ino
, struct dentry
*from
)
678 char *from_name
, *to_name
;
681 if((from_name
= inode_dentry_name(ino
, from
)) == NULL
)
683 to_name
= dentry_name(to
, 0);
688 err
= link_file(to_name
, from_name
);
694 int hostfs_unlink(struct inode
*ino
, struct dentry
*dentry
)
699 if((file
= inode_dentry_name(ino
, dentry
)) == NULL
) return(-ENOMEM
);
703 err
= unlink_file(file
);
708 int hostfs_symlink(struct inode
*ino
, struct dentry
*dentry
, const char *to
)
713 if((file
= inode_dentry_name(ino
, dentry
)) == NULL
) return(-ENOMEM
);
714 err
= make_symlink(file
, to
);
719 int hostfs_mkdir(struct inode
*ino
, struct dentry
*dentry
, int mode
)
724 if((file
= inode_dentry_name(ino
, dentry
)) == NULL
) return(-ENOMEM
);
725 err
= do_mkdir(file
, mode
);
730 int hostfs_rmdir(struct inode
*ino
, struct dentry
*dentry
)
735 if((file
= inode_dentry_name(ino
, dentry
)) == NULL
) return(-ENOMEM
);
736 err
= do_rmdir(file
);
741 int hostfs_mknod(struct inode
*dir
, struct dentry
*dentry
, int mode
, dev_t dev
)
747 inode
= iget(dir
->i_sb
, 0);
751 err
= init_inode(inode
, dentry
);
756 name
= dentry_name(dentry
, 0);
760 init_special_inode(inode
, mode
, dev
);
761 err
= do_mknod(name
, mode
, dev
);
765 err
= read_name(inode
, name
);
770 d_instantiate(dentry
, inode
);
781 int hostfs_rename(struct inode
*from_ino
, struct dentry
*from
,
782 struct inode
*to_ino
, struct dentry
*to
)
784 char *from_name
, *to_name
;
787 if((from_name
= inode_dentry_name(from_ino
, from
)) == NULL
)
789 if((to_name
= inode_dentry_name(to_ino
, to
)) == NULL
){
793 err
= rename_file(from_name
, to_name
);
799 void hostfs_truncate(struct inode
*ino
)
804 int hostfs_permission(struct inode
*ino
, int desired
, struct nameidata
*nd
)
807 int r
= 0, w
= 0, x
= 0, err
;
809 if (desired
& MAY_READ
) r
= 1;
810 if (desired
& MAY_WRITE
) w
= 1;
811 if (desired
& MAY_EXEC
) x
= 1;
812 name
= inode_name(ino
, 0);
813 if (name
== NULL
) return(-ENOMEM
);
815 if (S_ISCHR(ino
->i_mode
) || S_ISBLK(ino
->i_mode
) ||
816 S_ISFIFO(ino
->i_mode
) || S_ISSOCK(ino
->i_mode
))
819 err
= access_file(name
, r
, w
, x
);
822 err
= generic_permission(ino
, desired
, NULL
);
826 int hostfs_setattr(struct dentry
*dentry
, struct iattr
*attr
)
828 struct hostfs_iattr attrs
;
832 err
= inode_change_ok(dentry
->d_inode
, attr
);
837 attr
->ia_valid
&= ~ATTR_SIZE
;
840 if(attr
->ia_valid
& ATTR_MODE
){
841 attrs
.ia_valid
|= HOSTFS_ATTR_MODE
;
842 attrs
.ia_mode
= attr
->ia_mode
;
844 if(attr
->ia_valid
& ATTR_UID
){
845 if((dentry
->d_inode
->i_sb
->s_dev
== ROOT_DEV
) &&
847 attr
->ia_uid
= getuid();
848 attrs
.ia_valid
|= HOSTFS_ATTR_UID
;
849 attrs
.ia_uid
= attr
->ia_uid
;
851 if(attr
->ia_valid
& ATTR_GID
){
852 if((dentry
->d_inode
->i_sb
->s_dev
== ROOT_DEV
) &&
854 attr
->ia_gid
= getgid();
855 attrs
.ia_valid
|= HOSTFS_ATTR_GID
;
856 attrs
.ia_gid
= attr
->ia_gid
;
858 if(attr
->ia_valid
& ATTR_SIZE
){
859 attrs
.ia_valid
|= HOSTFS_ATTR_SIZE
;
860 attrs
.ia_size
= attr
->ia_size
;
862 if(attr
->ia_valid
& ATTR_ATIME
){
863 attrs
.ia_valid
|= HOSTFS_ATTR_ATIME
;
864 attrs
.ia_atime
= attr
->ia_atime
;
866 if(attr
->ia_valid
& ATTR_MTIME
){
867 attrs
.ia_valid
|= HOSTFS_ATTR_MTIME
;
868 attrs
.ia_mtime
= attr
->ia_mtime
;
870 if(attr
->ia_valid
& ATTR_CTIME
){
871 attrs
.ia_valid
|= HOSTFS_ATTR_CTIME
;
872 attrs
.ia_ctime
= attr
->ia_ctime
;
874 if(attr
->ia_valid
& ATTR_ATIME_SET
){
875 attrs
.ia_valid
|= HOSTFS_ATTR_ATIME_SET
;
877 if(attr
->ia_valid
& ATTR_MTIME_SET
){
878 attrs
.ia_valid
|= HOSTFS_ATTR_MTIME_SET
;
880 name
= dentry_name(dentry
, 0);
881 if(name
== NULL
) return(-ENOMEM
);
882 err
= set_attr(name
, &attrs
);
887 return(inode_setattr(dentry
->d_inode
, attr
));
890 int hostfs_getattr(struct vfsmount
*mnt
, struct dentry
*dentry
,
893 generic_fillattr(dentry
->d_inode
, stat
);
897 static struct inode_operations hostfs_iops
= {
898 .create
= hostfs_create
,
900 .unlink
= hostfs_unlink
,
901 .symlink
= hostfs_symlink
,
902 .mkdir
= hostfs_mkdir
,
903 .rmdir
= hostfs_rmdir
,
904 .mknod
= hostfs_mknod
,
905 .rename
= hostfs_rename
,
906 .truncate
= hostfs_truncate
,
907 .permission
= hostfs_permission
,
908 .setattr
= hostfs_setattr
,
909 .getattr
= hostfs_getattr
,
912 static struct inode_operations hostfs_dir_iops
= {
913 .create
= hostfs_create
,
914 .lookup
= hostfs_lookup
,
916 .unlink
= hostfs_unlink
,
917 .symlink
= hostfs_symlink
,
918 .mkdir
= hostfs_mkdir
,
919 .rmdir
= hostfs_rmdir
,
920 .mknod
= hostfs_mknod
,
921 .rename
= hostfs_rename
,
922 .truncate
= hostfs_truncate
,
923 .permission
= hostfs_permission
,
924 .setattr
= hostfs_setattr
,
925 .getattr
= hostfs_getattr
,
928 int hostfs_link_readpage(struct file
*file
, struct page
*page
)
934 start
= page
->index
<< PAGE_CACHE_SHIFT
;
936 name
= inode_name(page
->mapping
->host
, 0);
937 if(name
== NULL
) return(-ENOMEM
);
938 err
= do_readlink(name
, buffer
, PAGE_CACHE_SIZE
);
940 if(err
== PAGE_CACHE_SIZE
)
943 flush_dcache_page(page
);
944 SetPageUptodate(page
);
945 if (PageError(page
)) ClearPageError(page
);
953 static struct address_space_operations hostfs_link_aops
= {
954 .readpage
= hostfs_link_readpage
,
957 static int hostfs_fill_sb_common(struct super_block
*sb
, void *d
, int silent
)
959 struct inode
*root_inode
;
960 char *name
, *data
= d
;
963 sb
->s_blocksize
= 1024;
964 sb
->s_blocksize_bits
= 10;
965 sb
->s_magic
= HOSTFS_SUPER_MAGIC
;
966 sb
->s_op
= &hostfs_sbops
;
968 if((data
== NULL
) || (*data
== '\0'))
972 name
= kmalloc(strlen(data
) + 1, GFP_KERNEL
);
978 root_inode
= iget(sb
, 0);
979 if(root_inode
== NULL
)
982 err
= init_inode(root_inode
, NULL
);
986 HOSTFS_I(root_inode
)->host_filename
= name
;
989 sb
->s_root
= d_alloc_root(root_inode
);
990 if(sb
->s_root
== NULL
)
993 err
= read_inode(root_inode
);
1007 static struct super_block
*hostfs_read_sb(struct file_system_type
*type
,
1008 int flags
, const char *dev_name
,
1011 return(get_sb_nodev(type
, flags
, data
, hostfs_fill_sb_common
));
1014 static struct file_system_type hostfs_type
= {
1015 .owner
= THIS_MODULE
,
1017 .get_sb
= hostfs_read_sb
,
1018 .kill_sb
= kill_anon_super
,
1022 static int __init
init_hostfs(void)
1024 return(register_filesystem(&hostfs_type
));
1027 static void __exit
exit_hostfs(void)
1029 unregister_filesystem(&hostfs_type
);
1032 module_init(init_hostfs
)
1033 module_exit(exit_hostfs
)
1034 MODULE_LICENSE("GPL");
1037 * Overrides for Emacs so that we follow Linus's tabbing style.
1038 * Emacs will notice this stuff at the end of the file and automatically
1039 * adjust the settings for this buffer only. This must remain at the end
1041 * ---------------------------------------------------------------------------
1043 * c-file-style: "linux"