37#define TMPFS_INODE(inode) container_of(inode, tmpfs_inode_t, real_inode)
38#define TMPFS_SB(var) container_of(var, tmpfs_sb_t, sb)
70 pr_dinfo2(tmpfs,
"tmpfs: creating a directory inode");
77 pr_dinfo2(tmpfs,
"tmpfs: creating a symlink inode");
84 pr_dinfo2(tmpfs,
"tmpfs: creating a file inode");
92 mos_warn(
"TODO: tmpfs: create inode for file type %d", type);
93 mos_panic(
"tmpfs: unsupported file type");
110 if (
strcmp(dev,
"none") != 0)
112 mos_warn(
"tmpfs: device not supported");
116 if (options &&
strlen(options) != 0 &&
strcmp(options,
"defaults") != 0)
118 mos_warn(
"tmpfs: options '%s' not supported", options);
123 tmpfs_sb->
sb.
fs = fs;
222 return bytes_to_copy;
#define MOS_ASSERT_X(cond, msg,...)
#define mos_warn(fmt,...)
void dentry_attach(dentry_t *d, inode_t *inode)
Attach an inode to a dentry.
void dentry_detach(dentry_t *d)
Detach the inode from a dentry.
MOSAPI char * strdup(const char *src)
MOSAPI s32 strcmp(const char *str1, const char *str2)
__BEGIN_DECLS phyframe_t * mm_get_free_page(void)
#define pmm_ref_one(thing)
void inode_init(inode_t *inode, superblock_t *sb, u64 ino, file_type_t type)
#define mos_panic(fmt,...)
static void * memcpy(void *s1, const void *s2, size_t n)
static size_t strlen(const char *s)
#define pr_dinfo2(feat, fmt,...)
#define SLAB_AUTOINIT(name, var, type)
const inode_cache_ops_t * ops
superblock_t * superblock
const file_ops_t * file_ops
const superblock_ops_t * ops
static const inode_cache_ops_t tmpfs_inode_cache_ops
static slab_t * tmpfs_superblock_cache
static bool tmpfs_i_mknod(inode_t *dir, dentry_t *dentry, file_type_t type, file_perm_t perm, dev_t dev)
static const inode_ops_t tmpfs_inode_symlink_ops
static bool tmpfs_i_symlink(inode_t *dir, dentry_t *dentry, const char *symname)
static bool tmpfs_i_hardlink(dentry_t *old_dentry, inode_t *dir, dentry_t *new_dentry)
static const file_perm_t tmpfs_default_mode
static dentry_t * tmpfs_fsop_mount(filesystem_t *fs, const char *dev, const char *options)
static bool tmpfs_sb_drop_inode(inode_t *inode)
static const superblock_ops_t tmpfs_sb_op
static bool tmpfs_mknod_impl(inode_t *dir, dentry_t *dentry, file_type_t type, file_perm_t perm, dev_t dev)
#define TMPFS_INODE(inode)
static bool tmpfs_i_create(inode_t *dir, dentry_t *dentry, file_type_t type, file_perm_t perm)
static const file_ops_t tmpfs_noop_file_ops
static const inode_ops_t tmpfs_inode_dir_ops
static const file_ops_t tmpfs_file_ops
static bool tmpfs_i_unlink(inode_t *dir, dentry_t *dentry)
inode_t * tmpfs_create_inode(tmpfs_sb_t *sb, file_type_t type, file_perm_t perm)
static bool tmpfs_i_rmdir(inode_t *dir, dentry_t *subdir_to_remove)
static phyframe_t * tmpfs_fill_cache(inode_cache_t *cache, off_t pgoff)
static slab_t * tmpfs_inode_cache
static size_t tmpfs_i_readlink(dentry_t *dentry, char *buffer, size_t buflen)
static bool tmpfs_i_rename(inode_t *old_dir, dentry_t *old_dentry, inode_t *new_dir, dentry_t *new_dentry)
static bool tmpfs_i_mkdir(inode_t *dir, dentry_t *dentry, file_perm_t perm)
#define FILESYSTEM_DEFINE(var, fsname, mountfn, unmountfn)
#define FILESYSTEM_AUTOREGISTER(fs)
bool simple_page_write_begin(inode_cache_t *icache, off_t offset, size_t size, phyframe_t **page, void **private)
ssize_t vfs_generic_write(const file_t *file, const void *buf, size_t size, off_t offset)
dentry_t * dentry_get_from_parent(superblock_t *sb, dentry_t *parent, const char *name)
Create a new dentry with the given name and parent.
void simple_page_write_end(inode_cache_t *icache, off_t offset, size_t size, phyframe_t *page, void *private)
ssize_t vfs_generic_read(const file_t *file, void *buf, size_t size, off_t offset)