<div dir="ltr"><div>As a warning, this and the corresponding libbsd patch are queued </div><div>behind an RSB patch to get UTIME_NOW and UTIME_OMIT in</div><div>newlib. That patch was merged into newlib. Then the RTEMS </div><div>*utime* patch set and these two will go in at the same time. Otherwise,</div><div>there will be breakage.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 21, 2021 at 9:26 AM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, May 3, 2021 at 12:41 PM Ryan Long <<a href="mailto:ryan.long@oarcorp.com" target="_blank">ryan.long@oarcorp.com</a>> wrote:<br>
><br>
> Changed nfs_utime() to nfs_utimens(), changed the arguments to use<br>
> a timespec array instead of individual variables for access and<br>
> modified time.<br>
><br>
> Updates #4400<br>
> ---<br>
>  nfsclient/src/nfs.c | 50 +++++++++++++++++++++++++-------------------------<br>
>  1 file changed, 25 insertions(+), 25 deletions(-)<br>
><br>
> diff --git a/nfsclient/src/nfs.c b/nfsclient/src/nfs.c<br>
> index bc9a2c6..72fefb9 100644<br>
> --- a/nfsclient/src/nfs.c<br>
> +++ b/nfsclient/src/nfs.c<br>
> @@ -2050,19 +2050,19 @@ static int nfs_rmnod(<br>
>         return rv;<br>
>  }<br>
><br>
> -static int nfs_utime(<br>
> +static int nfs_utimens(<br>
>         const rtems_filesystem_location_info_t  *pathloc, /* IN */<br>
> -       time_t                                   actime,  /* IN */<br>
> -       time_t                                   modtime  /* IN */<br>
> +       struct timespec                          times[2] /* IN */<br>
> +<br>
>  )<br>
>  {<br>
>  sattr  arg;<br>
><br>
>         /* TODO: add rtems EPOCH - UNIX EPOCH seconds */<br>
> -       arg.atime.seconds  = actime;<br>
> -       arg.atime.useconds = 0;<br>
> -       arg.mtime.seconds  = modtime;<br>
> -       arg.mtime.useconds = 0;<br>
> +       arg.atime.seconds  = times[0].tv_sec;<br>
> +       arg.atime.useconds = times[0].tv_nsec / 1000;<br>
Do we have a macro exposed for this, like in<br>
TOD_NANOSECONDS_PER_MICROSECOND? If not, this is fine I suppose.<br></blockquote><div><br></div><div>This wouldn't be public since it doesn't start with RTEMS_ and I don't</div><div>see any of the TOD_ constants redefined in the RTEMS namespace. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> +       arg.mtime.seconds  = times[1].tv_sec;<br>
> +       arg.mtime.useconds = times[1].tv_nsec / 1000;<br>
><br>
>         return nfs_sattr(pathloc->node_access, &arg, SATTR_ATIME | SATTR_MTIME);<br>
>  }<br>
> @@ -2254,25 +2254,25 @@ sattr   arg;<br>
>  }<br>
><br>
>  const struct _rtems_filesystem_operations_table nfs_fs_ops = {<br>
> -       .lock_h         = nfs_lock,<br>
> -       .unlock_h       = nfs_unlock,<br>
> -       .eval_path_h    = nfs_eval_path,<br>
> -       .link_h         = nfs_link,<br>
> +       .lock_h            = nfs_lock,<br>
> +       .unlock_h          = nfs_unlock,<br>
> +       .eval_path_h       = nfs_eval_path,<br>
> +       .link_h            = nfs_link,<br>
>         .are_nodes_equal_h = nfs_are_nodes_equal,<br>
> -       .mknod_h        = nfs_mknod,<br>
> -       .rmnod_h        = nfs_rmnod,<br>
> -       .fchmod_h       = nfs_fchmod,<br>
> -       .chown_h        = nfs_chown,<br>
> -       .clonenod_h     = nfs_clonenode,<br>
> -       .freenod_h      = nfs_freenode,<br>
> -       .mount_h        = rtems_filesystem_default_mount,<br>
> -       .unmount_h      = rtems_filesystem_default_unmount,<br>
> -       .fsunmount_me_h = nfs_fsunmount_me,<br>
> -       .utime_h        = nfs_utime,<br>
> -       .symlink_h      = nfs_symlink,<br>
> -       .readlink_h     = nfs_readlink,<br>
> -       .rename_h       = nfs_rename,<br>
> -       .statvfs_h      = rtems_filesystem_default_statvfs<br>
> +       .mknod_h           = nfs_mknod,<br>
> +       .rmnod_h           = nfs_rmnod,<br>
> +       .fchmod_h          = nfs_fchmod,<br>
> +       .chown_h           = nfs_chown,<br>
> +       .clonenod_h        = nfs_clonenode,<br>
> +       .freenod_h         = nfs_freenode,<br>
> +       .mount_h           = rtems_filesystem_default_mount,<br>
> +       .unmount_h         = rtems_filesystem_default_unmount,<br>
> +       .fsunmount_me_h    = nfs_fsunmount_me,<br>
> +       .utimens_h         = nfs_utimens,<br>
> +       .symlink_h         = nfs_symlink,<br>
> +       .readlink_h        = nfs_readlink,<br>
> +       .rename_h          = nfs_rename,<br>
> +       .statvfs_h         = rtems_filesystem_default_statvfs<br>
Why so many additional whitespace changes?<br>
<br>
>  };<br>
><br>
>  /*****************************************<br>
> --<br>
> 1.8.3.1<br>
><br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>