2011-11-14 12:53:05 +01:00
|
|
|
/* Created (MFS based):
|
|
|
|
* February 2010 (Evgeniy Ivanov)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "fs.h"
|
|
|
|
#include "puffs.h"
|
|
|
|
#include "puffs_priv.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* fs_utime *
|
|
|
|
*===========================================================================*/
|
2014-08-24 11:51:35 +02:00
|
|
|
int fs_utime(ino_t ino_nr, struct timespec *atime, struct timespec *mtime)
|
2011-11-14 12:53:05 +01:00
|
|
|
{
|
|
|
|
struct puffs_node *pn;
|
|
|
|
struct vattr va;
|
|
|
|
PUFFS_MAKECRED(pcr, &global_kcred);
|
|
|
|
|
|
|
|
if (global_pu->pu_ops.puffs_node_setattr == NULL)
|
|
|
|
return(EINVAL);
|
|
|
|
|
2014-08-24 11:51:35 +02:00
|
|
|
if( (pn = puffs_pn_nodewalk(global_pu, 0, &ino_nr)) == NULL)
|
2011-11-14 12:53:05 +01:00
|
|
|
return(EINVAL);
|
2014-08-24 11:51:35 +02:00
|
|
|
|
2011-11-14 12:53:05 +01:00
|
|
|
puffs_vattr_null(&va);
|
2014-08-24 11:51:35 +02:00
|
|
|
va.va_atime = *atime;
|
|
|
|
va.va_mtime = *mtime;
|
2014-08-24 12:00:06 +02:00
|
|
|
(void)clock_time(&va.va_ctime);
|
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);
|
|
|
|
}
|