uipc_mbuf2.c (109619) | uipc_mbuf2.c (109623) |
---|---|
1/* $FreeBSD: head/sys/kern/uipc_mbuf2.c 109619 2003-01-21 06:14:38Z sam $ */ | 1/* $FreeBSD: head/sys/kern/uipc_mbuf2.c 109623 2003-01-21 08:56:16Z alfred $ */ |
2/* $KAME: uipc_mbuf2.c,v 1.31 2001/11/28 11:08:53 itojun Exp $ */ 3/* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */ 4 5/* 6 * Copyright (C) 1999 WIDE Project. 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without --- 156 unchanged lines hidden (view full) --- 166 167 /* 168 * when len <= n->m_len - off and off != 0, it is a special case. 169 * len bytes from <n, off> sits in single mbuf, but the caller does 170 * not like the starting position (off). 171 * chop the current mbuf into two pieces, set off to 0. 172 */ 173 if (len <= n->m_len - off) { | 2/* $KAME: uipc_mbuf2.c,v 1.31 2001/11/28 11:08:53 itojun Exp $ */ 3/* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */ 4 5/* 6 * Copyright (C) 1999 WIDE Project. 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without --- 156 unchanged lines hidden (view full) --- 166 167 /* 168 * when len <= n->m_len - off and off != 0, it is a special case. 169 * len bytes from <n, off> sits in single mbuf, but the caller does 170 * not like the starting position (off). 171 * chop the current mbuf into two pieces, set off to 0. 172 */ 173 if (len <= n->m_len - off) { |
174 o = m_dup1(n, off, n->m_len - off, M_DONTWAIT); | 174 o = m_dup1(n, off, n->m_len - off, M_NOWAIT); |
175 if (o == NULL) { 176 m_freem(m); 177 return NULL; /* ENOBUFS */ 178 } 179 n->m_len = off; 180 o->m_next = n->m_next; 181 n->m_next = o; 182 n = n->m_next; --- 42 unchanged lines hidden (view full) --- 225 off = 0; 226 goto ok; 227 } 228 229 /* 230 * now, we need to do the hard way. don't m_copy as there's no room 231 * on both end. 232 */ | 175 if (o == NULL) { 176 m_freem(m); 177 return NULL; /* ENOBUFS */ 178 } 179 n->m_len = off; 180 o->m_next = n->m_next; 181 n->m_next = o; 182 n = n->m_next; --- 42 unchanged lines hidden (view full) --- 225 off = 0; 226 goto ok; 227 } 228 229 /* 230 * now, we need to do the hard way. don't m_copy as there's no room 231 * on both end. 232 */ |
233 MGET(o, M_DONTWAIT, m->m_type); | 233 MGET(o, M_NOWAIT, m->m_type); |
234 if (o && len > MLEN) { | 234 if (o && len > MLEN) { |
235 MCLGET(o, M_DONTWAIT); | 235 MCLGET(o, M_NOWAIT); |
236 if ((o->m_flags & M_EXT) == 0) { 237 m_free(o); 238 o = NULL; 239 } 240 } 241 if (!o) { 242 m_freem(m); 243 return NULL; /* ENOBUFS */ --- 214 unchanged lines hidden --- | 236 if ((o->m_flags & M_EXT) == 0) { 237 m_free(o); 238 o = NULL; 239 } 240 } 241 if (!o) { 242 m_freem(m); 243 return NULL; /* ENOBUFS */ --- 214 unchanged lines hidden --- |