svn commit: r251145 - in stable/9/sys: kern sys
Scott Long
scottl at FreeBSD.org
Thu May 30 17:17:23 UTC 2013
Author: scottl
Date: Thu May 30 17:17:22 2013
New Revision: 251145
URL: http://svnweb.freebsd.org/changeset/base/251145
Log:
MFC r248504:
Add a convenience macro bread_gb() to wrap a call to
breadn_flags(). Comparing with bread(), it adds an argument to pass
the flags to getblk().
The API implementation of bread() and friends is different in FreeBSD 9,
so this merge is a little more complicated than the original commit.
Submitted by: kib, FF
Obtained from: Netflix
Modified:
stable/9/sys/kern/vfs_bio.c
stable/9/sys/sys/buf.h
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/sys/ (props changed)
Modified: stable/9/sys/kern/vfs_bio.c
==============================================================================
--- stable/9/sys/kern/vfs_bio.c Thu May 30 16:51:48 2013 (r251144)
+++ stable/9/sys/kern/vfs_bio.c Thu May 30 17:17:22 2013 (r251145)
@@ -833,6 +833,18 @@ breada(struct vnode * vp, daddr_t * rabl
}
/*
+ * Operates like bread, but with getblk flags.
+ */
+int
+bread_gb(struct vnode * vp, daddr_t blkno, int cnt, struct ucred * cred,
+ int gbflags, struct buf **bpp)
+{
+
+ return (breadn_flags(vp, blkno, cnt, NULL, NULL, 0,
+ cred, gbflags, bpp));
+}
+
+/*
* Operates like bread, but also starts asynchronous I/O on
* read-ahead blocks.
*/
Modified: stable/9/sys/sys/buf.h
==============================================================================
--- stable/9/sys/sys/buf.h Thu May 30 16:51:48 2013 (r251144)
+++ stable/9/sys/sys/buf.h Thu May 30 17:17:22 2013 (r251145)
@@ -484,6 +484,8 @@ int buf_dirty_count_severe(void);
void bremfree(struct buf *);
void bremfreef(struct buf *); /* XXX Force bremfree, only for nfs. */
int bread(struct vnode *, daddr_t, int, struct ucred *, struct buf **);
+int bread_gb(struct vnode *, daddr_t, int, struct ucred *,
+ int gbflags, struct buf **);
void breada(struct vnode *, daddr_t *, int *, int, struct ucred *);
int breadn(struct vnode *, daddr_t, int, daddr_t *, int *, int,
struct ucred *, struct buf **);
More information about the svn-src-stable-9
mailing list