nfs-workarounds.h revision e5ca66eb3527f7ec0b74f3ab4242ea89d5a89573
c0a708fa3f7b8f4fbca32052da5faf7a0125189dTimo Sirainen/* Note that some systems (Solaris) may use a macro to redefine struct stat */
c0a708fa3f7b8f4fbca32052da5faf7a0125189dTimo Sirainen/* When syscall fails with ESTALE error, how many times to try reopening the
cd94aeaa294f7cc507206b4b2075852f00e14d61Timo Sirainen file and retrying the operation. */
cd94aeaa294f7cc507206b4b2075852f00e14d61Timo Sirainen/* Same as open(), but try to handle ESTALE errors. */
cd94aeaa294f7cc507206b4b2075852f00e14d61Timo Sirainenint nfs_safe_open(const char *path, int flags);
cd94aeaa294f7cc507206b4b2075852f00e14d61Timo Sirainen/* Same as stat(), but try to handle ESTALE errors.
cd94aeaa294f7cc507206b4b2075852f00e14d61Timo Sirainen Doesn't flush attribute cache. */
cd94aeaa294f7cc507206b4b2075852f00e14d61Timo Sirainenint nfs_safe_stat(const char *path, struct stat *buf);
c0a708fa3f7b8f4fbca32052da5faf7a0125189dTimo Sirainenint nfs_safe_lstat(const char *path, struct stat *buf);
ad004e44be109684521494b5af2ad1da39b8bb27Timo Sirainen/* Same as link(), but handle UDP retries by stat()ing to see if the success
ad004e44be109684521494b5af2ad1da39b8bb27Timo Sirainen reply just got lost. Assumes that oldpath's link count is initially 1. */
64e244defe74f513ce94f33d000a048ddbe2ea23Timo Sirainenint nfs_safe_link(const char *oldpath, const char *newpath);
12cf3d0e03fc70fb0c8b91bc8fd83b4e14d7cdefTimo Sirainen/* Flush attribute cache for given path. If flush_dir is TRUE, also the
8222ce68120b51353a3b31d3073b5f845d0e9f53Timo Sirainen directory's cache is flushed. */
bf72c930996df0691932fb1143f360d260f27a06Timo Sirainenvoid nfs_flush_attr_cache(const char *path, bool flush_dir);
c0a708fa3f7b8f4fbca32052da5faf7a0125189dTimo Sirainen/* Flush attribute cache for given file descriptor.
cd94aeaa294f7cc507206b4b2075852f00e14d61Timo Sirainen The given path is used only for logging. */
c0a708fa3f7b8f4fbca32052da5faf7a0125189dTimo Sirainenbool nfs_flush_attr_cache_fd(const char *path, int fd);
c49a19168dab6fda80aee16ad799a8a56d3bc18fTimo Sirainen/* Flush read cache for given fd. lock_type must be set to the file's current
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen fcntl locking state (F_UNLCK, F_RDLCK, F_WRLCK). Set just_locked=TRUE if the
c49a19168dab6fda80aee16ad799a8a56d3bc18fTimo Sirainen file was locked at the same time as read cache flush was wanted (to avoid
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen re-locking the file unneededly). */
c0a708fa3f7b8f4fbca32052da5faf7a0125189dTimo Sirainenvoid nfs_flush_read_cache(const char *path, int fd,