Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_default.c
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
#define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN+1) + 4) | #define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN+1) + 4) | ||||
static int vop_stdis_text(struct vop_is_text_args *ap); | static int vop_stdis_text(struct vop_is_text_args *ap); | ||||
static int vop_stdset_text(struct vop_set_text_args *ap); | static int vop_stdset_text(struct vop_set_text_args *ap); | ||||
static int vop_stdunset_text(struct vop_unset_text_args *ap); | static int vop_stdunset_text(struct vop_unset_text_args *ap); | ||||
static int vop_stdget_writecount(struct vop_get_writecount_args *ap); | static int vop_stdget_writecount(struct vop_get_writecount_args *ap); | ||||
static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); | static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); | ||||
static int vop_stdfdatasync(struct vop_fdatasync_args *ap); | |||||
static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); | static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); | ||||
/* | /* | ||||
* This vnode table stores what we want to do if the filesystem doesn't | * This vnode table stores what we want to do if the filesystem doesn't | ||||
* implement a particular VOP. | * implement a particular VOP. | ||||
* | * | ||||
* If there is no specific entry here, we will return EOPNOTSUPP. | * If there is no specific entry here, we will return EOPNOTSUPP. | ||||
* | * | ||||
Show All 12 Lines | struct vop_vector default_vnodeops = { | ||||
.vop_advise = vop_stdadvise, | .vop_advise = vop_stdadvise, | ||||
.vop_advlock = vop_stdadvlock, | .vop_advlock = vop_stdadvlock, | ||||
.vop_advlockasync = vop_stdadvlockasync, | .vop_advlockasync = vop_stdadvlockasync, | ||||
.vop_advlockpurge = vop_stdadvlockpurge, | .vop_advlockpurge = vop_stdadvlockpurge, | ||||
.vop_allocate = vop_stdallocate, | .vop_allocate = vop_stdallocate, | ||||
.vop_bmap = vop_stdbmap, | .vop_bmap = vop_stdbmap, | ||||
.vop_close = VOP_NULL, | .vop_close = VOP_NULL, | ||||
.vop_fsync = VOP_NULL, | .vop_fsync = VOP_NULL, | ||||
.vop_fdatasync = vop_stdfdatasync, | |||||
.vop_getpages = vop_stdgetpages, | .vop_getpages = vop_stdgetpages, | ||||
.vop_getpages_async = vop_stdgetpages_async, | .vop_getpages_async = vop_stdgetpages_async, | ||||
.vop_getwritemount = vop_stdgetwritemount, | .vop_getwritemount = vop_stdgetwritemount, | ||||
.vop_inactive = VOP_NULL, | .vop_inactive = VOP_NULL, | ||||
.vop_ioctl = VOP_ENOTTY, | .vop_ioctl = VOP_ENOTTY, | ||||
.vop_kqfilter = vop_stdkqfilter, | .vop_kqfilter = vop_stdkqfilter, | ||||
.vop_islocked = vop_stdislocked, | .vop_islocked = vop_stdislocked, | ||||
.vop_lock1 = vop_stdlock, | .vop_lock1 = vop_stdlock, | ||||
▲ Show 20 Lines • Show All 513 Lines • ▼ Show 20 Lines | if (ap->a_runb != NULL) | ||||
*ap->a_runb = 0; | *ap->a_runb = 0; | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
vop_stdfsync(ap) | vop_stdfsync(ap) | ||||
struct vop_fsync_args /* { | struct vop_fsync_args /* { | ||||
struct vnode *a_vp; | struct vnode *a_vp; | ||||
struct ucred *a_cred; | |||||
int a_waitfor; | int a_waitfor; | ||||
struct thread *a_td; | struct thread *a_td; | ||||
} */ *ap; | } */ *ap; | ||||
{ | { | ||||
struct vnode *vp = ap->a_vp; | struct vnode *vp = ap->a_vp; | ||||
struct buf *bp; | struct buf *bp; | ||||
struct bufobj *bo; | struct bufobj *bo; | ||||
struct buf *nbp; | struct buf *nbp; | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | if (bo->bo_dirty.bv_cnt > 0) { | ||||
error = EAGAIN; | error = EAGAIN; | ||||
} | } | ||||
} | } | ||||
BO_UNLOCK(bo); | BO_UNLOCK(bo); | ||||
if (error == EAGAIN) | if (error == EAGAIN) | ||||
vn_printf(vp, "fsync: giving up on dirty "); | vn_printf(vp, "fsync: giving up on dirty "); | ||||
return (error); | return (error); | ||||
} | |||||
static int | |||||
vop_stdfdatasync(struct vop_fdatasync_args *ap) | |||||
{ | |||||
return (VOP_FSYNC(ap->a_vp, MNT_WAIT, ap->a_td)); | |||||
} | |||||
int | |||||
vop_stdfdatasync_buf(struct vop_fdatasync_args *ap) | |||||
{ | |||||
struct vop_fsync_args apf; | |||||
apf.a_vp = ap->a_vp; | |||||
apf.a_waitfor = MNT_WAIT; | |||||
apf.a_td = ap->a_td; | |||||
return (vop_stdfsync(&apf)); | |||||
} | } | ||||
/* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */ | /* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */ | ||||
int | int | ||||
vop_stdgetpages(ap) | vop_stdgetpages(ap) | ||||
struct vop_getpages_args /* { | struct vop_getpages_args /* { | ||||
struct vnode *a_vp; | struct vnode *a_vp; | ||||
vm_page_t *a_m; | vm_page_t *a_m; | ||||
▲ Show 20 Lines • Show All 569 Lines • Show Last 20 Lines |