5 #include <minix/vfsif.h>
8 /*===========================================================================*
10 *===========================================================================*/
11 int fs_newnode(message
*fs_m_in
, message
*fs_m_out
)
20 uid
= fs_m_in
->m_vfs_fs_newnode
.uid
;
21 gid
= fs_m_in
->m_vfs_fs_newnode
.gid
;
22 bits
= fs_m_in
->m_vfs_fs_newnode
.mode
;
23 dev
= fs_m_in
->m_vfs_fs_newnode
.device
;
25 /* Try to allocate the inode */
26 if( (rip
= alloc_inode(dev
, bits
, uid
, gid
) ) == NULL
) return(err_code
);
28 switch (bits
& S_IFMT
) {
31 rip
->i_rdev
= dev
; /* Major/minor dev numbers */
34 if ((get_block(dev
, rip
->i_num
)) == NULL
)
38 r
= EIO
; /* Unsupported file type */
44 /* Fill in the fields of the response message */
45 fs_m_out
->m_fs_vfs_newnode
.inode
= rip
->i_num
;
46 fs_m_out
->m_fs_vfs_newnode
.mode
= rip
->i_mode
;
47 fs_m_out
->m_fs_vfs_newnode
.file_size
= rip
->i_size
;
48 fs_m_out
->m_fs_vfs_newnode
.uid
= rip
->i_uid
;
49 fs_m_out
->m_fs_vfs_newnode
.gid
= rip
->i_gid
;
50 fs_m_out
->m_fs_vfs_newnode
.device
= dev
;