Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107567107
D31998.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D31998.diff
View Options
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c
--- a/sys/fs/cd9660/cd9660_vnops.c
+++ b/sys/fs/cd9660/cd9660_vnops.c
@@ -858,12 +858,13 @@
}
static int
-cd9660_gbp_getblksz(struct vnode *vp, daddr_t lbn)
+cd9660_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz)
{
struct iso_node *ip;
ip = VTOI(vp);
- return (blksize(ip->i_mnt, ip, lbn));
+ *sz = blksize(ip->i_mnt, ip, lbn);
+ return (0);
}
static int
diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c
--- a/sys/fs/fuse/fuse_vnops.c
+++ b/sys/fs/fuse/fuse_vnops.c
@@ -2199,7 +2199,7 @@
}
static int
-fuse_gbp_getblksz(struct vnode *vp, daddr_t lbn)
+fuse_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz)
{
off_t filesize;
int blksz, err;
@@ -2217,7 +2217,8 @@
} else {
blksz = biosize;
}
- return (blksz);
+ *sz = blksz;
+ return (0);
}
/*
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -1861,10 +1861,11 @@
}
static int
-msdosfs_gbp_getblksz(struct vnode *vp, daddr_t lbn)
+msdosfs_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz)
{
- return (VTODE(vp)->de_pmp->pm_bpcluster);
+ *sz = VTODE(vp)->de_pmp->pm_bpcluster;
+ return (0);
}
static int
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -94,7 +94,7 @@
}
static int
-ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn)
+ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz)
{
struct nfsnode *np;
u_quad_t nsize;
@@ -111,7 +111,8 @@
bcount = 0;
else if ((off_t)(lbn + 1) * biosize > nsize)
bcount = nsize - (off_t)lbn * biosize;
- return (bcount);
+ *sz = bcount;
+ return (0);
}
int
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -5203,8 +5203,8 @@
struct mount *mp;
daddr_t lbn, lbnp;
vm_ooffset_t la, lb, poff, poffe;
- long bsize;
- int bo_bs, br_flags, error, i, pgsin, pgsin_a, pgsin_b;
+ long bo_bs, bsize;
+ int br_flags, error, i, pgsin, pgsin_a, pgsin_b;
bool redo, lpart;
object = vp->v_object;
@@ -5221,7 +5221,10 @@
*/
la += PAGE_SIZE;
lpart = la > object->un_pager.vnp.vnp_size;
- bo_bs = get_blksize(vp, get_lblkno(vp, IDX_TO_OFF(ma[0]->pindex)));
+ error = get_blksize(vp, get_lblkno(vp, IDX_TO_OFF(ma[0]->pindex)),
+ &bo_bs);
+ if (error != 0)
+ return (VM_PAGER_ERROR);
/*
* Calculate read-ahead, behind and total pages.
@@ -5277,9 +5280,10 @@
goto next_page;
lbnp = lbn;
- bsize = get_blksize(vp, lbn);
- error = bread_gb(vp, lbn, bsize, curthread->td_ucred,
- br_flags, &bp);
+ error = get_blksize(vp, lbn, &bsize);
+ if (error == 0)
+ error = bread_gb(vp, lbn, bsize,
+ curthread->td_ucred, br_flags, &bp);
if (error != 0)
goto end_pages;
if (bp->b_rcred == curthread->td_ucred) {
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -610,7 +610,7 @@
void bdone(struct buf *);
typedef daddr_t (vbg_get_lblkno_t)(struct vnode *, vm_ooffset_t);
-typedef int (vbg_get_blksize_t)(struct vnode *, daddr_t);
+typedef int (vbg_get_blksize_t)(struct vnode *, daddr_t, long *);
int vfs_bio_getpages(struct vnode *vp, struct vm_page **ma, int count,
int *rbehind, int *rahead, vbg_get_lblkno_t get_lblkno,
vbg_get_blksize_t get_blksize);
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -1935,10 +1935,11 @@
}
static int
-ffs_gbp_getblksz(struct vnode *vp, daddr_t lbn)
+ffs_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz)
{
- return (blksize(VFSTOUFS(vp->v_mount)->um_fs, VTOI(vp), lbn));
+ *sz = blksize(VFSTOUFS(vp->v_mount)->um_fs, VTOI(vp), lbn);
+ return (0);
}
static int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 17, 12:00 AM (20 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15830860
Default Alt Text
D31998.diff (3 KB)
Attached To
Mode
D31998: buffer pager: allow get_blksize method to return error
Attached
Detach File
Event Timeline
Log In to Comment