aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sockbuf.h
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2014-03-07 23:40:36 +0000
committerAlan Somers <asomers@FreeBSD.org>2014-03-07 23:40:36 +0000
commit74107e870ac39f1bfa6e1bdf086068839e9aea16 (patch)
tree364f500c4254293a9141f3d106e549044a8c1547 /sys/sys/sockbuf.h
parent6a2ae0eb1662c056052c7ce92c2fcb3a5395d0f9 (diff)
downloadsrc-74107e870ac39f1bfa6e1bdf086068839e9aea16.tar.gz
src-74107e870ac39f1bfa6e1bdf086068839e9aea16.zip
Partial revert of change 262914. I screwed up subversion syntax with
perforce syntax and committed some unrelated files. Only devd files should've been committed. Reported by: imp Pointy hat to: asomers MFC after: 3 weeks X-MFC-With: r262914
Notes
Notes: svn path=/head/; revision=262915
Diffstat (limited to 'sys/sys/sockbuf.h')
-rw-r--r--sys/sys/sockbuf.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h
index 877b5307ee2e..6994fd3fd60f 100644
--- a/sys/sys/sockbuf.h
+++ b/sys/sys/sockbuf.h
@@ -52,7 +52,6 @@
#define SB_NOCOALESCE 0x200 /* don't coalesce new data into existing mbufs */
#define SB_IN_TOE 0x400 /* socket buffer is in the middle of an operation */
#define SB_AUTOSIZE 0x800 /* automatically size socket buffer */
-#define SB_STOP 0x1000 /* backpressure indicator */
#define SBS_CANTSENDMORE 0x0010 /* can't send more data to peer */
#define SBS_CANTRCVMORE 0x0020 /* can't receive more data from peer */
@@ -169,19 +168,9 @@ void sbunlock(struct sockbuf *sb);
* still be negative (cc > hiwat or mbcnt > mbmax). Should detect
* overflow and return 0. Should use "lmin" but it doesn't exist now.
*/
-static __inline
-long
-sbspace(struct sockbuf *sb)
-{
- long bleft;
- long mleft;
-
- if (sb->sb_flags & SB_STOP)
- return(0);
- bleft = sb->sb_hiwat - sb->sb_cc;
- mleft = sb->sb_mbmax - sb->sb_mbcnt;
- return((bleft < mleft) ? bleft : mleft);
-}
+#define sbspace(sb) \
+ ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \
+ (int)((sb)->sb_mbmax - (sb)->sb_mbcnt)))
/* adjust counters in sb reflecting allocation of m */
#define sballoc(sb, m) { \