PatchworkOS
Loading...
Searching...
No Matches
vfs_ctx.h File Reference
#include <kernel/config.h>
#include <kernel/fs/path.h>
#include <kernel/sync/lock.h>
#include <sys/bitmap.h>
#include <sys/io.h>

Go to the source code of this file.

Data Structures

struct  vfs_ctx_t
 VFS context structure. More...
 

Typedefs

typedef struct file file_t
 
typedef struct dir_entry dir_entry_t
 

Functions

void vfs_ctx_init (vfs_ctx_t *ctx, const path_t *cwd)
 Initialize a VFS context.
 
void vfs_ctx_deinit (vfs_ctx_t *ctx)
 Deinitialize a VFS context.
 
file_tvfs_ctx_get_file (vfs_ctx_t *ctx, fd_t fd)
 Get a file from a VFS context.
 
uint64_t vfs_ctx_get_cwd (vfs_ctx_t *ctx, path_t *outCwd)
 
uint64_t vfs_ctx_set_cwd (vfs_ctx_t *ctx, const path_t *cwd)
 Set the current working directory of a VFS context.
 
fd_t vfs_ctx_alloc_fd (vfs_ctx_t *ctx, file_t *file)
 Allocate a new file descriptor in a VFS context.
 
fd_t vfs_ctx_set_fd (vfs_ctx_t *ctx, fd_t fd, file_t *file)
 Allocate a specific file descriptor in a VFS context.
 
uint64_t vfs_ctx_free_fd (vfs_ctx_t *ctx, fd_t fd)
 Free a file descriptor in a VFS context.
 
fd_t vfs_ctx_dup (vfs_ctx_t *ctx, fd_t oldFd)
 Duplicate a file descriptor in a VFS context.
 
fd_t vfs_ctx_dup2 (vfs_ctx_t *ctx, fd_t oldFd, fd_t newFd)
 Duplicate a file descriptor in a VFS context to a specific file descriptor.
 

Typedef Documentation

◆ dir_entry_t

typedef struct dir_entry dir_entry_t

Definition at line 11 of file vfs_ctx.h.

◆ file_t

typedef struct file file_t

Definition at line 10 of file vfs_ctx.h.