vitasdk
Documentation of the vitasdk
vfs.h File Reference

Go to the source code of this file.

Data Structures

struct  SceVfsInfo
 VFS Info defining a VFS Implementation. More...
 
struct  SceVfsPath
 VFS Path for vnode. More...
 
struct  SceVfsMountData
 Mountpoint Data. More...
 
struct  SceVfsMount
 
struct  SceVfsVnode
 VFS Vnode. More...
 
struct  SceVfsFile
 VFS File. More...
 
struct  SceVfsOpMountArgs
 
struct  SceVfsOpUmountArgs
 
struct  SceVfsOpSetRootArgs
 
struct  SceVfsOpGetRootArgs
 
struct  SceVfsOpSyncArgs
 
struct  SceVfsOpInitArgs
 
struct  SceVfsOpFiniArgs
 
struct  SceVfsOpDevctlArg
 
struct  SceVfsOpDecodePathElemArgs
 
struct  SceVfsOpTable
 
struct  SceVopOpenArgs
 
struct  SceVopCreateArgs
 
struct  SceVopCloseArgs
 
struct  SceVopLookupArgs
 
struct  SceVopReadArgs
 
struct  SceVopWriteArgs
 
struct  SceVopLseekArgs
 
struct  SceVopIoctlArgs
 
struct  SceVopRemoveArgs
 
struct  SceVopMkdirArgs
 
struct  SceVopRmdirArgs
 
struct  SceVopDopenAgrs
 
struct  SceVopDcloseArgs
 
struct  SceVopDreadArgs
 
struct  SceVopGetstatArgs
 
struct  SceVopChstatArgs
 
struct  SceVopFchstatArgs
 
struct  SceVopFgetstatArgs
 
struct  SceVopInactiveArgs
 
struct  SceVopLinkArgs
 
struct  SceVopUnlinkArgs
 
struct  SceVopSyncArgs
 
struct  SceVopRenameArgs
 
struct  SceVopPreadArgs
 
struct  SceVopPwriteArgs
 
struct  SceVopWhiteoutArgs
 
struct  SceVopCleanupArgs
 
struct  SceVopZerofillArgs
 
struct  SceVopTable
 
struct  SceVfsMountParam
 Parameters for vfsMount and vfsMountForPFS. More...
 
struct  SceVfsUmountParam
 Parameters for vfsUmount and vfsUmountForPFS. More...
 
struct  SceVfsVnode.vdlock
 
struct  SceVfsVnode.core
 

Functions

VFS Operation Arguments and Callback Table
 VITASDK_BUILD_ASSERT_EQ (0x8, SceVfsOpMountArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceVfsOpUmountArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceVfsOpSetRootArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceVfsOpGetRootArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceVfsOpSyncArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x4, SceVfsOpInitArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x4, SceVfsOpFiniArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x1C, SceVfsOpDevctlArg)
 
 VITASDK_BUILD_ASSERT_EQ (0x1C, SceVfsOpDecodePathElemArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x34, SceVfsOpTable)
 
VFS Vnode Operation Arguments and Callback Table
 VITASDK_BUILD_ASSERT_EQ (0x10, SceVopOpenArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x14, SceVopCreateArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceVopCloseArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceVopLookupArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceVopReadArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceVopWriteArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceVopLseekArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x1C, SceVopIoctlArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceVopRemoveArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceVopMkdirArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceVopRmdirArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceVopDopenAgrs)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceVopDcloseArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceVopDreadArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceVopGetstatArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceVopChstatArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceVopFchstatArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceVopFgetstatArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x4, SceVopInactiveArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceVopLinkArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceVopUnlinkArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceVopSyncArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceVopRenameArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceVopPreadArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceVopPwriteArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceVopWhiteoutArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceVopCleanupArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x20, SceVopZerofillArgs)
 
 VITASDK_BUILD_ASSERT_EQ (0x74, SceVopTable)
 
VFS Vop APIs

These are relevant when doing operations on vnodes owned by other VFS implementations (block devices, etc.)

int ksceVopOpen (SceVfsVnode *vp, SceVfsPath *path, int flags, SceVfsFile *file)
 
int ksceVopCreate (SceVfsVnode *dvp, SceVfsVnode **vpp, SceVfsPath *path, int flags, int mode)
 
int ksceVopClose (SceVfsVnode *vp, SceVfsFile *file)
 
int ksceVopLookup (SceVfsVnode *dvp, SceVfsVnode **vpp, SceVfsPath *path, SceUInt32 flags)
 
int ksceVopRead (SceVfsVnode *vp, SceVfsFile *file, void *data, SceSize nbyte, SceSize *result)
 
int ksceVopWrite (SceVfsVnode *vp, SceVfsFile *file, const void *data, SceSize nbyte, SceSize *result)
 
