Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys buf_inorder:



details:   https://anonhg.NetBSD.org/src/rev/5f6002bc3231
branches:  trunk
changeset: 770802:5f6002bc3231
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Nov 02 13:52:34 2011 +0000

description:
buf_inorder:
- make the return value bool
- comments

diffstat:

 sys/sys/Makefile    |   6 +++---
 sys/sys/bufq_impl.h |  11 ++++++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diffs (56 lines):

diff -r 60dd60a5e881 -r 5f6002bc3231 sys/sys/Makefile
--- a/sys/sys/Makefile  Wed Nov 02 13:49:43 2011 +0000
+++ b/sys/sys/Makefile  Wed Nov 02 13:52:34 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.138 2011/09/28 14:26:27 jruoho Exp $
+#      $NetBSD: Makefile,v 1.139 2011/11/02 13:52:34 yamt Exp $
 
 .include <bsd.sys.mk>
 
@@ -27,8 +27,8 @@
        param.h pcu.h pipe.h pmc.h poll.h pool.h power.h proc.h \
        protosw.h pset.h ptrace.h ptree.h \
        queue.h quota.h \
-       ras.h rbtree.h reboot.h radioio.h resource.h resourcevar.h rmd160.h \
-       rnd.h rwlock.h sa.h satypes.h \
+       radixtree.h ras.h rbtree.h reboot.h radioio.h resource.h resourcevar.h \
+       rmd160.h rnd.h rwlock.h sa.h satypes.h \
        scanio.h sched.h scsiio.h sdt.h select.h selinfo.h sem.h sha1.h \
        sha2.h shm.h siginfo.h signal.h signalvar.h sigtypes.h simplelock.h \
        sleepq.h socket.h \
diff -r 60dd60a5e881 -r 5f6002bc3231 sys/sys/bufq_impl.h
--- a/sys/sys/bufq_impl.h       Wed Nov 02 13:49:43 2011 +0000
+++ b/sys/sys/bufq_impl.h       Wed Nov 02 13:52:34 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bufq_impl.h,v 1.8 2009/01/19 14:54:28 yamt Exp $       */
+/*     $NetBSD: bufq_impl.h,v 1.9 2011/11/02 13:52:34 yamt Exp $       */
 /*     NetBSD: bufq.h,v 1.3 2005/03/31 11:28:53 yamt Exp       */
 /*     NetBSD: buf.h,v 1.75 2004/09/18 16:40:11 yamt Exp       */
 
@@ -88,7 +88,7 @@
 };
 
 static __inline void *bufq_private(const struct bufq_state *) __unused;
-static __inline int buf_inorder(const struct buf *, const struct buf *, int)
+static __inline bool buf_inorder(const struct buf *, const struct buf *, int)
     __unused;
 
 #include <sys/null.h> /* for NULL */
@@ -102,11 +102,16 @@
 
 /*
  * Check if two buf's are in ascending order.
+ *
+ * this function consider a NULL buf is after any non-NULL buf.
+ *
+ * this function returns false if two are "same".
  */
-static __inline int
+static __inline bool
 buf_inorder(const struct buf *bp, const struct buf *bq, int sortby)
 {
 
+       KASSERT(bp != NULL || bq != NULL);
        if (bp == NULL || bq == NULL)
                return (bq == NULL);
 



Home | Main Index | Thread Index | Old Index