1 /* Copyright © 2017-2018 Apple Inc. All rights reserved.
6 * Created by Or Haimovich on 20/3/18.
10 #define lf_hfs_vnops_h
12 #include "lf_hfs_cnode.h"
14 #include "lf_hfs_generic_buf.h"
15 #include <UserFS/UserVFS.h>
17 /* VNOP_READDIR flags: */
18 #define VNODE_READDIR_EXTENDED 0x0001 /* use extended directory entries */
19 #define VNODE_READDIR_REQSEEKOFF 0x0002 /* requires seek offset (cookies) */
20 #define VNODE_READDIR_SEEKOFF32 0x0004 /* seek offset values should fit in 32 bits */
21 #define VNODE_READDIR_NAMEMAX 0x0008 /* For extended readdir, try to limit names to NAME_MAX bytes */
24 * flags for VNOP_BLOCKMAP
26 #define VNODE_READ 0x01
27 #define VNODE_WRITE 0x02
28 #define VNODE_BLOCKMAP_NO_TRACK 0x04
30 void replace_desc(struct cnode
*cp
, struct cat_desc
*cdp
);
31 int hfs_vnop_readdir(vnode_t vp
, int *eofflag
, int *numdirent
, ReadDirBuff_s
* psReadDirBuffer
, uint64_t puCookie
, int flags
);
32 int hfs_vnop_readdirattr(vnode_t vp
, int *eofflag
, int *numdirent
, ReadDirBuff_s
* psReadDirBuffer
, uint64_t puCookie
);
33 int hfs_fsync(struct vnode
*vp
, int waitfor
, hfs_fsync_mode_t fsyncmode
);
34 int hfs_vnop_remove(struct vnode
* psParentDir
,struct vnode
*psFileToRemove
, struct componentname
* psCN
, int iFlags
);
35 int hfs_vnop_rmdir(struct vnode
*dvp
, struct vnode
*vp
, struct componentname
* psCN
);
36 int hfs_removedir(struct vnode
*dvp
, struct vnode
*vp
, struct componentname
*cnp
, int skip_reserve
, int only_unlink
);
37 int hfs_vnop_setattr(vnode_t vp
, const UVFSFileAttributes
*attr
);
38 int hfs_update(struct vnode
*vp
, int options
);
39 const struct cat_fork
* hfs_prepare_fork_for_update(filefork_t
*ff
, const struct cat_fork
*cf
, struct cat_fork
*cf_buf
, uint32_t block_size
);
40 int hfs_vnop_readlink(struct vnode
*vp
, void* data
, size_t dataSize
, size_t *actuallyRead
);
41 int hfs_vnop_create(vnode_t a_dvp
, vnode_t
*a_vpp
, struct componentname
*a_cnp
, UVFSFileAttributes
* a_vap
);
42 int hfs_vnop_mkdir(vnode_t a_dvp
, vnode_t
*a_vpp
, struct componentname
*a_cnp
, UVFSFileAttributes
* a_vap
);
43 int hfs_makenode(struct vnode
*dvp
, struct vnode
**vpp
, struct componentname
*cnp
, UVFSFileAttributes
*psGivenAttr
);
44 int hfs_vnop_symlink(struct vnode
*dvp
, struct vnode
**vpp
, struct componentname
*cnp
, char* symlink_content
, UVFSFileAttributes
*attrp
);
46 int hfs_removedir(struct vnode
*dvp
, struct vnode
*vp
, struct componentname
*cnp
, int skip_reserve
, int only_unlink
);
47 int hfs_removefile(struct vnode
*dvp
, struct vnode
*vp
, struct componentname
*cnp
, int flags
, int skip_reserve
, int allow_dirs
, int only_unlink
);
48 int hfs_vnop_renamex(struct vnode
*fdvp
,struct vnode
*fvp
, struct componentname
*fcnp
, struct vnode
*tdvp
, struct vnode
*tvp
, struct componentname
*tcnp
);
49 int hfs_vnop_link(vnode_t vp
, vnode_t tdvp
, struct componentname
*cnp
);
50 int hfs_removefile_callback(GenericLFBuf
*psBuff
, void *pvArgs
);
52 int hfs_vgetrsrc( struct vnode
*vp
, struct vnode
**rvpp
);
53 #endif /* lf_hfs_vnops_h */