1 /* This file contains the wrapper functions for issuing a request
2 * and receiving response from FS processes.
3 * Each function builds a request message according to the request
4 * parameter, calls the most low-level fs_sendrec, and copies
12 #include <sys/statfs.h>
13 #include <sys/statvfs.h>
14 #include <minix/vfsif.h>
15 #include <minix/com.h>
16 #include <minix/const.h>
17 #include <minix/endpoint.h>
18 #include <minix/u64.h>
28 /*===========================================================================*
30 *===========================================================================*/
36 unsigned int num_of_bytes
,
44 cp_grant_id_t grant_id
;
47 grant_id
= cpf_grant_magic(fs_e
, user_e
, (vir_bytes
) user_addr
, num_of_bytes
,
48 (rw_flag
== READING
? CPF_WRITE
: CPF_READ
));
50 panic("req_breadwrite: cpf_grant_magic failed");
52 /* Fill in request message */
53 m
.m_type
= rw_flag
== READING
? REQ_BREAD
: REQ_BWRITE
;
55 m
.REQ_GRANT
= grant_id
;
56 m
.REQ_SEEK_POS_LO
= ex64lo(pos
);
57 m
.REQ_SEEK_POS_HI
= ex64hi(pos
);
58 m
.REQ_NBYTES
= num_of_bytes
;
60 /* Send/rec request */
61 r
= fs_sendrec(fs_e
, &m
);
63 if (r
!= OK
) return(r
);
65 /* Fill in response structure */
66 *new_posp
= make64(m
.RES_SEEK_POS_LO
, m
.RES_SEEK_POS_HI
);
67 *cum_iop
= m
.RES_NBYTES
;
72 /*===========================================================================*
74 *===========================================================================*/
75 int req_bpeek(endpoint_t fs_e
, dev_t dev
, u64_t pos
, unsigned int num_of_bytes
)
79 memset(&m
, 0, sizeof(m
));
81 /* Fill in request message */
84 m
.REQ_SEEK_POS_LO
= ex64lo(pos
);
85 m
.REQ_SEEK_POS_HI
= ex64hi(pos
);
86 m
.REQ_NBYTES
= num_of_bytes
;
88 /* Send/rec request */
89 return fs_sendrec(fs_e
, &m
);
94 /*===========================================================================*
96 *===========================================================================*/
107 /* Fill in request message */
108 m
.m_type
= REQ_CHMOD
;
109 m
.REQ_INODE_NR
= inode_nr
;
112 /* Send/rec request */
113 r
= fs_sendrec(fs_e
, &m
);
115 /* Copy back actual mode. */
116 *new_modep
= m
.RES_MODE
;
122 /*===========================================================================*
124 *===========================================================================*/
136 /* Fill in request message */
137 m
.m_type
= REQ_CHOWN
;
138 m
.REQ_INODE_NR
= inode_nr
;
142 /* Send/rec request */
143 r
= fs_sendrec(fs_e
, &m
);
145 /* Return new mode to caller. */
146 *new_modep
= m
.RES_MODE
;
152 /*===========================================================================*
154 *===========================================================================*/
166 cp_grant_id_t grant_id
;
171 panic("req_create: filename starts with '/'");
173 len
= strlen(path
) + 1;
174 grant_id
= cpf_grant_direct(fs_e
, (vir_bytes
) path
, len
, CPF_READ
);
176 panic("req_create: cpf_grant_direct failed");
178 /* Fill in request message */
179 m
.m_type
= REQ_CREATE
;
180 m
.REQ_INODE_NR
= inode_nr
;
184 m
.REQ_GRANT
= grant_id
;
185 m
.REQ_PATH_LEN
= len
;
187 /* Send/rec request */
188 r
= fs_sendrec(fs_e
, &m
);
189 cpf_revoke(grant_id
);
190 if (r
!= OK
) return(r
);
192 /* Fill in response structure */
193 res
->fs_e
= m
.m_source
;
194 res
->inode_nr
= m
.RES_INODE_NR
;
195 res
->fmode
= m
.RES_MODE
;
196 res
->fsize
= m
.RES_FILE_SIZE_LO
;
197 res
->uid
= m
.RES_UID
;
198 res
->gid
= m
.RES_GID
;
205 /*===========================================================================*
207 *===========================================================================*/
208 int req_flush(endpoint_t fs_e
, dev_t dev
)
212 /* Fill in request message */
213 m
.m_type
= REQ_FLUSH
;
216 /* Send/rec request */
217 return fs_sendrec(fs_e
, &m
);
221 /*===========================================================================*
223 *===========================================================================*/
224 int req_fstatfs(endpoint_t fs_e
, endpoint_t proc_e
, vir_bytes buf
)
227 cp_grant_id_t grant_id
;
230 grant_id
= cpf_grant_magic(fs_e
, proc_e
, buf
, sizeof(struct statfs
),
232 if (grant_id
== GRANT_INVALID
)
233 panic("req_fstatfs: cpf_grant_magic failed");
235 /* Fill in request message */
236 m
.m_type
= REQ_FSTATFS
;
237 m
.REQ_GRANT
= grant_id
;
239 /* Send/rec request */
240 r
= fs_sendrec(fs_e
, &m
);
241 cpf_revoke(grant_id
);
247 /*===========================================================================*
249 *===========================================================================*/
250 int req_statvfs(endpoint_t fs_e
, endpoint_t proc_e
, vir_bytes buf
)
253 cp_grant_id_t grant_id
;
256 grant_id
= cpf_grant_magic(fs_e
, proc_e
, buf
, sizeof(struct statvfs
),
258 if(grant_id
== GRANT_INVALID
)
259 panic("req_statvfs: cpf_grant_magic failed");
261 /* Fill in request message */
262 m
.m_type
= REQ_STATVFS
;
263 m
.REQ_GRANT
= grant_id
;
265 /* Send/rec request */
266 r
= fs_sendrec(fs_e
, &m
);
267 cpf_revoke(grant_id
);
273 /*===========================================================================*
275 *===========================================================================*/
276 int req_ftrunc(endpoint_t fs_e
, ino_t inode_nr
, off_t start
, off_t end
)
280 /* Fill in request message */
281 m
.m_type
= REQ_FTRUNC
;
282 m
.REQ_INODE_NR
= inode_nr
;
283 m
.REQ_TRC_START_LO
= start
;
284 m
.REQ_TRC_START_HI
= 0; /* Not used for now, so clear it. */
285 m
.REQ_TRC_END_LO
= end
;
286 m
.REQ_TRC_END_HI
= 0; /* Not used for now, so clear it. */
288 /* Send/rec request */
289 return fs_sendrec(fs_e
, &m
);
293 /*===========================================================================*
295 *===========================================================================*/
308 cp_grant_id_t grant_id
;
311 grant_id
= cpf_grant_direct(fs_e
, (vir_bytes
) buf
, size
,
314 grant_id
= cpf_grant_magic(fs_e
, who_e
, (vir_bytes
) buf
, size
,
319 panic("req_getdents: cpf_grant_direct/cpf_grant_magic failed: %d",
322 m
.m_type
= REQ_GETDENTS
;
323 m
.REQ_INODE_NR
= inode_nr
;
324 m
.REQ_GRANT
= grant_id
;
325 m
.REQ_MEM_SIZE
= size
;
326 m
.REQ_SEEK_POS_LO
= ex64lo(pos
);
327 m
.REQ_SEEK_POS_HI
= 0; /* Not used for now, so clear it. */
329 r
= fs_sendrec(fs_e
, &m
);
330 cpf_revoke(grant_id
);
333 *new_pos
= ((u64_t
)(m
.RES_SEEK_POS_LO
));
340 /*===========================================================================*
342 *===========================================================================*/
343 int req_inhibread(endpoint_t fs_e
, ino_t inode_nr
)
347 /* Fill in request message */
348 m
.m_type
= REQ_INHIBREAD
;
349 m
.REQ_INODE_NR
= inode_nr
;
351 /* Send/rec request */
352 return fs_sendrec(fs_e
, &m
);
356 /*===========================================================================*
358 *===========================================================================*/
367 cp_grant_id_t grant_id
;
368 const size_t len
= strlen(lastc
) + 1;
371 grant_id
= cpf_grant_direct(fs_e
, (vir_bytes
)lastc
, len
, CPF_READ
);
373 panic("req_link: cpf_grant_direct failed");
375 /* Fill in request message */
377 m
.REQ_INODE_NR
= linked_file
;
378 m
.REQ_DIR_INO
= link_parent
;
379 m
.REQ_GRANT
= grant_id
;
380 m
.REQ_PATH_LEN
= len
;
382 /* Send/rec request */
383 r
= fs_sendrec(fs_e
, &m
);
384 cpf_revoke(grant_id
);
390 /*===========================================================================*
392 *===========================================================================*/
399 struct lookup
*resolve
,
406 cp_grant_id_t grant_id
=0, grant_id2
=0;
408 vfs_ucred_t credentials
;
411 grant_id
= cpf_grant_direct(fs_e
, (vir_bytes
) resolve
->l_path
, PATH_MAX
,
412 CPF_READ
| CPF_WRITE
);
414 panic("req_lookup: cpf_grant_direct failed");
416 flags
= resolve
->l_flags
;
417 len
= strlen(resolve
->l_path
) + 1;
419 m
.m_type
= REQ_LOOKUP
;
420 m
.REQ_GRANT
= grant_id
;
421 m
.REQ_PATH_LEN
= len
;
422 m
.REQ_PATH_SIZE
= PATH_MAX
+ 1;
423 m
.REQ_DIR_INO
= dir_ino
;
424 m
.REQ_ROOT_INO
= root_ino
;
426 if(rfp
->fp_ngroups
> 0) { /* Is the process member of multiple groups? */
427 /* In that case the FS has to copy the uid/gid credentials */
430 /* Set credentials */
431 credentials
.vu_uid
= rfp
->fp_effuid
;
432 credentials
.vu_gid
= rfp
->fp_effgid
;
433 credentials
.vu_ngroups
= rfp
->fp_ngroups
;
434 for (i
= 0; i
< rfp
->fp_ngroups
; i
++)
435 credentials
.vu_sgroups
[i
] = rfp
->fp_sgroups
[i
];
437 grant_id2
= cpf_grant_direct(fs_e
, (vir_bytes
) &credentials
,
438 sizeof(credentials
), CPF_READ
);
440 panic("req_lookup: cpf_grant_direct failed");
442 m
.REQ_GRANT2
= grant_id2
;
443 m
.REQ_UCRED_SIZE
= sizeof(credentials
);
444 flags
|= PATH_GET_UCRED
;
446 /* When there's only one gid, we can send it directly */
449 flags
&= ~PATH_GET_UCRED
;
454 /* Send/rec request */
455 r
= fs_sendrec(fs_e
, &m
);
456 cpf_revoke(grant_id
);
457 if(rfp
->fp_ngroups
> 0) cpf_revoke(grant_id2
);
459 /* Fill in response according to the return value */
460 res
->fs_e
= m
.m_source
;
464 res
->inode_nr
= m
.RES_INODE_NR
;
465 res
->fmode
= m
.RES_MODE
;
466 res
->fsize
= m
.RES_FILE_SIZE_LO
;
467 res
->dev
= m
.RES_DEV
;
472 res
->inode_nr
= m
.RES_INODE_NR
;
473 res
->char_processed
= m
.RES_OFFSET
;
474 res
->symloop
= m
.RES_SYMLOOP
;
477 res
->char_processed
= m
.RES_OFFSET
;
478 res
->symloop
= m
.RES_SYMLOOP
;
481 res
->char_processed
= m
.RES_OFFSET
;
482 res
->symloop
= m
.RES_SYMLOOP
;
492 /*===========================================================================*
494 *===========================================================================*/
505 cp_grant_id_t grant_id
;
509 len
= strlen(lastc
) + 1;
510 grant_id
= cpf_grant_direct(fs_e
, (vir_bytes
)lastc
, len
, CPF_READ
);
512 panic("req_mkdir: cpf_grant_direct failed");
514 /* Fill in request message */
515 m
.m_type
= REQ_MKDIR
;
516 m
.REQ_INODE_NR
= inode_nr
;
520 m
.REQ_GRANT
= grant_id
;
521 m
.REQ_PATH_LEN
= len
;
523 /* Send/rec request */
524 r
= fs_sendrec(fs_e
, &m
);
525 cpf_revoke(grant_id
);
531 /*===========================================================================*
533 *===========================================================================*/
546 cp_grant_id_t grant_id
;
549 len
= strlen(lastc
) + 1;
550 grant_id
= cpf_grant_direct(fs_e
, (vir_bytes
)lastc
, len
, CPF_READ
);
552 panic("req_mknod: cpf_grant_direct failed");
554 /* Fill in request message */
555 m
.m_type
= REQ_MKNOD
;
556 m
.REQ_INODE_NR
= inode_nr
;
561 m
.REQ_GRANT
= grant_id
;
562 m
.REQ_PATH_LEN
= len
;
564 /* Send/rec request */
565 r
= fs_sendrec(fs_e
, &m
);
566 cpf_revoke(grant_id
);
572 /*===========================================================================*
574 *===========================================================================*/
575 int req_mountpoint(endpoint_t fs_e
, ino_t inode_nr
)
579 /* Fill in request message */
580 m
.m_type
= REQ_MOUNTPOINT
;
581 m
.REQ_INODE_NR
= inode_nr
;
583 /* Send/rec request */
584 return fs_sendrec(fs_e
, &m
);
588 /*===========================================================================*
590 *===========================================================================*/
597 struct node_details
*res
603 /* Fill in request message */
604 m
.m_type
= REQ_NEWNODE
;
610 /* Send/rec request */
611 r
= fs_sendrec(fs_e
, &m
);
613 res
->fs_e
= m
.m_source
;
614 res
->inode_nr
= m
.RES_INODE_NR
;
615 res
->fmode
= m
.RES_MODE
;
616 res
->fsize
= m
.RES_FILE_SIZE_LO
;
617 res
->dev
= m
.RES_DEV
;
618 res
->uid
= m
.RES_UID
;
619 res
->gid
= m
.RES_GID
;
625 /*===========================================================================*
627 *===========================================================================*/
634 cp_grant_id_t grant_id
;
639 /* Grant access to label */
640 len
= strlen(label
) + 1;
641 grant_id
= cpf_grant_direct(fs_e
, (vir_bytes
) label
, len
, CPF_READ
);
643 panic("req_newdriver: cpf_grant_direct failed");
645 /* Fill in request message */
646 m
.m_type
= REQ_NEW_DRIVER
;
648 m
.REQ_GRANT
= grant_id
;
649 m
.REQ_PATH_LEN
= len
;
652 r
= fs_sendrec(fs_e
, &m
);
654 cpf_revoke(grant_id
);
660 /*===========================================================================*
662 *===========================================================================*/
663 int req_putnode(fs_e
, inode_nr
, count
)
670 /* Fill in request message */
671 m
.m_type
= REQ_PUTNODE
;
672 m
.REQ_INODE_NR
= inode_nr
;
675 /* Send/rec request */
676 return fs_sendrec(fs_e
, &m
);
680 /*===========================================================================*
682 *===========================================================================*/
683 int req_rdlink(fs_e
, inode_nr
, proc_e
, buf
, len
, direct
)
689 int direct
; /* set to 1 to use direct grants instead of magic grants */
693 cp_grant_id_t grant_id
;
696 grant_id
= cpf_grant_direct(fs_e
, buf
, len
, CPF_WRITE
);
698 grant_id
= cpf_grant_magic(fs_e
, proc_e
, buf
, len
, CPF_WRITE
);
701 panic("req_rdlink: cpf_grant_magic failed");
703 /* Fill in request message */
704 m
.m_type
= REQ_RDLINK
;
705 m
.REQ_INODE_NR
= inode_nr
;
706 m
.REQ_GRANT
= grant_id
;
707 m
.REQ_MEM_SIZE
= len
;
709 /* Send/rec request */
710 r
= fs_sendrec(fs_e
, &m
);
711 cpf_revoke(grant_id
);
713 if (r
== OK
) r
= m
.RES_NBYTES
;
719 /*===========================================================================*
721 *===========================================================================*/
728 struct node_details
*res_nodep
,
733 cp_grant_id_t grant_id
;
737 len
= strlen(label
)+1;
738 grant_id
= cpf_grant_direct(fs_e
, (vir_bytes
) label
, len
, CPF_READ
);
740 panic("req_readsuper: cpf_grant_direct failed");
742 /* Fill in request message */
743 m
.m_type
= REQ_READSUPER
;
745 if(readonly
) m
.REQ_FLAGS
|= REQ_RDONLY
;
746 if(isroot
) m
.REQ_FLAGS
|= REQ_ISROOT
;
747 m
.REQ_GRANT
= grant_id
;
749 m
.REQ_PATH_LEN
= len
;
751 /* Send/rec request */
752 r
= fs_sendrec(fs_e
, &m
);
753 cpf_revoke(grant_id
);
756 /* Fill in response structure */
757 res_nodep
->fs_e
= m
.m_source
;
758 res_nodep
->inode_nr
= m
.RES_INODE_NR
;
759 res_nodep
->fmode
= m
.RES_MODE
;
760 res_nodep
->fsize
= m
.RES_FILE_SIZE_LO
;
761 res_nodep
->uid
= m
.RES_UID
;
762 res_nodep
->gid
= m
.RES_GID
;
763 *con_reqs
= m
.RES_CONREQS
;
770 /*===========================================================================*
772 *===========================================================================*/
773 int req_readwrite(fs_e
, inode_nr
, pos
, rw_flag
, user_e
,
774 user_addr
, num_of_bytes
, new_posp
, cum_iop
)
781 unsigned int num_of_bytes
;
783 unsigned int *cum_iop
;
786 cp_grant_id_t grant_id
;
789 if (ex64hi(pos
) != 0)
790 panic("req_readwrite: pos too large");
792 grant_id
= cpf_grant_magic(fs_e
, user_e
, (vir_bytes
) user_addr
, num_of_bytes
,
793 (rw_flag
==READING
? CPF_WRITE
:CPF_READ
));
795 panic("req_readwrite: cpf_grant_magic failed");
797 /* Fill in request message */
798 m
.m_type
= rw_flag
== READING
? REQ_READ
: REQ_WRITE
;
799 m
.REQ_INODE_NR
= inode_nr
;
800 m
.REQ_GRANT
= grant_id
;
801 m
.REQ_SEEK_POS_LO
= ex64lo(pos
);
802 m
.REQ_SEEK_POS_HI
= 0; /* Not used for now, so clear it. */
803 m
.REQ_NBYTES
= num_of_bytes
;
805 /* Send/rec request */
806 r
= fs_sendrec(fs_e
, &m
);
807 cpf_revoke(grant_id
);
810 /* Fill in response structure */
811 *new_posp
= ((u64_t
)(m
.RES_SEEK_POS_LO
));
812 *cum_iop
= m
.RES_NBYTES
;
818 /*===========================================================================*
820 *===========================================================================*/
821 int req_peek(endpoint_t fs_e
, ino_t inode_nr
, u64_t pos
, unsigned int bytes
)
825 memset(&m
, 0, sizeof(m
));
827 if (ex64hi(pos
) != 0)
828 panic("req_peek: pos too large");
830 /* Fill in request message */
832 m
.REQ_INODE_NR
= inode_nr
;
834 m
.REQ_SEEK_POS_LO
= ex64lo(pos
);
835 m
.REQ_SEEK_POS_HI
= 0; /* Not used for now, so clear it. */
836 m
.REQ_NBYTES
= bytes
;
838 /* Send/rec request */
839 return fs_sendrec(fs_e
, &m
);
842 /*===========================================================================*
844 *===========================================================================*/
845 int req_rename(fs_e
, old_dir
, old_name
, new_dir
, new_name
)
853 cp_grant_id_t gid_old
, gid_new
;
854 size_t len_old
, len_new
;
857 len_old
= strlen(old_name
) + 1;
858 gid_old
= cpf_grant_direct(fs_e
, (vir_bytes
) old_name
, len_old
, CPF_READ
);
860 panic("req_rename: cpf_grant_direct failed");
862 len_new
= strlen(new_name
) + 1;
863 gid_new
= cpf_grant_direct(fs_e
, (vir_bytes
) new_name
, len_new
, CPF_READ
);
865 panic("req_rename: cpf_grant_direct failed");
867 /* Fill in request message */
868 m
.m_type
= REQ_RENAME
;
869 m
.REQ_REN_OLD_DIR
= old_dir
;
870 m
.REQ_REN_NEW_DIR
= new_dir
;
871 m
.REQ_REN_GRANT_OLD
= gid_old
;
872 m
.REQ_REN_LEN_OLD
= len_old
;
873 m
.REQ_REN_GRANT_NEW
= gid_new
;
874 m
.REQ_REN_LEN_NEW
= len_new
;
876 /* Send/rec request */
877 r
= fs_sendrec(fs_e
, &m
);
885 /*===========================================================================*
887 *===========================================================================*/
888 int req_rmdir(fs_e
, inode_nr
, lastc
)
894 cp_grant_id_t grant_id
;
898 len
= strlen(lastc
) + 1;
899 grant_id
= cpf_grant_direct(fs_e
, (vir_bytes
) lastc
, len
, CPF_READ
);
901 panic("req_rmdir: cpf_grant_direct failed");
903 /* Fill in request message */
904 m
.m_type
= REQ_RMDIR
;
905 m
.REQ_INODE_NR
= inode_nr
;
906 m
.REQ_GRANT
= grant_id
;
907 m
.REQ_PATH_LEN
= len
;
909 /* Send/rec request */
910 r
= fs_sendrec(fs_e
, &m
);
911 cpf_revoke(grant_id
);
917 /*===========================================================================*
919 *===========================================================================*/
933 cp_grant_id_t gid_name
, gid_buf
;
936 len
= strlen(lastc
) + 1;
937 gid_name
= cpf_grant_direct(fs_e
, (vir_bytes
) lastc
, len
, CPF_READ
);
938 if (gid_name
== GRANT_INVALID
)
939 panic("req_slink: cpf_grant_direct failed");
941 gid_buf
= cpf_grant_magic(fs_e
, proc_e
, path_addr
, path_length
, CPF_READ
);
942 if (gid_buf
== GRANT_INVALID
) {
943 cpf_revoke(gid_name
);
944 panic("req_slink: cpf_grant_magic failed");
947 /* Fill in request message */
948 m
.m_type
= REQ_SLINK
;
949 m
.REQ_INODE_NR
= inode_nr
;
952 m
.REQ_GRANT
= gid_name
;
953 m
.REQ_PATH_LEN
= len
;
954 m
.REQ_GRANT3
= gid_buf
;
955 m
.REQ_MEM_SIZE
= path_length
;
957 /* Send/rec request */
958 r
= fs_sendrec(fs_e
, &m
);
959 cpf_revoke(gid_name
);
966 /*===========================================================================*
968 *===========================================================================*/
969 int req_stat(endpoint_t fs_e
, ino_t inode_nr
, endpoint_t proc_e
, vir_bytes buf
)
971 cp_grant_id_t grant_id
;
975 /* Grant FS access to copy straight into user provided buffer */
976 grant_id
= cpf_grant_magic(fs_e
, proc_e
, buf
, sizeof(struct stat
), CPF_WRITE
);
979 panic("req_stat: cpf_grant_* failed");
981 /* Fill in request message */
983 m
.REQ_INODE_NR
= inode_nr
;
984 m
.REQ_GRANT
= grant_id
;
986 /* Send/rec request */
987 r
= fs_sendrec(fs_e
, &m
);
988 cpf_revoke(grant_id
);
994 /*===========================================================================*
996 *===========================================================================*/
1002 /* Fill in request message */
1003 m
.m_type
= REQ_SYNC
;
1005 /* Send/rec request */
1006 return fs_sendrec(fs_e
, &m
);
1010 /*===========================================================================*
1012 *===========================================================================*/
1013 int req_unlink(fs_e
, inode_nr
, lastc
)
1018 cp_grant_id_t grant_id
;
1023 len
= strlen(lastc
) + 1;
1024 grant_id
= cpf_grant_direct(fs_e
, (vir_bytes
) lastc
, len
, CPF_READ
);
1026 panic("req_unlink: cpf_grant_direct failed");
1028 /* Fill in request message */
1029 m
.m_type
= REQ_UNLINK
;
1030 m
.REQ_INODE_NR
= inode_nr
;
1031 m
.REQ_GRANT
= grant_id
;
1032 m
.REQ_PATH_LEN
= len
;
1034 /* Send/rec request */
1035 r
= fs_sendrec(fs_e
, &m
);
1036 cpf_revoke(grant_id
);
1042 /*===========================================================================*
1044 *===========================================================================*/
1045 int req_unmount(fs_e
)
1050 /* Fill in request message */
1051 m
.m_type
= REQ_UNMOUNT
;
1053 /* Send/rec request */
1054 return fs_sendrec(fs_e
, &m
);
1058 /*===========================================================================*
1060 *===========================================================================*/
1061 int req_utime(endpoint_t fs_e
, ino_t inode_nr
, struct timespec
* actimespec
,
1062 struct timespec
* modtimespec
)
1066 assert(actimespec
!= NULL
);
1067 assert(modtimespec
!= NULL
);
1069 /* Fill in request message */
1070 m
.m_type
= REQ_UTIME
;
1071 m
.REQ_INODE_NR
= inode_nr
;
1072 m
.REQ_ACTIME
= actimespec
->tv_sec
;
1073 m
.REQ_MODTIME
= modtimespec
->tv_sec
;
1074 m
.REQ_ACNSEC
= actimespec
->tv_nsec
;
1075 m
.REQ_MODNSEC
= modtimespec
->tv_nsec
;
1077 /* Send/rec request */
1078 return fs_sendrec(fs_e
, &m
);