Add IO_RANGELOCKED flag for vn_rdwr(9), which specifies that vnode is
not locked, but range is. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
This commit is contained in:
parent
79ec4cf466
commit
e3d6feceb1
@ -504,13 +504,16 @@ vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset,
|
||||
error = 0;
|
||||
|
||||
if ((ioflg & IO_NODELOCKED) == 0) {
|
||||
if (rw == UIO_READ) {
|
||||
rl_cookie = vn_rangelock_rlock(vp, offset,
|
||||
offset + len);
|
||||
} else {
|
||||
rl_cookie = vn_rangelock_wlock(vp, offset,
|
||||
offset + len);
|
||||
}
|
||||
if ((ioflg & IO_RANGELOCKED) == 0) {
|
||||
if (rw == UIO_READ) {
|
||||
rl_cookie = vn_rangelock_rlock(vp, offset,
|
||||
offset + len);
|
||||
} else {
|
||||
rl_cookie = vn_rangelock_wlock(vp, offset,
|
||||
offset + len);
|
||||
}
|
||||
} else
|
||||
rl_cookie = NULL;
|
||||
mp = NULL;
|
||||
if (rw == UIO_WRITE) {
|
||||
if (vp->v_type != VCHR &&
|
||||
|
@ -305,6 +305,7 @@ struct vattr {
|
||||
#define IO_NORMAL 0x0800 /* operate on regular data */
|
||||
#define IO_NOMACCHECK 0x1000 /* MAC checks unnecessary */
|
||||
#define IO_BUFLOCKED 0x2000 /* ffs flag; indir buf is locked */
|
||||
#define IO_RANGELOCKED 0x4000 /* range locked */
|
||||
|
||||
#define IO_SEQMAX 0x7F /* seq heuristic max value */
|
||||
#define IO_SEQSHIFT 16 /* seq heuristic in upper 16 bits */
|
||||
|
Loading…
Reference in New Issue
Block a user