vfs: VOP_RESIZE

This commit is contained in:
Matheus
2023-07-09 20:33:22 -03:00
parent b1ac2fb0fe
commit 7a0bd0747e
5 changed files with 25 additions and 5 deletions
+2
View File
@@ -95,6 +95,7 @@ typedef struct vops_t {
int (*getdents)(vnode_t *node, dent_t *buffer, size_t count, uintmax_t offset, size_t *readcount);
int (*isatty)(vnode_t *node);
int (*ioctl)(vnode_t *node, unsigned long request, void *arg, int *result);
int (*resize)(vnode_t *node, size_t newsize, cred_t *cred);
} vops_t;
#define VFS_MOUNT(vfs, mp, b, d) (vfs)->ops->mount(vfs, mp, b, d)
@@ -124,6 +125,7 @@ typedef struct vops_t {
#define VOP_POLL(v, d, p) (v)->ops->poll(v, d, p)
#define VOP_ISATTY(v) ((v)->ops->isatty ? (v)->ops->isatty(v) : ENOTTY)
#define VOP_IOCTL(v, r, a, rp) ((v)->ops->ioctl ? (v)->ops->ioctl(v, r, a, rp) : ENOTTY)
#define VOP_RESIZE(v, s, c) (v)->ops->resize(v, s, c)
#define VOP_HOLD(v) __atomic_add_fetch(&(v)->refcount, 1, __ATOMIC_SEQ_CST)
#define VOP_RELEASE(v) {\
if (__atomic_sub_fetch(&(v)->refcount, 1, __ATOMIC_SEQ_CST) == 0) {\