[PATCH v2 1/4] stat: drop statbuf argument from out_epoch_sec()

2019-04-13 Thread Jeff Layton
This argument is unused, and the function itself is not used outside of src/stat.c. * src/stat.c: drop statbuf argument from out_epoch_sec() --- src/stat.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/stat.c b/src/stat.c index bb1ef1a3d9ec..a0f32b32b958 100644

[PATCH v2 2/4] stat: use statx instead of stat if it's available

2019-04-13 Thread Jeff Layton
If HAVE_STATX is available, then use statx instead of stat/lstat/fstat. This necessitates some copying due to the fact that we need a struct stat to pass to some of the gnulib printing routines. * src/stat.c: more comprehensive use of statx when available --- src/stat.c | 565

[PATCH v2 4/4] stat: support statx DONT_SYNC and FORCE_SYNC flags

2019-04-13 Thread Jeff Layton
Add two new command-line options that set the appropriate hint flags in the statx call. These are primarily used with network filesystems to indicate what level of cache coherency the application can tolerate. The new options are only implemented when built with HAVE_STATX. * NEWS: mention the

[PATCH v2 0/4] stat: better utilization of statx on the backend

2019-04-13 Thread Jeff Layton
two new command-line options that allow it to control whether to synchronize with the backend server (again, mostly useful on network filesystems). Jeff Layton (4): stat: drop statbuf argument from out_epoch_sec() stat: use statx instead of stat if it's available stat: only set STATX_* mask b

[PATCH v3 2/4] stat: use statx instead of stat if it's available

2019-04-16 Thread Jeff Layton
If HAVE_STATX is available, then use statx instead of stat/lstat/fstat. This necessitates some copying due to the fact that we need a struct stat to pass to some of the gnulib printing routines. * src/stat.c: more comprehensive use of statx when available --- src/stat.c | 566

[PATCH v3 0/4] stat: better utilization of statx on the backend

2019-04-16 Thread Jeff Layton
ment for some filesystems (particularly networked ones). This also adds two new command-line options that allow it to control whether to synchronize with the backend server (again, mostly useful on network filesystems). Jeff Layton (4): stat: drop statbuf argument from out_epoch_sec() stat: use

[PATCH v3 1/4] stat: drop statbuf argument from out_epoch_sec()

2019-04-16 Thread Jeff Layton
This argument is unused, and the function itself is not used outside of src/stat.c. * src/stat.c: drop statbuf argument from out_epoch_sec() --- src/stat.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/stat.c b/src/stat.c index bb1ef1a3d9ec..a0f32b32b958 100644

[PATCH v3 4/4] stat: support statx DONT_SYNC and FORCE_SYNC flags

2019-04-16 Thread Jeff Layton
Add two new command-line options that set the appropriate hint flags in the statx call. These are primarily used with network filesystems to indicate what level of cache coherency the application can tolerate. The new options are only implemented when built with HAVE_STATX. * NEWS: mention the

[PATCH v3 3/4] stat: only set STATX_* mask bits for things we want to print

2019-04-16 Thread Jeff Layton
Scan the format string to build a STATX_* mask prior to calling statx. This allows us to avoid setting bits for attributes that we don't intend to display, which can mean a much lighter-weight operation on some filesystems. * src/stat.c: only set STATX_* mask bits for things we want to print ---

[PATCH 2/4] stat: use statx instead of stat if it's available

2019-04-12 Thread Jeff Layton
If HAVE_STATX is available, then use statx instead of stat/lstat/fstat. This necessitates some copying due to the fact that we need a struct stat to pass to some of the gnulib printing routines. * src/stat.c: more comprehensive use of statx when available --- src/stat.c | 561

[PATCH 4/4] stat: support statx DONT_SYNC and FORCE_SYNC flags

2019-04-12 Thread Jeff Layton
Add two new command-line options that change how the statx call that set the appropriate flags in the statx call, to modify its behavior vs. network filesystems. These options are only implemented when built with HAVE_STATX. * NEWS: mention the enhancements * src/stat.c: add new options to

