Re: [PATCH v2 5/5] Change filesystem utime_h handler to utimens_h

2021-05-10 Thread Joel Sherrill
On Mon, May 10, 2021 at 12:48 PM Gedare Bloom  wrote:

> On Thu, May 6, 2021 at 1:51 PM Ryan Long  wrote:
> >
> > Also updated licenses.
> >
> > Closes #4400
> > ---
> >  bsps/arm/csb337/umon/tfsDriver.c|  2 +-
> >  cpukit/Makefile.am  |  4 +--
> >  cpukit/include/rtems/confdefs/libio.h   |  4 +--
> >  cpukit/include/rtems/imfs.h |  7 +++--
> >  cpukit/include/rtems/libio.h| 21 +++
> >  cpukit/libcsupport/src/__usrenv.c   |  9 +++
> >  cpukit/libfs/src/defaults/default_ops.c |  2 +-
> >  cpukit/libfs/src/defaults/default_utime.c   | 32 --
> >  cpukit/libfs/src/defaults/default_utimens.c | 33 +++
> >  cpukit/libfs/src/dosfs/msdos_init.c | 11 
> >  cpukit/libfs/src/ftpfs/ftpfs.c  |  2 +-
> >  cpukit/libfs/src/ftpfs/tftpDriver.c |  2 +-
> >  cpukit/libfs/src/imfs/imfs_init.c   |  4 +--
> >  cpukit/libfs/src/imfs/imfs_utime.c  | 41
> 
> >  cpukit/libfs/src/imfs/imfs_utimens.c| 42
> +
> >  cpukit/libfs/src/jffs2/src/fs-rtems.c   | 11 
> >  cpukit/libfs/src/rfs/rtems-rfs-rtems.c  | 16 +--
> >  spec/build/cpukit/librtemscpu.yml   |  4 +--
> >  18 files changed, 120 insertions(+), 127 deletions(-)
> >  delete mode 100644 cpukit/libfs/src/defaults/default_utime.c
> >  create mode 100644 cpukit/libfs/src/defaults/default_utimens.c
> >  delete mode 100644 cpukit/libfs/src/imfs/imfs_utime.c
> >  create mode 100644 cpukit/libfs/src/imfs/imfs_utimens.c
> >
> > diff --git a/bsps/arm/csb337/umon/tfsDriver.c
> b/bsps/arm/csb337/umon/tfsDriver.c
> > index 0195346..caf3a4b 100644
> > --- a/bsps/arm/csb337/umon/tfsDriver.c
> > +++ b/bsps/arm/csb337/umon/tfsDriver.c
> > @@ -657,7 +657,7 @@ static const rtems_filesystem_operations_table
> rtems_tfs_ops = {
> >.mount_h = rtems_filesystem_default_mount,
> >.unmount_h = rtems_filesystem_default_unmount,
> >.fsunmount_me_h = rtems_filesystem_default_fsunmount,
> > -  .utime_h = rtems_filesystem_default_utime,
> > +  .utimens_h = rtems_filesystem_default_utimens,
> >.symlink_h = rtems_filesystem_default_symlink,
> >.readlink_h = rtems_filesystem_default_readlink,
> >.rename_h = rtems_filesystem_default_rename,
> > diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
> > index 29b4207..c144773 100644
> > --- a/cpukit/Makefile.am
> > +++ b/cpukit/Makefile.am
> > @@ -377,7 +377,7 @@ librtemscpu_a_SOURCES +=
> libfs/src/defaults/default_rmnod.c
> >  librtemscpu_a_SOURCES += libfs/src/defaults/default_statvfs.c
> >  librtemscpu_a_SOURCES += libfs/src/defaults/default_symlink.c
> >  librtemscpu_a_SOURCES += libfs/src/defaults/default_unmount.c
> > -librtemscpu_a_SOURCES += libfs/src/defaults/default_utime.c
> > +librtemscpu_a_SOURCES += libfs/src/defaults/default_utimens.c
> >  librtemscpu_a_SOURCES += libfs/src/defaults/default_write.c
> >  librtemscpu_a_SOURCES += libfs/src/defaults/default_writev.c
> >  librtemscpu_a_SOURCES += libfs/src/dosfs/fat.c
> > @@ -434,7 +434,7 @@ librtemscpu_a_SOURCES += libfs/src/imfs/imfs_stat.c
> >  librtemscpu_a_SOURCES += libfs/src/imfs/imfs_stat_file.c
> >  librtemscpu_a_SOURCES += libfs/src/imfs/imfs_symlink.c
> >  librtemscpu_a_SOURCES += libfs/src/imfs/imfs_unmount.c
> > -librtemscpu_a_SOURCES += libfs/src/imfs/imfs_utime.c
> > +librtemscpu_a_SOURCES += libfs/src/imfs/imfs_utimens.c
> >  librtemscpu_a_SOURCES += libfs/src/imfs/ioman.c
> >  librtemscpu_a_SOURCES += libfs/src/pipe/fifo.c
> >  librtemscpu_a_SOURCES += libfs/src/pipe/pipe.c
> > diff --git a/cpukit/include/rtems/confdefs/libio.h
> b/cpukit/include/rtems/confdefs/libio.h
> > index 16a4fb69..1b84f8c 100644
> > --- a/cpukit/include/rtems/confdefs/libio.h
> > +++ b/cpukit/include/rtems/confdefs/libio.h
> > @@ -231,9 +231,9 @@ static const rtems_filesystem_operations_table
> IMFS_root_ops = {
> >#endif
> >rtems_filesystem_default_fsunmount,
> >#ifdef CONFIGURE_IMFS_DISABLE_UTIME
> > -rtems_filesystem_default_utime,
> > +rtems_filesystem_default_utimens,
> >#else
> > -IMFS_utime,
> > +IMFS_utimens,
> >#endif
> >#ifdef CONFIGURE_IMFS_DISABLE_SYMLINK
> >  rtems_filesystem_default_symlink,
> > diff --git a/cpukit/include/rtems/imfs.h b/cpukit/include/rtems/imfs.h
> > index b2a9868..6e0d5d5 100644
> > --- a/cpukit/include/rtems/imfs.h
> > +++ b/cpukit/include/rtems/imfs.h
> > @@ -5,7 +5,7 @@
> >   */
> >
> >  /*
> > - *  COPYRIGHT (c) 1989-2011.
> > + *  COPYRIGHT (c) 1989-2011, 2021.
> >   *  On-Line Applications Research Corporation (OAR).
> >   *
> >   *  The license and distribution terms for this file may be
> fix license?
>

That is OK. And add SPDX.

I've generally encouraged only changing the license and adding SPDX
on files with substantial change.

But a part of me just wants to rip through areas which are clearly
written by the core 

Re: [PATCH v2 5/5] Change filesystem utime_h handler to utimens_h

2021-05-10 Thread Gedare Bloom
On Thu, May 6, 2021 at 1:51 PM Ryan Long  wrote:
>
> Also updated licenses.
>
> Closes #4400
> ---
>  bsps/arm/csb337/umon/tfsDriver.c|  2 +-
>  cpukit/Makefile.am  |  4 +--
>  cpukit/include/rtems/confdefs/libio.h   |  4 +--
>  cpukit/include/rtems/imfs.h |  7 +++--
>  cpukit/include/rtems/libio.h| 21 +++
>  cpukit/libcsupport/src/__usrenv.c   |  9 +++
>  cpukit/libfs/src/defaults/default_ops.c |  2 +-
>  cpukit/libfs/src/defaults/default_utime.c   | 32 --
>  cpukit/libfs/src/defaults/default_utimens.c | 33 +++
>  cpukit/libfs/src/dosfs/msdos_init.c | 11 
>  cpukit/libfs/src/ftpfs/ftpfs.c  |  2 +-
>  cpukit/libfs/src/ftpfs/tftpDriver.c |  2 +-
>  cpukit/libfs/src/imfs/imfs_init.c   |  4 +--
>  cpukit/libfs/src/imfs/imfs_utime.c  | 41 
>  cpukit/libfs/src/imfs/imfs_utimens.c| 42 
> +
>  cpukit/libfs/src/jffs2/src/fs-rtems.c   | 11 
>  cpukit/libfs/src/rfs/rtems-rfs-rtems.c  | 16 +--
>  spec/build/cpukit/librtemscpu.yml   |  4 +--
>  18 files changed, 120 insertions(+), 127 deletions(-)
>  delete mode 100644 cpukit/libfs/src/defaults/default_utime.c
>  create mode 100644 cpukit/libfs/src/defaults/default_utimens.c
>  delete mode 100644 cpukit/libfs/src/imfs/imfs_utime.c
>  create mode 100644 cpukit/libfs/src/imfs/imfs_utimens.c
>
> diff --git a/bsps/arm/csb337/umon/tfsDriver.c 
> b/bsps/arm/csb337/umon/tfsDriver.c
> index 0195346..caf3a4b 100644
> --- a/bsps/arm/csb337/umon/tfsDriver.c
> +++ b/bsps/arm/csb337/umon/tfsDriver.c
> @@ -657,7 +657,7 @@ static const rtems_filesystem_operations_table  
> rtems_tfs_ops = {
>.mount_h = rtems_filesystem_default_mount,
>.unmount_h = rtems_filesystem_default_unmount,
>.fsunmount_me_h = rtems_filesystem_default_fsunmount,
> -  .utime_h = rtems_filesystem_default_utime,
> +  .utimens_h = rtems_filesystem_default_utimens,
>.symlink_h = rtems_filesystem_default_symlink,
>.readlink_h = rtems_filesystem_default_readlink,
>.rename_h = rtems_filesystem_default_rename,
> diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
> index 29b4207..c144773 100644
> --- a/cpukit/Makefile.am
> +++ b/cpukit/Makefile.am
> @@ -377,7 +377,7 @@ librtemscpu_a_SOURCES += 
> libfs/src/defaults/default_rmnod.c
>  librtemscpu_a_SOURCES += libfs/src/defaults/default_statvfs.c
>  librtemscpu_a_SOURCES += libfs/src/defaults/default_symlink.c
>  librtemscpu_a_SOURCES += libfs/src/defaults/default_unmount.c
> -librtemscpu_a_SOURCES += libfs/src/defaults/default_utime.c
> +librtemscpu_a_SOURCES += libfs/src/defaults/default_utimens.c
>  librtemscpu_a_SOURCES += libfs/src/defaults/default_write.c
>  librtemscpu_a_SOURCES += libfs/src/defaults/default_writev.c
>  librtemscpu_a_SOURCES += libfs/src/dosfs/fat.c
> @@ -434,7 +434,7 @@ librtemscpu_a_SOURCES += libfs/src/imfs/imfs_stat.c
>  librtemscpu_a_SOURCES += libfs/src/imfs/imfs_stat_file.c
>  librtemscpu_a_SOURCES += libfs/src/imfs/imfs_symlink.c
>  librtemscpu_a_SOURCES += libfs/src/imfs/imfs_unmount.c
> -librtemscpu_a_SOURCES += libfs/src/imfs/imfs_utime.c
> +librtemscpu_a_SOURCES += libfs/src/imfs/imfs_utimens.c
>  librtemscpu_a_SOURCES += libfs/src/imfs/ioman.c
>  librtemscpu_a_SOURCES += libfs/src/pipe/fifo.c
>  librtemscpu_a_SOURCES += libfs/src/pipe/pipe.c
> diff --git a/cpukit/include/rtems/confdefs/libio.h 
> b/cpukit/include/rtems/confdefs/libio.h
> index 16a4fb69..1b84f8c 100644
> --- a/cpukit/include/rtems/confdefs/libio.h
> +++ b/cpukit/include/rtems/confdefs/libio.h
> @@ -231,9 +231,9 @@ static const rtems_filesystem_operations_table 
> IMFS_root_ops = {
>#endif
>rtems_filesystem_default_fsunmount,
>#ifdef CONFIGURE_IMFS_DISABLE_UTIME
> -rtems_filesystem_default_utime,
> +rtems_filesystem_default_utimens,
>#else
> -IMFS_utime,
> +IMFS_utimens,
>#endif
>#ifdef CONFIGURE_IMFS_DISABLE_SYMLINK
>  rtems_filesystem_default_symlink,
> diff --git a/cpukit/include/rtems/imfs.h b/cpukit/include/rtems/imfs.h
> index b2a9868..6e0d5d5 100644
> --- a/cpukit/include/rtems/imfs.h
> +++ b/cpukit/include/rtems/imfs.h
> @@ -5,7 +5,7 @@
>   */
>
>  /*
> - *  COPYRIGHT (c) 1989-2011.
> + *  COPYRIGHT (c) 1989-2011, 2021.
>   *  On-Line Applications Research Corporation (OAR).
>   *
>   *  The license and distribution terms for this file may be
fix license?

> @@ -954,10 +954,9 @@ extern int device_ftruncate(
>   * This routine is the implementation of the utime() system
>   * call for the IMFS.
>   */
> -extern int IMFS_utime(
> +extern int IMFS_utimens(
>const rtems_filesystem_location_info_t *loc,
> -  time_t actime,
> -  time_t modtime
> +  struct timespec times[2]
>  );
>
>  /**
> diff --git a/cpukit/include/rtems/libio.h b/cpukit/include/rtems/libio.h
> index 519e797..99543ba 100644
> --- 

[PATCH v2 5/5] Change filesystem utime_h handler to utimens_h

2021-05-06 Thread Ryan Long
Also updated licenses.

Closes #4400
---
 bsps/arm/csb337/umon/tfsDriver.c|  2 +-
 cpukit/Makefile.am  |  4 +--
 cpukit/include/rtems/confdefs/libio.h   |  4 +--
 cpukit/include/rtems/imfs.h |  7 +++--
 cpukit/include/rtems/libio.h| 21 +++
 cpukit/libcsupport/src/__usrenv.c   |  9 +++
 cpukit/libfs/src/defaults/default_ops.c |  2 +-
 cpukit/libfs/src/defaults/default_utime.c   | 32 --
 cpukit/libfs/src/defaults/default_utimens.c | 33 +++
 cpukit/libfs/src/dosfs/msdos_init.c | 11 
 cpukit/libfs/src/ftpfs/ftpfs.c  |  2 +-
 cpukit/libfs/src/ftpfs/tftpDriver.c |  2 +-
 cpukit/libfs/src/imfs/imfs_init.c   |  4 +--
 cpukit/libfs/src/imfs/imfs_utime.c  | 41 
 cpukit/libfs/src/imfs/imfs_utimens.c| 42 +
 cpukit/libfs/src/jffs2/src/fs-rtems.c   | 11 
 cpukit/libfs/src/rfs/rtems-rfs-rtems.c  | 16 +--
 spec/build/cpukit/librtemscpu.yml   |  4 +--
 18 files changed, 120 insertions(+), 127 deletions(-)
 delete mode 100644 cpukit/libfs/src/defaults/default_utime.c
 create mode 100644 cpukit/libfs/src/defaults/default_utimens.c
 delete mode 100644 cpukit/libfs/src/imfs/imfs_utime.c
 create mode 100644 cpukit/libfs/src/imfs/imfs_utimens.c

diff --git a/bsps/arm/csb337/umon/tfsDriver.c b/bsps/arm/csb337/umon/tfsDriver.c
index 0195346..caf3a4b 100644
--- a/bsps/arm/csb337/umon/tfsDriver.c
+++ b/bsps/arm/csb337/umon/tfsDriver.c
@@ -657,7 +657,7 @@ static const rtems_filesystem_operations_table  
rtems_tfs_ops = {
   .mount_h = rtems_filesystem_default_mount,
   .unmount_h = rtems_filesystem_default_unmount,
   .fsunmount_me_h = rtems_filesystem_default_fsunmount,
-  .utime_h = rtems_filesystem_default_utime,
+  .utimens_h = rtems_filesystem_default_utimens,
   .symlink_h = rtems_filesystem_default_symlink,
   .readlink_h = rtems_filesystem_default_readlink,
   .rename_h = rtems_filesystem_default_rename,
diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 29b4207..c144773 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -377,7 +377,7 @@ librtemscpu_a_SOURCES += libfs/src/defaults/default_rmnod.c
 librtemscpu_a_SOURCES += libfs/src/defaults/default_statvfs.c
 librtemscpu_a_SOURCES += libfs/src/defaults/default_symlink.c
 librtemscpu_a_SOURCES += libfs/src/defaults/default_unmount.c
-librtemscpu_a_SOURCES += libfs/src/defaults/default_utime.c
+librtemscpu_a_SOURCES += libfs/src/defaults/default_utimens.c
 librtemscpu_a_SOURCES += libfs/src/defaults/default_write.c
 librtemscpu_a_SOURCES += libfs/src/defaults/default_writev.c
 librtemscpu_a_SOURCES += libfs/src/dosfs/fat.c
@@ -434,7 +434,7 @@ librtemscpu_a_SOURCES += libfs/src/imfs/imfs_stat.c
 librtemscpu_a_SOURCES += libfs/src/imfs/imfs_stat_file.c
 librtemscpu_a_SOURCES += libfs/src/imfs/imfs_symlink.c
 librtemscpu_a_SOURCES += libfs/src/imfs/imfs_unmount.c
-librtemscpu_a_SOURCES += libfs/src/imfs/imfs_utime.c
+librtemscpu_a_SOURCES += libfs/src/imfs/imfs_utimens.c
 librtemscpu_a_SOURCES += libfs/src/imfs/ioman.c
 librtemscpu_a_SOURCES += libfs/src/pipe/fifo.c
 librtemscpu_a_SOURCES += libfs/src/pipe/pipe.c
diff --git a/cpukit/include/rtems/confdefs/libio.h 
b/cpukit/include/rtems/confdefs/libio.h
index 16a4fb69..1b84f8c 100644
--- a/cpukit/include/rtems/confdefs/libio.h
+++ b/cpukit/include/rtems/confdefs/libio.h
@@ -231,9 +231,9 @@ static const rtems_filesystem_operations_table 
IMFS_root_ops = {
   #endif
   rtems_filesystem_default_fsunmount,
   #ifdef CONFIGURE_IMFS_DISABLE_UTIME
-rtems_filesystem_default_utime,
+rtems_filesystem_default_utimens,
   #else
-IMFS_utime,
+IMFS_utimens,
   #endif
   #ifdef CONFIGURE_IMFS_DISABLE_SYMLINK
 rtems_filesystem_default_symlink,
diff --git a/cpukit/include/rtems/imfs.h b/cpukit/include/rtems/imfs.h
index b2a9868..6e0d5d5 100644
--- a/cpukit/include/rtems/imfs.h
+++ b/cpukit/include/rtems/imfs.h
@@ -5,7 +5,7 @@
  */
 
 /*
- *  COPYRIGHT (c) 1989-2011.
+ *  COPYRIGHT (c) 1989-2011, 2021.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -954,10 +954,9 @@ extern int device_ftruncate(
  * This routine is the implementation of the utime() system
  * call for the IMFS.
  */
-extern int IMFS_utime(
+extern int IMFS_utimens(
   const rtems_filesystem_location_info_t *loc,
-  time_t actime,
-  time_t modtime
+  struct timespec times[2]
 );
 
 /**
diff --git a/cpukit/include/rtems/libio.h b/cpukit/include/rtems/libio.h
index 519e797..99543ba 100644
--- a/cpukit/include/rtems/libio.h
+++ b/cpukit/include/rtems/libio.h
@@ -11,7 +11,7 @@
  */
 
 /*
- *  COPYRIGHT (c) 1989-2008.
+ *  COPYRIGHT (c) 1989-2008, 2021.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  Modifications to support reference counting in the file system are
@@ -375,18