PebbleOS v4.44.0-105-g1dd754433
Loading...
Searching...
No Matches
pbl_fs_ops Struct Reference

Operations of a file system format. More...

#include <fs_sys.h>

Data Fields

int(* open )(struct pbl_fs_file *file, const char *name, uint32_t flags)
 Open name with PBL_FS_O_* flags; set struct pbl_fs_file::filep and name.
 
ssize_t(* read )(struct pbl_fs_file *file, void *buf, size_t len)
 Read up to len bytes at the current position.
 
ssize_t(* write )(struct pbl_fs_file *file, const void *buf, size_t len)
 Write len bytes at the current position.
 
off_t(* lseek )(struct pbl_fs_file *file, off_t offset, int whence)
 Move the current position.
 
off_t(* tell )(struct pbl_fs_file *file)
 Get the current position.
 
off_t(* size )(struct pbl_fs_file *file)
 Get the size of the file.
 
int(* truncate )(struct pbl_fs_file *file, off_t length)
 Set the size of the file.
 
int(* sync )(struct pbl_fs_file *file)
 Flush cached data to the storage.
 
int(* close )(struct pbl_fs_file *file)
 Close the file.
 
int(* opendir )(struct pbl_fs_dir *dir, const char *name)
 Open directory name; set struct pbl_fs_dir::dirp.
 
int(* readdir )(struct pbl_fs_dir *dir, struct pbl_fs_dirent *entry)
 Read the next entry; an empty name marks the end.
 
int(* closedir )(struct pbl_fs_dir *dir)
 Close the directory.
 
int(* mount )(struct pbl_fs_mount *mp)
 Mount the file system.
 
int(* unmount )(struct pbl_fs_mount *mp)
 Unmount the file system.
 
int(* format )(struct pbl_fs_mount *mp)
 Erase the file system, invalidating every open file.
 
int(* unlink )(struct pbl_fs_mount *mp, const char *name)
 Remove a file.
 
int(* rename )(struct pbl_fs_mount *mp, const char *from, const char *to)
 Rename a file.
 
int(* mkdir )(struct pbl_fs_mount *mp, const char *name)
 Create a directory.
 
int(* stat )(struct pbl_fs_mount *mp, const char *name, struct pbl_fs_dirent *entry)
 Get the type and size of a file.
 
int(* statvfs )(struct pbl_fs_mount *mp, const char *name, struct pbl_fs_statvfs *stat)
 Get the space of the file system.
 

Detailed Description

Operations of a file system format.

Every operation returns 0 (or a count or offset) on success and a negative errno on failure. Operations a format does not support may be NULL; the core returns -ENOTSUP for them.

Field Documentation

◆ close

int(* pbl_fs_ops::close) (struct pbl_fs_file *file)

Close the file.

◆ closedir

int(* pbl_fs_ops::closedir) (struct pbl_fs_dir *dir)

Close the directory.

◆ format

int(* pbl_fs_ops::format) (struct pbl_fs_mount *mp)

Erase the file system, invalidating every open file.

◆ lseek

off_t(* pbl_fs_ops::lseek) (struct pbl_fs_file *file, off_t offset, int whence)

Move the current position.

◆ mkdir

int(* pbl_fs_ops::mkdir) (struct pbl_fs_mount *mp, const char *name)

Create a directory.

◆ mount

int(* pbl_fs_ops::mount) (struct pbl_fs_mount *mp)

Mount the file system.

◆ open

int(* pbl_fs_ops::open) (struct pbl_fs_file *file, const char *name, uint32_t flags)

Open name with PBL_FS_O_* flags; set struct pbl_fs_file::filep and name.

◆ opendir

int(* pbl_fs_ops::opendir) (struct pbl_fs_dir *dir, const char *name)

Open directory name; set struct pbl_fs_dir::dirp.

◆ read

ssize_t(* pbl_fs_ops::read) (struct pbl_fs_file *file, void *buf, size_t len)

Read up to len bytes at the current position.

◆ readdir

int(* pbl_fs_ops::readdir) (struct pbl_fs_dir *dir, struct pbl_fs_dirent *entry)

Read the next entry; an empty name marks the end.

◆ rename

int(* pbl_fs_ops::rename) (struct pbl_fs_mount *mp, const char *from, const char *to)

Rename a file.

◆ size

off_t(* pbl_fs_ops::size) (struct pbl_fs_file *file)

Get the size of the file.

◆ stat

int(* pbl_fs_ops::stat) (struct pbl_fs_mount *mp, const char *name, struct pbl_fs_dirent *entry)

Get the type and size of a file.

◆ statvfs

int(* pbl_fs_ops::statvfs) (struct pbl_fs_mount *mp, const char *name, struct pbl_fs_statvfs *stat)

Get the space of the file system.

◆ sync

int(* pbl_fs_ops::sync) (struct pbl_fs_file *file)

Flush cached data to the storage.

◆ tell

off_t(* pbl_fs_ops::tell) (struct pbl_fs_file *file)

Get the current position.

◆ truncate

int(* pbl_fs_ops::truncate) (struct pbl_fs_file *file, off_t length)

Set the size of the file.

◆ unlink

int(* pbl_fs_ops::unlink) (struct pbl_fs_mount *mp, const char *name)

Remove a file.

◆ unmount

int(* pbl_fs_ops::unmount) (struct pbl_fs_mount *mp)

Unmount the file system.

◆ write

ssize_t(* pbl_fs_ops::write) (struct pbl_fs_file *file, const void *buf, size_t len)

Write len bytes at the current position.


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