CardSight 0.1.0
C API reference for the CardSight firmware and application
Loading...
Searching...
No Matches
vfs_fs Struct Reference

Operations a file system type provides to the VFS. More...

#include <vfs.h>

Data Fields

const char * name
uint32_t flags
int(* mount )(struct block_device *bdev, uint32_t flags, void **priv)
int(* umount )(void *priv)
int(* sync )(void *priv)
int(* format )(struct block_device *bdev, const char *label, uint32_t arg)
int(* open )(void *priv, const char *path, uint32_t flags, void **file)
int(* read )(void *file, void *buffer, size_t length)
int(* write )(void *file, const void *buffer, size_t length)
int64_t(* seek )(void *file, int64_t offset, int whence)
int(* truncate )(void *file, uint64_t size)
int(* flush )(void *file)
int(* close )(void *file)
int(* fstat )(void *file, struct vfs_stat *st)
int(* stat )(void *priv, const char *path, struct vfs_stat *st)
int(* mkdir )(void *priv, const char *path)
int(* unlink )(void *priv, const char *path)
int(* rmdir )(void *priv, const char *path)
int(* rename )(void *priv, const char *from, const char *to)
int(* opendir )(void *priv, const char *path, void **dir)
int(* readdir )(void *dir, struct vfs_dirent *entry)
int(* closedir )(void *dir)
int(* statfs )(void *priv, uint64_t *total, uint64_t *free_bytes)
int(* volume_info )(void *priv, struct vfs_volume_info *info)

Detailed Description

Operations a file system type provides to the VFS.

The mount hook receives a private pointer that every later hook gets back. Hooks that a type does not implement are NULL, and calls that need them fail with -ENOTSUP.

Field Documentation

◆ close

int(* vfs_fs::close) (void *file)

Close a file.

◆ closedir

int(* vfs_fs::closedir) (void *dir)

Close a directory.

◆ flags

uint32_t vfs_fs::flags

VFS_FS_* flags.

◆ flush

int(* vfs_fs::flush) (void *file)

Flush a file.

◆ format

int(* vfs_fs::format) (struct block_device *bdev, const char *label, uint32_t arg)

Format.

◆ fstat

int(* vfs_fs::fstat) (void *file, struct vfs_stat *st)

Stat an open file.

◆ mkdir

int(* vfs_fs::mkdir) (void *priv, const char *path)

Create a directory.

◆ mount

int(* vfs_fs::mount) (struct block_device *bdev, uint32_t flags, void **priv)

Mount a volume.

◆ name

const char* vfs_fs::name

Type name, as used on the mount command line.

◆ open

int(* vfs_fs::open) (void *priv, const char *path, uint32_t flags, void **file)

Open a file.

◆ opendir

int(* vfs_fs::opendir) (void *priv, const char *path, void **dir)

Open a directory.

◆ read

int(* vfs_fs::read) (void *file, void *buffer, size_t length)

Read a file.

◆ readdir

int(* vfs_fs::readdir) (void *dir, struct vfs_dirent *entry)

Read a directory entry.

◆ rename

int(* vfs_fs::rename) (void *priv, const char *from, const char *to)

Rename an entry.

◆ rmdir

int(* vfs_fs::rmdir) (void *priv, const char *path)

Remove a directory.

◆ seek

int64_t(* vfs_fs::seek) (void *file, int64_t offset, int whence)

Move a file position.

◆ stat

int(* vfs_fs::stat) (void *priv, const char *path, struct vfs_stat *st)

Stat a path.

◆ statfs

int(* vfs_fs::statfs) (void *priv, uint64_t *total, uint64_t *free_bytes)

Volume capacity.

◆ sync

int(* vfs_fs::sync) (void *priv)

Flush a mounted volume.

◆ truncate

int(* vfs_fs::truncate) (void *file, uint64_t size)

Resize a file.

◆ umount

int(* vfs_fs::umount) (void *priv)

Unmount a volume.

◆ unlink

int(* vfs_fs::unlink) (void *priv, const char *path)

Remove a file.

◆ volume_info

int(* vfs_fs::volume_info) (void *priv, struct vfs_volume_info *info)

Volume description.

◆ write

int(* vfs_fs::write) (void *file, const void *buffer, size_t length)

Write a file.


The documentation for this struct was generated from the following file: