nfs-workarounds.h revision 9716b2665ee3938d3dfe64bda44d7c3ae3b55d30
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen/* Note that some systems (Solaris) may use a macro to redefine struct stat */
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen/* When syscall fails with ESTALE error, how many times to try reopening the
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen file and retrying the operation. */
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen/* Same as open(), but try to handle ESTALE errors. */
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainenint nfs_safe_open(const char *path, int flags);
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen/* Same as stat(), but try to handle ESTALE errors.
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen Doesn't flush attribute cache. */
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainenint nfs_safe_stat(const char *path, struct stat *buf);
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainenint nfs_safe_lstat(const char *path, struct stat *buf);
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen/* Same as link(), but handle problems with link() by verifying the file's
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen link count changes. If links1=TRUE, assume the original file's link count
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen is 1, otherwise stat() first to find it out. */
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainenint nfs_safe_link(const char *oldpath, const char *newpath, bool links1);
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen/* Flush attribute cache for given path. If flush_dir is TRUE, also the
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen directory's cache is flushed. */
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainenvoid nfs_flush_attr_cache(const char *path, bool flush_dir);
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen/* Flush attribute cache for given file descriptor.
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen The given path is used only for logging. */
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainenbool nfs_flush_attr_cache_fd(const char *path, int fd);
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen/* Flush read cache for given fd. lock_type must be set to the file's current
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen fcntl locking state (F_UNLCK, F_RDLCK, F_WRLCK). Set just_locked=TRUE if the
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen file was locked at the same time as read cache flush was wanted (to avoid
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainen re-locking the file unneededly). */
51ead2f4c04ee85615d23c453924633b9ed8a4c2Timo Sirainenvoid nfs_flush_read_cache(const char *path, int fd,