Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Nov 2014 15:34:53 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r274505 - in projects/sendfile/sys: kern sys
Message-ID:  <201411141534.sAEFYrKO096472@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Fri Nov 14 15:34:52 2014
New Revision: 274505
URL: https://svnweb.freebsd.org/changeset/base/274505

Log:
  Remove sbmtrim().

Modified:
  projects/sendfile/sys/kern/uipc_sockbuf.c
  projects/sendfile/sys/kern/uipc_socket.c
  projects/sendfile/sys/sys/sockbuf.h

Modified: projects/sendfile/sys/kern/uipc_sockbuf.c
==============================================================================
--- projects/sendfile/sys/kern/uipc_sockbuf.c	Fri Nov 14 15:33:40 2014	(r274504)
+++ projects/sendfile/sys/kern/uipc_sockbuf.c	Fri Nov 14 15:34:52 2014	(r274505)
@@ -184,22 +184,6 @@ sbfree(struct sockbuf *sb, struct mbuf *
 }
 
 /*
- * Trim some amount of data from (first?) mbuf in buffer.
- */
-void
-sbmtrim(struct sockbuf *sb, struct mbuf *m, int len)
-{
-
-	SOCKBUF_LOCK_ASSERT(sb);
-	KASSERT(len < m->m_len, ("%s: m %p len %d", __func__, m, len));
-
-	m->m_data += len;
-	m->m_len -= len;
-	sb->sb_acc -= len;
-	sb->sb_ccc -= len;
-}
-
-/*
  * Socantsendmore indicates that no more data will be sent on the socket; it
  * would normally be applied to a socket when the user informs the system
  * that no more data is to be sent, by the protocol code (in case

Modified: projects/sendfile/sys/kern/uipc_socket.c
==============================================================================
--- projects/sendfile/sys/kern/uipc_socket.c	Fri Nov 14 15:33:40 2014	(r274504)
+++ projects/sendfile/sys/kern/uipc_socket.c	Fri Nov 14 15:34:52 2014	(r274505)
@@ -1810,7 +1810,7 @@ dontblock:
 						SOCKBUF_LOCK(&so->so_rcv);
 					}
 				}
-				sbmtrim(&so->so_rcv, m, len);
+				sbcut_locked(&so->so_rcv, len);
 			}
 		}
 		SOCKBUF_LOCK_ASSERT(&so->so_rcv);

Modified: projects/sendfile/sys/sys/sockbuf.h
==============================================================================
--- projects/sendfile/sys/sys/sockbuf.h	Fri Nov 14 15:33:40 2014	(r274504)
+++ projects/sendfile/sys/sys/sockbuf.h	Fri Nov 14 15:34:52 2014	(r274505)
@@ -174,7 +174,6 @@ int	sblock(struct sockbuf *sb, int flags
 void	sbunlock(struct sockbuf *sb);
 void	sballoc(struct sockbuf *, struct mbuf *);
 void	sbfree(struct sockbuf *, struct mbuf *);
-void	sbmtrim(struct sockbuf *, struct mbuf *, int);
 int	sbready(struct sockbuf *, struct mbuf *, int);
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411141534.sAEFYrKO096472>