SceOff ksceVopLseek (SceVfsVnode *vp, SceVfsFile *file, SceOff offset, int whence)
 
int ksceVopIoctl (SceVfsVnode *vp, SceVfsFile *file, int cmd, const void *in_data, SceSize in_len, void *out_data, SceSize out_len)
 
int ksceVopRemove (SceVfsVnode *dvp, SceVfsVnode *vp, SceVfsPath *path, SceUInt32 flags)
 
int ksceVopMkdir (SceVfsVnode *dvp, SceVfsVnode **vpp, SceVfsPath *path, int mode)
 
int ksceVopRmdir (SceVfsVnode *dvp, SceVfsVnode *vp, SceVfsPath *path)
 
int ksceVopDopen (SceVfsVnode *vp, SceVfsPath *path, SceVfsFile *file)
 
int ksceVopDclose (SceVfsVnode *vp, SceVfsFile *file)
 
int ksceVopDread (SceVfsVnode *vp, SceVfsFile *file, SceIoDirent *dir)
 
int ksceVopGetstat (SceVfsVnode *vp, SceVfsPath *path, SceIoStat *stat)
 
int ksceVopChstat (SceVfsVnode *vp, SceVfsPath *path, SceIoStat *stat, int bit)
 
int ksceVopRename (SceVfsVnode *odvp, SceVfsVnode *ovp, SceVfsPath *old_path, SceVfsVnode *ndvp, SceVfsVnode **nvpp, SceVfsPath *new_path)
 
int ksceVopPread (SceVfsVnode *vp, SceVfsFile *file, void *data, SceSize nbyte, SceOff offset, SceSize *pResult)
 
int ksceVopPwrite (SceVfsVnode *vp, SceVfsFile *file, const void *data, SceSize nbyte, SceOff offset, SceSize *result)
 
int ksceVopInactive (SceVfsVnode *vp)
 
int ksceVopSync (SceVfsVnode *vp, SceVfsFile *file, int flags)
 
int ksceVopFgetstat (SceVfsVnode *vp, SceVfsFile *file, SceIoStat *stat)
 
int ksceVopFchstat (SceVfsVnode *vp, SceVfsFile *file, SceIoStat *stat, int bit)
 
int ksceVopLink (SceVfsVnode *fvp, SceVfsVnode *tvp)
 
int ksceVopUnlink (SceVfsVnode *fvp, SceVfsVnode *tvp)
 
int ksceVopWhiteout (SceVfsVnode *dvp, SceVfsVnode *vp, SceVfsPath *old_path, SceVfsPath *new_path)
 
int ksceVopCleanup (SceVfsVnode *vp, SceVfsFile *file)
 
int ksceVopZerofill (SceVfsVnode *vp, SceUInt64 unk, SceUInt64 unk1, SceUInt64 unk2)
 

VFS Data Types

#define SCE_VFS_TYPE_FS   (0x00000000)
 
#define SCE_VFS_TYPE_DEVFS   (0x00000010)
 
#define SCE_VFS_FS_TYPE_FS   (0x01)
 All exfat mounts.
 
#define SCE_VFS_FS_TYPE_PFS   (0x03)
 PFS mounts.
 
#define SCE_VFS_FS_TYPE_HOSTFS   (0x04)
 host0:
 
#define SCE_VFS_FS_TYPE_BLKDEV   (0x10)
 sdstor0:, md0:
 
#define SCE_VFS_FS_TYPE_CHRDEV   (0x20)
 tty0:
 
#define SCE_VFS_MOUNT_TYPE_PFS   (0x00000001)
 PFS mounts.
 
#define SCE_VFS_MOUNT_TYPE_FSROOT   (0x00000002)
 Standard Root File System.
 
#define SCE_VFS_MOUNT_TYPE_DEVFS   (0x00000003)
 Device File System.
 
#define SCE_VFS_MOUNT_TYPE_STACKFS   (0x00000005)
 Loop File System (File system mounted from a file)
 
#define SCE_VFS_MOUNT_TYPE_HOSTFS   (0x00000006)
 Hostfs.
 
#define SCE_VFS_MOUNT_FLAG_TYPE_MASK   (0x000000FF)
 
#define SCE_VFS_MOUNT_FLAG_RDONLY   (0x00001000)
 Read-only mount.
 
#define SCE_VFS_MOUNT_FLAG_NOBUF   (0x00002000)
 Disables VFS Buffer Cache.
 
#define SCE_VFS_MOUNT_FLAG_NUMBERED   (0x00004000)
 Files for this mountpoint are treated as numbered extensions of the assignName.
 
#define SCE_VFS_MOUNT_FLAG_REMOTE   (0x00008000)
 Prevents ncache entry of failed lookups. Used on host0:
 
#define SCE_VFS_MOUNT_FLAG_INTERNAL   (0x00010000)
 
#define SCE_VFS_MOUNT_FLAG_EXTERNAL   (0x00020000)
 
#define SCE_VFS_MOUNT_FLAG_WRITE_CACHE   (0x00040000)
 Allow write-caching. Default behavior is to flush buffer cache after write.
 