[PATCH 0/4] stat: better utilization of statx on the backend

2019-04-12 Thread Jeff Layton
adds two new command-line options that allow it to control whether to synchronize with the backend server (again, mostly useful on network filesystems). Jeff Layton (4): stat: drop statbuf argument from out_epoch_sec() stat: use statx instead of stat if it's available stat: only set STATX_

[PATCH 1/4] stat: drop statbuf argument from out_epoch_sec()

2019-04-12 Thread Jeff Layton
This argument is unused, and the function itself is not used outside of src/stat.c. * src/stat.c: drop statbuf argument from out_epoch_sec() --- src/stat.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/stat.c b/src/stat.c index bb1ef1a3d9ec..a0f32b32b958 100644

[PATCH 3/4] stat: only set STATX_* mask bits for things we want to print

2019-04-12 Thread Jeff Layton
Scan the format string to build a STATX_* mask prior to calling statx. This allows us to avoid setting bits for attributes that we don't intend to display, which can mean a much lighter-weight operation on some filesystems. * src/stat.c: only set STATX_* mask bits for things we want to print ---

Re: extending cp to use copy_file_range system call

2019-06-07 Thread Jeff Layton
t on the mailing list). > +1 Just add new --offload / --no-offload options and wire up accordingly. We could start with --no-offload being the default and flip that later, once we feel that it's safe enough. -- Jeff Layton

Re: [PATCH V6 adjustments]

2019-06-05 Thread Jeff Layton
this? Should we just apply the v6 set, and put yours on top, or would you rather I merge these deltas into the set and send a v7 series? Thanks, -- Jeff Layton

[PATCH v6 1/4] stat: drop statbuf argument from out_epoch_sec()

2019-05-28 Thread Jeff Layton
This argument is unused, and the function itself is not used outside of src/stat.c. * src/stat.c: drop statbuf argument from out_epoch_sec() --- src/stat.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/stat.c b/src/stat.c index bb1ef1a3d9ec..a0f32b32b958 100644

[PATCH v6 2/4] stat: use statx instead of stat if it's available

2019-05-28 Thread Jeff Layton
If HAVE_STATX is available, then use statx instead of stat/lstat/fstat. This necessitates some copying due to the fact that we need a struct stat to pass to some of the gnulib printing routines. * src/stat.c: more comprehensive use of statx when available --- src/stat.c | 566

[PATCH v6 0/4] stat: better utilization of statx() on the backend

2019-05-28 Thread Jeff Layton
ful on network filesystems). Jeff Layton (4): stat: drop statbuf argument from out_epoch_sec() stat: use statx instead of stat if it's available stat: only set STATX_* mask bits for things we want to print stat: support statx DONT_SYNC and FORCE_SYNC flags NEWS | 7 + src/stat.c |

[PATCH v6 3/4] stat: only set STATX_* mask bits for things we want to print

2019-05-28 Thread Jeff Layton
Scan the format string to build a STATX_* mask prior to calling statx. This allows us to avoid setting bits for attributes that we don't intend to display, which can mean a much lighter-weight operation on some filesystems. * src/stat.c: only set STATX_* mask bits for things we want to print ---

[PATCH v6 4/4] stat: support statx DONT_SYNC and FORCE_SYNC flags

2019-05-28 Thread Jeff Layton
Add a new --cache= command-line option that sets the appropriate hint flags in the statx call. These are primarily used with network filesystems to indicate what level of cache coherency the application can tolerate. The new option is only implemented when built with HAVE_STATX. * NEWS: mention

Re: [PATCH V6 adjustments]

2019-06-06 Thread Jeff Layton
On Wed, 2019-06-05 at 23:46 +0100, Pádraig Brady wrote: > On 05/06/19 16:52, Jeff Layton wrote: > > On Mon, 2019-06-03 at 03:55 +0100, Pádraig Brady wrote: > > > The main change here is to refactor code duplication. > > > In particular this reuses the large print_stat()

