49e358eebea107aad9919dcc4bd88cee8519ba2eTimo Sirainen/* Note that some systems (Solaris) may use a macro to redefine struct stat */
89b548af722113acb5d63dfffb44423cb60f91e4Timo Sirainen/* When syscall fails with ESTALE error, how many times to try reopening the
89b548af722113acb5d63dfffb44423cb60f91e4Timo Sirainen file and retrying the operation. */
4f49b5cbfa6b9e6e4a213009ea6bb84337cb106aTimo Sirainen/* Same as open(), but try to handle ESTALE errors. */
89b548af722113acb5d63dfffb44423cb60f91e4Timo Sirainenint nfs_safe_open(const char *path, int flags);
4f49b5cbfa6b9e6e4a213009ea6bb84337cb106aTimo Sirainen/* Same as stat(), but try to handle ESTALE errors.
4f49b5cbfa6b9e6e4a213009ea6bb84337cb106aTimo Sirainen Doesn't flush attribute cache. */
6143fece58262865ce89b5012b73ef08f2ad6abcTimo Sirainenint nfs_safe_stat(const char *path, struct stat *buf);
c32823063d8050bd4c9b300e267f3eacf34d018dTimo Sirainenint nfs_safe_lstat(const char *path, struct stat *buf);
9716b2665ee3938d3dfe64bda44d7c3ae3b55d30Timo Sirainen/* Same as link(), but handle problems with link() by verifying the file's
9716b2665ee3938d3dfe64bda44d7c3ae3b55d30Timo Sirainen link count changes. If links1=TRUE, assume the original file's link count
9716b2665ee3938d3dfe64bda44d7c3ae3b55d30Timo Sirainen is 1, otherwise stat() first to find it out. */
9716b2665ee3938d3dfe64bda44d7c3ae3b55d30Timo Sirainenint nfs_safe_link(const char *oldpath, const char *newpath, bool links1);
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen/* Flush attribute cache for given path. The file must not be fcntl locked or
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen the locks may get dropped. */
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainenvoid nfs_flush_attr_cache_unlocked(const char *path);
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen/* Flush attribute cache for given path. The file may be fcntl locked. */
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainenvoid nfs_flush_attr_cache_maybe_locked(const char *path);
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen/* Flush attribute cache for a fcntl locked file descriptor. If locking flushes
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen the attribute cache with the running OS, this function does nothing.
4f49b5cbfa6b9e6e4a213009ea6bb84337cb106aTimo Sirainen The given path is used only for logging. */
e34d170f8f0e084bd94bfbc1a7085ece67e508dfTimo Sirainenvoid nfs_flush_attr_cache_fd_locked(const char *path, int fd);
04b8a90af181cc4c7959266855e8ed50a22ed413Timo Sirainen/* Flush file handle cache for given file. */
04b8a90af181cc4c7959266855e8ed50a22ed413Timo Sirainenvoid nfs_flush_file_handle_cache(const char *path);
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen/* Flush read cache for fd that was just fcntl locked. If the OS flushes
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen read cache when fcntl locking file, this function does nothing. */
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainenvoid nfs_flush_read_cache_locked(const char *path, int fd);
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen/* Flush read cache for fd that doesn't have fcntl locks. */
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainenvoid nfs_flush_read_cache_unlocked(const char *path, int fd);