2 #include <minix/vfsif.h>
4 int fs_mount(dev_t dev
, unsigned int __unused flags
,
5 struct fsdriver_node
*root_node
, unsigned int *res_flags
)
11 /* Open the device the file system lives on in read only mode */
12 if (bdev_open(fs_dev
, BDEV_R_BIT
) != OK
)
15 /* Read the superblock */
16 r
= read_vds(&v_pri
, fs_dev
);
22 /* Return some root inode properties */
23 root_node
->fn_ino_nr
= v_pri
.inode_root
->i_stat
.st_ino
;
24 root_node
->fn_mode
= v_pri
.inode_root
->i_stat
.st_mode
;
25 root_node
->fn_size
= v_pri
.inode_root
->i_stat
.st_size
;
26 root_node
->fn_uid
= SYS_UID
; /* Always root */
27 root_node
->fn_gid
= SYS_GID
; /* wheel */
28 root_node
->fn_dev
= NO_DEV
;
30 *res_flags
= RES_NOFLAGS
;
35 int fs_mountpt(ino_t ino_nr
)
38 * This function looks up the mount point, it checks the condition
39 * whether the partition can be mounted on the inode or not.
43 if ((rip
= get_inode(ino_nr
)) == NULL
)
46 if (rip
->i_mountpoint
)
49 /* The inode must be a directory. */
50 if ((rip
->i_stat
.st_mode
& I_TYPE
) != I_DIRECTORY
)
53 rip
->i_mountpoint
= TRUE
;
60 release_vol_pri_desc(&v_pri
); /* Release the super block */
64 if (check_inodes() == FALSE
)
65 puts("ISOFS: unmounting with in-use inodes!\n");