summaryrefslogtreecommitdiffstats
path: root/include/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/fs.h')
-rw-r--r--include/fs.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/include/fs.h b/include/fs.h
index 3d88bfad4a..e6fcd044dd 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -101,24 +101,14 @@ struct fs_device_d {
char *linux_rootarg;
};
-/*
- * Some filesystems i.e. tftpfs only support lseek into one direction.
- * To detect this limited functionality we add this extra function.
- * Additionaly we also return 0 if we even can not seek forward.
- */
-static inline int can_lseek_backward(int fd)
-{
- int ret;
+bool __is_tftp_fs(const char *path);
- ret = lseek(fd, 1, SEEK_SET);
- if (ret < 0)
- return 0;
-
- ret = lseek(fd, 0, SEEK_SET);
- if (ret < 0)
- return 0;
+static inline bool is_tftp_fs(const char *path)
+{
+ if (!IS_ENABLED(CONFIG_FS_TFTP))
+ return false;
- return 1;
+ return __is_tftp_fs(path);
}
#define drv_to_fs_driver(d) container_of(d, struct fs_driver_d, drv)