diff options
author | asomers <asomers@FreeBSD.org> | 2014-03-07 23:40:36 +0000 |
---|---|---|
committer | asomers <asomers@FreeBSD.org> | 2014-03-07 23:40:36 +0000 |
commit | e2a82966a6890da982bdb74f294aa7cc30d0097a (patch) | |
tree | 364f500c4254293a9141f3d106e549044a8c1547 /sys/sys/sockbuf.h | |
parent | 94889417b97b6a9e30e7d591f83784988e4b2888 (diff) | |
download | FreeBSD-src-e2a82966a6890da982bdb74f294aa7cc30d0097a.zip FreeBSD-src-e2a82966a6890da982bdb74f294aa7cc30d0097a.tar.gz |
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
Diffstat (limited to 'sys/sys/sockbuf.h')
-rw-r--r-- | sys/sys/sockbuf.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index 877b530..6994fd3 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) { \ |