#define SCE_VFS_MOUNT_FLAG_NO_RECLAIM   (0x00100000)
 Prevents Vnodes from being reclaimed. Only set internally for devfs.
 
#define SCE_VNODE_TYPE_REG   (0x00000001)
 Regular file.
 
#define SCE_VNODE_TYPE_DIR   (0x00000002)
 Regular directory.
 
#define SCE_VNODE_TYPE_CHR   (0x00000010)
 Character file.
 
#define SCE_VNODE_TYPE_ROOT   (0x00001000)
 Root vnode.
 
#define SCE_VNODE_TYPE_DEV   (0x00002000)
 Device vnode.
 
#define SCE_VNODE_TYPE_MOUNTED   (0x00004000)
 Vnode used as a backing for a mountpoint.
 
#define SCE_VNODE_TYPE_CHRDEV   (SCE_VNODE_TYPE_DEV | SCE_VNODE_TYPE_CHR)
 
#define SCE_VNODE_TYPE_ROOTDIR   (SCE_VNODE_TYPE_ROOT | SCE_VNODE_TYPE_DIR)
 Root directory.
 
#define SCE_VNODE_TYPE_ROOTDIR_DEVFS   (0x10000 | 0x20)
 Root directory on devfs mountpoints.
 
#define SCE_VNODE_STATE_ACTIVE   (0x00000001)
 Vnode is active and valid for all operations.
 
#define SCE_VNODE_STATE_INACTIVE   (0x00000100)
 Vnode is inactive and may be pending deletion or otherwise.
 
#define SCE_VNODE_STATE_UNMOUNTED   (0x00000200)
 
#define SCE_VNODE_STATE_DELETED   (0x00000400)
 
#define SCE_VNODE_STATE_RECLAIMED   (0x00002000)
 
#define SCE_VNODE_STATE_NEW   (0x00008000)
 
#define SCE_VFS_FILE_STATE_OPEN   (0x00000001)
 File is open.
 
#define SCE_VFS_FILE_STATE_CLOSED   (0x00000200)
 File is closed.
 
#define SCE_VFS_FILE_STATE_UNK   (0x00000800)
 Unknown status.
 
#define SCE_VFS_FILE_STATE_DUMMY   (0x00010000)
 Dummy file.
 
 VITASDK_BUILD_ASSERT_EQ (0x20, SceVfsInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceVfsPath)
 
 VITASDK_BUILD_ASSERT_EQ (0x14, SceVfsMountData)
 
 VITASDK_BUILD_ASSERT_EQ (0x100, SceVfsMount)
 
 VITASDK_BUILD_ASSERT_EQ (0x100, SceVfsVnode)
 
 VITASDK_BUILD_ASSERT_EQ (0x40, SceVfsFile)
 

VFS Core API

#define SCE_VFS_UMOUNT_FLAG_FORCE   (0x1)
 Force unmount.
 
 VITASDK_BUILD_ASSERT_EQ (0x20, SceVfsMountParam)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceVfsUmountParam)
 
int ksceVfsAddVfs (SceVfsInfo *vfs_info)
 Register a VFS implementation.
 
int ksceVfsDeleteVfs (const char *name, SceVfsInfo **vfs_info)
 Unegister a VFS implementation.
 
int vfsMount (SceVfsMountParam *param)
 Mount a drive.
 
int vfsUmount (SceVfsUmountParam *param)
 Unmount a drive.
 
int vfsMountForPFS (SceVfsMountParam *param)
 Mount a drive via the mount daemon.
 
int vfsUmountForPFS (SceVfsUmountParam *param, int unk, int unk2)
 Unmount a drive via the mount daemon.
 
int vfsLockMnt (SceVfsMount *mnt)
 Lock the mnt.
 
int vfsUnlockMnt (SceVfsMount *mnt)
 Unlock the mnt.
 
SceBool vfsIsLockedMnt (SceVfsMount *mnt)
 Is the mnt lock held by the current thread ?
 
SceUID vfsAllocateFile (SceVfsVnode *vp, SceVfsFile **file, const char *name)
 Allocate a new VFS file object.
 
int vfsFreeFile (SceVfsVnode *vp, SceUID fd)
 Free a File object.
 
int vfsGetNewVnode (SceVfsMount *mnt, SceVopTable *vops, int unk, SceVfsVnode **vpp)
 Get a new vnode from the pool.
 
int vfsFreeVnode (SceVfsVnode *vp)
 Return a vnode to the pool.
 
int vfsLockVnode (SceVfsVnode *vp)
 Lock a vnode.
 
int vfsUnlockVnode (SceVfsVnode *vp)
 Unlock a vnode.
 
SceBool vfsIsOwnerVnode (SceVfsVnode *vp)
 Does the current thread own the vnode lock.
 
int vfsGetVnodeName (SceVfsVnode *vp, char *name, SceSize n, SceSize *result)
 Get the name of a vnode.