[PATCH] stat: don't test for STATX_INO until it has been included

2019-06-14 Thread Jeff Layton
* STATX_INO isn't defined until stat.h is included. Move the test down so it works properly. --- src/stat.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/stat.c b/src/stat.c index 3bb84f35d4c0..ec0bb7de496c 100644 --- a/src/stat.c +++ b/src/stat.c @@

[PATCH v5 2/4] stat: use statx instead of stat if it's available

2019-05-13 Thread Jeff Layton
If HAVE_STATX is available, then use statx instead of stat/lstat/fstat. This necessitates some copying due to the fact that we need a struct stat to pass to some of the gnulib printing routines. * src/stat.c: more comprehensive use of statx when available --- src/stat.c | 566

[PATCH v5 3/4] stat: only set STATX_* mask bits for things we want to print

2019-05-13 Thread Jeff Layton
Scan the format string to build a STATX_* mask prior to calling statx. This allows us to avoid setting bits for attributes that we don't intend to display, which can mean a much lighter-weight operation on some filesystems. * src/stat.c: only set STATX_* mask bits for things we want to print ---

[PATCH v5 4/4] stat: support statx DONT_SYNC and FORCE_SYNC flags

2019-05-13 Thread Jeff Layton
Add a new --cache= command-line option that sets the appropriate hint flags in the statx call. These are primarily used with network filesystems to indicate what level of cache coherency the application can tolerate. The new option is only implemented when built with HAVE_STATX. * NEWS: mention

[PATCH v5 0/4] stat: better utilization of statx() on the backend

2019-05-13 Thread Jeff Layton
e backend server (again, mostly useful on network filesystems). Jeff Layton (4): stat: drop statbuf argument from out_epoch_sec() stat: use statx instead of stat if it's available stat: only set STATX_* mask bits for things we want to print stat: support statx DONT_SYNC and FORCE_SYNC flags

Re: [PATCH v5 4/4] stat: support statx DONT_SYNC and FORCE_SYNC flags

2019-05-13 Thread Jeff Layton
On Mon, 2019-05-13 at 09:18 -0400, Jeff Layton wrote: > Add a new --cache= command-line option that sets the appropriate hint > flags in the statx call. These are primarily used with network > filesystems to indicate what level of cache coherency the application > can tolerate. Th

Re: [PATCH v4 3/4] stat: only set STATX_* mask bits for things we want to print

2019-05-13 Thread Jeff Layton
On Fri, 2019-05-10 at 02:28 -0700, Pádraig Brady wrote: > On 01/05/19 06:57, Jeff Layton wrote: > > Scan the format string to build a STATX_* mask prior to calling statx. > > This allows us to avoid setting bits for attributes that we don't > > intend to display, which ca

[PATCH v4 2/4] stat: use statx instead of stat if it's available

2019-05-01 Thread Jeff Layton
If HAVE_STATX is available, then use statx instead of stat/lstat/fstat. This necessitates some copying due to the fact that we need a struct stat to pass to some of the gnulib printing routines. * src/stat.c: more comprehensive use of statx when available --- src/stat.c | 566

[PATCH v4 0/4] stat: better utilization of statx on the backend

2019-05-01 Thread Jeff Layton
k filesystems). Jeff Layton (4): stat: drop statbuf argument from out_epoch_sec() stat: use statx instead of stat if it's available stat: only set STATX_* mask bits for things we want to print stat: support statx DONT_SYNC and FORCE_SYNC flags NEWS | 8 + src

[PATCH v4 3/4] stat: only set STATX_* mask bits for things we want to print

2019-05-01 Thread Jeff Layton
Scan the format string to build a STATX_* mask prior to calling statx. This allows us to avoid setting bits for attributes that we don't intend to display, which can mean a much lighter-weight operation on some filesystems. * src/stat.c: only set STATX_* mask bits for things we want to print ---

