MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_advice

Function get_advice

freebsd/kern/vfs_vnops.c:846–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

844}
845
846static int
847get_advice(struct file *fp, struct uio *uio)
848{
849 struct mtx *mtxp;
850 int ret;
851
852 ret = POSIX_FADV_NORMAL;
853 if (fp->f_advice == NULL || fp->f_vnode->v_type != VREG)
854 return (ret);
855
856 mtxp = mtx_pool_find(mtxpool_sleep, fp);
857 mtx_lock(mtxp);
858 if (fp->f_advice != NULL &&
859 uio->uio_offset >= fp->f_advice->fa_start &&
860 uio->uio_offset + uio->uio_resid <= fp->f_advice->fa_end)
861 ret = fp->f_advice->fa_advice;
862 mtx_unlock(mtxp);
863 return (ret);
864}
865
866int
867vn_read_from_obj(struct vnode *vp, struct uio *uio)

Callers 2

vn_readFunction · 0.85
vn_writeFunction · 0.85

Calls 3

mtx_pool_findFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected