kernel: restore setting KTS_NONE
[minix.git] / servers / ext2 / time.c
blob2db6dcd794f4a42130fc42bada3b7dc654421723
1 /* Created (MFS based):
2 * February 2010 (Evgeniy Ivanov)
3 */
5 #include "fs.h"
6 #include <minix/callnr.h>
7 #include <minix/com.h>
8 #include "inode.h"
9 #include <minix/vfsif.h>
12 /*===========================================================================*
13 * fs_utime *
14 *===========================================================================*/
15 int fs_utime()
17 register struct inode *rip;
18 register int r;
20 /* Temporarily open the file. */
21 if( (rip = get_inode(fs_dev, (ino_t) fs_m_in.REQ_INODE_NR)) == NULL)
22 return(EINVAL);
24 /* Only the owner of a file or the super_user can change its time. */
25 r = OK;
26 if(read_only(rip) != OK) r = EROFS; /* not even su can touch if R/O */
27 if(r == OK) {
28 rip->i_atime = fs_m_in.REQ_ACTIME;
29 rip->i_mtime = fs_m_in.REQ_MODTIME;
30 rip->i_update = CTIME; /* discard any stale ATIME and MTIME flags */
31 rip->i_dirt = IN_DIRTY;
34 put_inode(rip);
35 return(r);