[PATCH v4 4/4] stat: support statx DONT_SYNC and FORCE_SYNC flags

2019-05-01 Thread Jeff Layton
Add a new --cache= command-line option that set the appropriate hint flags in the statx call. These are primarily used with network filesystems to indicate what level of cache coherency the application can tolerate. The new option is only implemented when built with HAVE_STATX. * NEWS: mention

[PATCH v4 1/4] stat: drop statbuf argument from out_epoch_sec()

2019-05-01 Thread Jeff Layton
This argument is unused, and the function itself is not used outside of src/stat.c. * src/stat.c: drop statbuf argument from out_epoch_sec() --- src/stat.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/stat.c b/src/stat.c index bb1ef1a3d9ec..a0f32b32b958 100644

Re: [PATCH v3 4/4] stat: support statx DONT_SYNC and FORCE_SYNC flags

2019-05-01 Thread Jeff Layton
On Mon, 2019-04-29 at 09:40 -0700, Pádraig Brady wrote: > On 23/04/19 04:59, Jeff Layton wrote: > > > +#if HAVE_STATX && defined STATX_INO > > > + fputs (_("\ > > > + -D, --dont-sync don't synchronize with server (for network > &g

Re: [PATCH] stat: don't explicitly request file size for filenames

2019-07-05 Thread Jeff Layton
On Fri, 2019-07-05 at 06:18 -0400, Jeff Layton wrote: > On Thu, 2019-07-04 at 21:18 +, Andreas Dilger wrote: > > On Jul 4, 2019, at 04:43, Jeff Layton wrote: > > > On Thu, 2019-07-04 at 06:37 -0400, Jeff Layton wrote: > > > > On Wed, 2019-07-03 at 20:

Re: [PATCH] stat: don't explicitly request file size for filenames

2019-07-05 Thread Jeff Layton
On Thu, 2019-07-04 at 21:18 +, Andreas Dilger wrote: > On Jul 4, 2019, at 04:43, Jeff Layton wrote: > > On Thu, 2019-07-04 at 06:37 -0400, Jeff Layton wrote: > > > On Wed, 2019-07-03 at 20:24 +, Andreas Dilger wrote: > > > > When calling 'stat -c %N

Re: [PATCH] stat: don't explicitly request file size for filenames

