From 57eeb5374fc6468846683576c9c81859367bbf8a Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 29 Aug 2019 23:45:45 -0400 Subject: stat: New BFS_STAT_NOSYNC flag --- stat.c | 3 +++ stat.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/stat.c b/stat.c index a2e2c8d..1e2f019 100644 --- a/stat.c +++ b/stat.c @@ -300,6 +300,9 @@ int bfs_stat(int at_fd, const char *at_path, enum bfs_stat_flag flags, struct bf if (flags & BFS_STAT_NOFOLLOW) { at_flags |= AT_SYMLINK_NOFOLLOW; } + if (flags & BFS_STAT_NOSYNC) { + at_flags |= AT_STATX_DONT_SYNC; + } if (at_path) { return bfs_stat_explicit(at_fd, at_path, at_flags, flags, buf); diff --git a/stat.h b/stat.h index 4e4cbaf..369ac4a 100644 --- a/stat.h +++ b/stat.h @@ -69,6 +69,8 @@ enum bfs_stat_flag { BFS_STAT_NOFOLLOW = 1 << 0, /** Try to follow symlinks, but fall back to the link itself if broken. */ BFS_STAT_TRYFOLLOW = 1 << 1, + /** Try to use cached values without synchronizing remote filesystems. */ + BFS_STAT_NOSYNC = 1 << 2, }; #ifdef DEV_BSIZE -- cgit v1.2.3