1 /* VTreeFS - mount.c - by Alen Stojanov and David van Moolenbroek */
5 /*===========================================================================*
7 *===========================================================================*/
10 /* This function gets the root inode and sends back its details.
14 /* Get the device number, for stat requests. */
15 fs_dev
= fs_m_in
.REQ_DEV
;
17 /* The VTreeFS must not be mounted as a root file system. */
18 if (fs_m_in
.REQ_FLAGS
& REQ_ISROOT
)
21 /* Get the root inode and increase its reference count. */
22 root
= get_root_inode();
25 /* The system is now mounted. Call the initialization hook. */
26 if (vtreefs_hooks
->init_hook
!= NULL
)
27 vtreefs_hooks
->init_hook();
29 /* Return the root inode's properties. */
30 fs_m_out
.RES_INODE_NR
= get_inode_number(root
);
31 fs_m_out
.RES_MODE
= root
->i_stat
.mode
;
32 fs_m_out
.RES_FILE_SIZE_HI
= 0;
33 fs_m_out
.RES_FILE_SIZE_LO
= root
->i_stat
.size
;
34 fs_m_out
.RES_UID
= root
->i_stat
.uid
;
35 fs_m_out
.RES_GID
= root
->i_stat
.gid
;
36 fs_m_out
.RES_DEV
= NO_DEV
;
38 fs_m_out
.RES_CONREQS
= 1;/* We can handle only 1 request at a time */
45 /*===========================================================================*
47 *===========================================================================*/
50 /* Unmount the file system.
54 /* Decrease the count of the root inode. */
55 root
= get_root_inode();
59 /* The system is unmounted. Call the cleanup hook. */
60 if (vtreefs_hooks
->cleanup_hook
!= NULL
)
61 vtreefs_hooks
->cleanup_hook();
63 /* We can now be shut down safely. */