summaryrefslogtreecommitdiffstats
path: root/include/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/fs.h')
-rw-r--r--include/fs.h56
1 files changed, 6 insertions, 50 deletions
diff --git a/include/fs.h b/include/fs.h
index 943ba55439..6a592893a9 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -1,6 +1,12 @@
#ifndef __FS_H
#define __FS_H
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <dirent.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
#include <driver.h>
#include <filetype.h>
#include <linux/fs.h>
@@ -11,18 +17,6 @@ struct partition;
struct node_d;
struct stat;
-struct dirent {
- char d_name[256];
-};
-
-typedef struct dir {
- struct device_d *dev;
- struct fs_driver_d *fsdrv;
- struct node_d *node;
- struct dirent d;
- void *priv; /* private data for the fs driver */
-} DIR;
-
typedef struct filep {
struct fs_device_d *fsdev; /* The device this FILE belongs to */
char *path;
@@ -107,43 +101,7 @@ struct fs_device_d {
#define drv_to_fs_driver(d) container_of(d, struct fs_driver_d, drv)
-/*
- * standard posix file functions
- */
-int open(const char *pathname, int flags, ...);
-int creat(const char *pathname, mode_t mode);
-int unlink(const char *pathname);
-int close(int fd);
int flush(int fd);
-int lstat(const char *filename, struct stat *s);
-int stat(const char *filename, struct stat *s);
-int fstat(int fd, struct stat *s);
-ssize_t read(int fd, void *buf, size_t count);
-ssize_t pread(int fd, void *buf, size_t count, loff_t offset);
-int ioctl(int fd, int request, void *buf);
-ssize_t write(int fd, const void *buf, size_t count);
-ssize_t pwrite(int fd, const void *buf, size_t count, loff_t offset);
-
-loff_t lseek(int fildes, loff_t offset, int whence);
-int mkdir (const char *pathname, mode_t mode);
-
-/* Create a directory and its parents */
-int make_directory(const char *pathname);
-int rmdir (const char *pathname);
-
-const char *getcwd(void);
-int chdir(const char *pathname);
-
-DIR *opendir(const char *pathname);
-struct dirent *readdir(DIR *dir);
-int closedir(DIR *dir);
-
-int symlink(const char *pathname, const char *newpath);
-int readlink(const char *path, char *buf, size_t bufsiz);
-
-int mount (const char *device, const char *fsname, const char *path,
- const char *fsoptions);
-int umount(const char *pathname);
int umount_by_cdev(struct cdev *cdev);
/* not-so-standard functions */
@@ -183,8 +141,6 @@ void automount_remove(const char *_path);
int automount_add(const char *path, const char *cmd);
void automount_print(void);
-int unlink_recursive(const char *path, char **failedpath);
-
int fsdev_open_cdev(struct fs_device_d *fsdev);
const char *cdev_get_mount_path(struct cdev *cdev);
const char *cdev_mount_default(struct cdev *cdev, const char *fsoptions);