5 #include <minix/vfsif.h>
8 /*===========================================================================*
10 *===========================================================================*/
11 int fs_newnode(message
*fs_m_in
, message
*fs_m_out
)
18 caller_uid
= (uid_t
) fs_m_in
->REQ_UID
;
19 caller_gid
= (gid_t
) fs_m_in
->REQ_GID
;
20 bits
= (mode_t
) fs_m_in
->REQ_MODE
;
21 dev
= (dev_t
) fs_m_in
->REQ_DEV
;
23 /* Try to allocate the inode */
24 if( (rip
= alloc_inode(dev
, bits
) ) == NULL
) return(err_code
);
26 switch (bits
& S_IFMT
) {
29 rip
->i_rdev
= dev
; /* Major/minor dev numbers */
32 if ((get_block(dev
, rip
->i_num
)) == NULL
)
36 r
= EIO
; /* Unsupported file type */
42 /* Fill in the fields of the response message */
43 fs_m_out
->RES_INODE_NR
= rip
->i_num
;
44 fs_m_out
->RES_MODE
= rip
->i_mode
;
45 fs_m_out
->RES_FILE_SIZE_LO
= rip
->i_size
;
46 fs_m_out
->RES_UID
= rip
->i_uid
;
47 fs_m_out
->RES_GID
= rip
->i_gid
;
48 fs_m_out
->RES_DEV
= dev
;