2019-07-04 Thread Jeff Layton
ilename, statbuf->st_size ?: > +1023); >if (linkname == NULL) > { >error (0, errno, _("cannot read symbolic link %s"), Looks reasonable to me. Reviewed-by: Jeff Layton

Re: [PATCH] stat: don't explicitly request file size for filenames

2019-07-04 Thread Jeff Layton
On Thu, 2019-07-04 at 06:37 -0400, Jeff Layton wrote: > On Wed, 2019-07-03 at 20:24 +, Andreas Dilger wrote: > > When calling 'stat -c %N' to print the filename, don't explicitly > > request the size of the file via statx(), as it may add overhead on > > some filesyste

Re: [PATCH v3 4/4] stat: support statx DONT_SYNC and FORCE_SYNC flags

2019-04-23 Thread Jeff Layton
On Tue, Apr 16, 2019 at 5:23 PM Jeff Layton wrote: > > Add two new command-line options that set the appropriate hint flags in > the statx call. These are primarily used with network filesystems to > indicate what level of cache coherency the application can tolerate. > The new o

[coreutils PATCH v2 2/2] ls: use statx instead of stat when available

2019-09-13 Thread Jeff Layton
* add wrapper functions for stat/lstat/fstat calls, and add variants for when we are only interested in specific info * add statx-enabled functions and set the request mask based on the output format and what values are needed * for loop detection, use AT_STATX_DONT_SYNC since we're only

[coreutils PATCH v2 0/2] ls: convert to using statx when available

2019-09-13 Thread Jeff Layton
io=4555MiB (4776MB), run=60019-60019msec Jeff Layton (2): stat: move struct statx to struct stat conversion routines to new header ls: use statx instead of stat when available src/ls.c| 106 src/stat.c | 32 +--- s

[coreutils PATCH v2 1/2] stat: move struct statx to struct stat conversion routines to new header

2019-09-13 Thread Jeff Layton
* move statx_timestamp_to_timespec and statx_to_stat to a new header --- src/stat.c | 32 +-- src/statx.h | 54 + 2 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 src/statx.h diff --git

Re: [PATCH 2/3] ls: use statx for loop detection if it's available

2019-09-13 Thread Jeff Layton
On Thu, 2019-09-12 at 11:58 -0600, Andreas Dilger wrote: > > On Sep 11, 2019, at 7:51 AM, Jeff Layton wrote: > > > > * move loop detection routine into separate function > > * add a statx-enabled variant that is used when it's available. No need > > for a ful

Re: [PATCH 2/3] ls: use statx for loop detection if it's available

2019-09-13 Thread Jeff Layton
On Fri, 2019-09-13 at 17:31 +0100, Pádraig Brady wrote: > On 13/09/19 11:08, Jeff Layton wrote: > > On Thu, 2019-09-12 at 11:58 -0600, Andreas Dilger wrote: > > > Should this have a runtime fallback to stat() if statx() is not > > > implemented > > > on th

[coreutils PATCH v3 2/2] ls: use statx instead of stat when available

2019-09-17 Thread Jeff Layton
* add wrapper functions for stat/lstat/fstat calls, and add variants for when we are only interested in specific info * add statx-enabled functions and set the request mask based on the output format and what values are needed * for loop detection, use AT_STATX_DONT_SYNC since we're only

[coreutils PATCH v3 1/2] stat: move struct statx to struct stat conversion routines to new header

2019-09-17 Thread Jeff Layton
* move statx_timestamp_to_timespec and statx_to_stat to a new header --- src/stat.c | 32 +--- src/statx.h | 52 2 files changed, 53 insertions(+), 31 deletions(-) create mode 100644 src/statx.h diff --git

[coreutils PATCH v3 0/2] ls: convert to using statx when available

2019-09-17 Thread Jeff Layton
76MB), run=60019-60019msec Jeff Layton (2): stat: move struct statx to struct stat conversion routines to new header ls: use statx instead of stat when available src/ls.c| 106 src/stat.c | 32 +--- src/sta

[PATCH 0/3] ls: convert it to use statx() when available

2019-09-11 Thread Jeff Layton
76MB), run=60019-60019msec Jeff Layton (3): stat: move struct statx to struct stat conversion routines to new header ls: use statx for loop detection if it's available ls: add statx-enabled variants of stat and lstat calls src/ls.c| 179 ---

[PATCH 2/3] ls: use statx for loop detection if it's available

2019-09-11 Thread Jeff Layton
* move loop detection routine into separate function * add a statx-enabled variant that is used when it's available. No need for a full stat since all we care about is the dev/ino. * Since dev/ino should never change, set AT_STATX_DONT_SYNC unconditionally. --- src/ls.c | 106

[PATCH 3/3] ls: add statx-enabled variants of stat and lstat calls

2019-09-11 Thread Jeff Layton
* add wrapper functions for stat, lstat and stat_for_mode so that we can conditionally plug in statx-enabled variants * add statx-enabled functions and set the request mask based on the output format and what values are needed --- src/ls.c | 73

[PATCH 1/3] stat: move struct statx to struct stat conversion routines to new header

2019-09-11 Thread Jeff Layton
* move statx_timestamp_to_timespec and statx_to_stat to a new header --- src/stat.c | 32 +-- src/statx.h | 54 + 2 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 src/statx.h diff --git

[PATCH v4 1/2] stat: move struct statx to struct stat conversion routines to new header

2019-09-19 Thread Jeff Layton
* move statx_timestamp_to_timespec and statx_to_stat to a new header --- src/stat.c | 32 +--- src/statx.h | 52 2 files changed, 53 insertions(+), 31 deletions(-) create mode 100644 src/statx.h diff --git

