2011-11-14 12:53:05 +01:00
|
|
|
/* Created (MFS based):
|
|
|
|
* February 2010 (Evgeniy Ivanov)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "fs.h"
|
|
|
|
#include <minix/callnr.h>
|
|
|
|
#include <minix/com.h>
|
|
|
|
#include <minix/vfsif.h>
|
|
|
|
|
|
|
|
#include "puffs.h"
|
|
|
|
#include "puffs_priv.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* fs_utime *
|
|
|
|
*===========================================================================*/
|
2014-02-24 14:00:17 +01:00
|
|
|
int fs_utime(void)
|
2011-11-14 12:53:05 +01:00
|
|
|
{
|
|
|
|
struct puffs_node *pn;
|
|
|
|
struct vattr va;
|
|
|
|
PUFFS_MAKECRED(pcr, &global_kcred);
|
|
|
|
|
|
|
|
if (is_readonly_fs)
|
|
|
|
return(EROFS);
|
|
|
|
|
|
|
|
if (global_pu->pu_ops.puffs_node_setattr == NULL)
|
|
|
|
return(EINVAL);
|
|
|
|
|
|
|
|
if( (pn = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.REQ_INODE_NR)) == NULL)
|
|
|
|
return(EINVAL);
|
|
|
|
|
|
|
|
puffs_vattr_null(&va);
|
|
|
|
va.va_atime.tv_sec = fs_m_in.REQ_ACTIME;
|
2013-04-07 10:44:49 +02:00
|
|
|
va.va_atime.tv_nsec = fs_m_in.REQ_ACNSEC;
|
2011-11-14 12:53:05 +01:00
|
|
|
va.va_mtime.tv_sec = fs_m_in.REQ_MODTIME;
|
2013-04-07 10:44:49 +02:00
|
|
|
va.va_mtime.tv_nsec = fs_m_in.REQ_MODNSEC;
|
2013-04-07 10:42:26 +02:00
|
|
|
va.va_ctime = clock_timespec();
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
if (global_pu->pu_ops.puffs_node_setattr(global_pu, pn, &va, pcr) != 0)
|
|
|
|
return(EINVAL);
|
|
|
|
|
|
|
|
return(OK);
|
|
|
|
}
|