PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
dentry.h File Reference
#include <kernel/fs/path.h>
#include <kernel/sync/mutex.h>
#include <kernel/sync/seqlock.h>
#include <kernel/utils/map.h>
#include <kernel/utils/ref.h>
#include <stdatomic.h>
#include <stdint.h>
#include <sys/io.h>
#include <sys/list.h>
Include dependency graph for dentry.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dentry_ops_t
 Dentry operations structure. More...
 
struct  dentry_t
 Directory entry structure. More...
 

Macros

#define DENTRY_IS_ROOT(dentry)   ((dentry)->parent == (dentry))
 Macro to check if a dentry is the root entry in its filesystem.
 

Typedefs

typedef struct dentry dentry_t
 
typedef struct dentry_ops dentry_ops_t
 
typedef struct inode inode_t
 
typedef struct superblock superblock_t
 
typedef uint64_t dentry_id_t
 Dentry ID type.
 

Enumerations

enum  dentry_flags_t { DENTRY_NEGATIVE = 1 << 0 }
 Dentry flags. More...
 

Functions

dentry_tdentry_new (superblock_t *superblock, dentry_t *parent, const char *name)
 Create a new dentry.
 
dentry_tdentry_get (const dentry_t *parent, const char *name)
 Get a dentry for the given name. Will NOT traverse mountpoints.
 
dentry_tdentry_lookup (const path_t *parent, const char *name)
 Lookup a dentry for the given name. Will NOT traverse mountpoints.
 
void dentry_make_positive (dentry_t *dentry, inode_t *inode)
 Make a dentry positive by associating it with an inode.
 
bool dentry_is_positive (dentry_t *dentry)
 Check if a dentry is positive.
 
bool dentry_is_file (dentry_t *dentry)
 Check if the inode associated with a dentry is a file.
 
bool dentry_is_dir (dentry_t *dentry)
 Check if the inode associated with a dentry is a directory.
 
uint64_t dentry_generic_getdents (dentry_t *dentry, dirent_t *buffer, uint64_t count, uint64_t *offset, mode_t mode)
 Helper function for a basic getdents.
 

Typedef Documentation

◆ dentry_t

typedef struct dentry dentry_t

Definition at line 14 of file dentry.h.

◆ dentry_ops_t

typedef struct dentry_ops dentry_ops_t

Definition at line 15 of file dentry.h.

◆ inode_t

typedef struct inode inode_t

Definition at line 16 of file dentry.h.

◆ superblock_t

typedef struct superblock superblock_t

Definition at line 17 of file dentry.h.