[PATCH v4 2/2] ls: use statx instead of stat when available

2019-09-19 Thread Jeff Layton
* add wrapper functions for stat/lstat/fstat calls, and add variants for when we are only interested in specific info * add statx-enabled functions and set the request mask based on the output format and what values are needed * for loop detection, use AT_STATX_DONT_SYNC since we're only

[PATCH v4 0/2] ls: use statx() when it's available

2019-09-19 Thread Jeff Layton
WRITE: bw=75.9MiB/s (79.6MB/s), 75.9MiB/s-75.9MiB/s (79.6MB/s-79.6MB/s), io=4555MiB (4776MB), run=60019-60019msec Jeff Layton (2): stat: move struct statx to struct stat conversion routines to new header ls: use statx instead of stat when available src/ls.

Re: [PATCH v4 0/2] ls: use statx() when it's available

2019-10-01 Thread Jeff Layton
On Fri, 2019-09-20 at 00:53 +0100, Pádraig Brady wrote: > This looks good upon quick review. > I will try to merge over the next couple of days. > > thanks! > Pádraig Ping? Any idea when you'll get a chance to review and merge this? Thanks, -- Jeff Layton

Re: How to list not only content in a diretory but the directory itself as well?

2019-07-10 Thread Jeff Layton
be for the directory itself. Maybe I'm misunderstanding your question however. -- Jeff Layton

Re: [PATCH] stat: don't explicitly request file size for filenames

2019-07-10 Thread Jeff Layton
On Tue, 2019-07-09 at 21:43 +, Andreas Dilger wrote: > On Jul 5, 2019, at 04:18, Jeff Layton wrote: > > > > On Thu, 2019-07-04 at 21:18 +, Andreas Dilger wrote: > >> On Jul 4, 2019, at 04:43, Jeff Layton wrote: > >>> On Thu, 2019-07-04 at 06:37 -04

Re: [PATCH v4 0/2] ls: use statx() when it's available

2019-10-31 Thread Jeff Layton
On Thu, 2019-10-24 at 10:16 +0100, Pádraig Brady wrote: > On 09/10/2019 22:23, Pádraig Brady wrote: > > On 09/10/2019 11:14, Jeff Layton wrote: > > > On Wed, 2019-10-09 at 10:19 +0100, Pádraig Brady wrote: > > > > On 19/09/19 16:59, Jeff Layton wrote: > > &

Re: [PATCH v4 0/2] ls: use statx() when it's available

2019-10-09 Thread Jeff Layton
On Wed, 2019-10-09 at 10:19 +0100, Pádraig Brady wrote: > On 19/09/19 16:59, Jeff Layton wrote: > > v4: > > - set appropriate STATX_* bits for time_type, sort_type and > > print_block_size > > > > v3: > > - syntax cleanups. make syntax-check now

Re: [PATCH] stat: fallback if statx() is not available

2020-09-11 Thread Jeff Layton
On Thu, 2020-09-10 at 15:02 +0300, Heikkinen, Ville (Nokia - FI/Espoo) wrote: > On 9/9/20 10:35 PM, Jeff Layton wrote: > > On Tue, 2020-09-08 at 10:56 +0300, Ville Heikkinen wrote: > > > > Does this actually work around the seccomp bugs? What we found here was > > that

Re: [PATCH] stat: fallback if statx() is not available

2020-09-09 Thread Jeff Layton
; i < argc; i++) > ok &= (fs > ? do_statfs (argv[i], format) > - : do_stat (argv[i], format, format2)); > +#if USE_STATX > + : (use_stat > + ? do_stat (argv[i], format, format2) > + : do_statx (argv[i], format, format2)) > +#else > + : do_stat (argv[i], format, format2) > +#endif > + ); > >return ok ? EXIT_SUCCESS : EXIT_FAILURE; > } -- Jeff Layton