cd9660_vnops.c (108686) | cd9660_vnops.c (109623) |
---|---|
1/*- 2 * Copyright (c) 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley 6 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 7 * Support code is derived from software contributed to Berkeley 8 * by Atsushi Murai (amurai@spec.co.jp). --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95 | 1/*- 2 * Copyright (c) 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley 6 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 7 * Support code is derived from software contributed to Berkeley 8 * by Atsushi Murai (amurai@spec.co.jp). --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95 |
39 * $FreeBSD: head/sys/fs/cd9660/cd9660_vnops.c 108686 2003-01-04 22:10:36Z phk $ | 39 * $FreeBSD: head/sys/fs/cd9660/cd9660_vnops.c 109623 2003-01-21 08:56:16Z alfred $ |
40 */ 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/namei.h> 45#include <sys/kernel.h> 46#include <sys/stat.h> 47#include <sys/bio.h> --- 141 unchanged lines hidden (view full) --- 189 190 vap->va_size = (u_quad_t) ip->i_size; 191 if (ip->i_size == 0 && (vap->va_mode & S_IFMT) == S_IFLNK) { 192 struct vop_readlink_args rdlnk; 193 struct iovec aiov; 194 struct uio auio; 195 char *cp; 196 | 40 */ 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/namei.h> 45#include <sys/kernel.h> 46#include <sys/stat.h> 47#include <sys/bio.h> --- 141 unchanged lines hidden (view full) --- 189 190 vap->va_size = (u_quad_t) ip->i_size; 191 if (ip->i_size == 0 && (vap->va_mode & S_IFMT) == S_IFLNK) { 192 struct vop_readlink_args rdlnk; 193 struct iovec aiov; 194 struct uio auio; 195 char *cp; 196 |
197 MALLOC(cp, char *, MAXPATHLEN, M_TEMP, M_WAITOK); | 197 MALLOC(cp, char *, MAXPATHLEN, M_TEMP, 0); |
198 aiov.iov_base = cp; 199 aiov.iov_len = MAXPATHLEN; 200 auio.uio_iov = &aiov; 201 auio.uio_iovcnt = 1; 202 auio.uio_offset = 0; 203 auio.uio_rw = UIO_READ; 204 auio.uio_segflg = UIO_SYSSPACE; 205 auio.uio_td = ap->a_td; --- 240 unchanged lines hidden (view full) --- 446 u_short namelen; 447 int ncookies = 0; 448 u_long *cookies = NULL; 449 450 dp = VTOI(vdp); 451 imp = dp->i_mnt; 452 bmask = imp->im_bmask; 453 | 198 aiov.iov_base = cp; 199 aiov.iov_len = MAXPATHLEN; 200 auio.uio_iov = &aiov; 201 auio.uio_iovcnt = 1; 202 auio.uio_offset = 0; 203 auio.uio_rw = UIO_READ; 204 auio.uio_segflg = UIO_SYSSPACE; 205 auio.uio_td = ap->a_td; --- 240 unchanged lines hidden (view full) --- 446 u_short namelen; 447 int ncookies = 0; 448 u_long *cookies = NULL; 449 450 dp = VTOI(vdp); 451 imp = dp->i_mnt; 452 bmask = imp->im_bmask; 453 |
454 MALLOC(idp, struct isoreaddir *, sizeof(*idp), M_TEMP, M_WAITOK); | 454 MALLOC(idp, struct isoreaddir *, sizeof(*idp), M_TEMP, 0); |
455 idp->saveent.d_namlen = idp->assocent.d_namlen = 0; 456 /* 457 * XXX 458 * Is it worth trying to figure out the type? 459 */ 460 idp->saveent.d_type = idp->assocent.d_type = idp->current.d_type = 461 DT_UNKNOWN; 462 idp->uio = uio; 463 if (ap->a_ncookies == NULL) { 464 idp->cookies = NULL; 465 } else { 466 /* 467 * Guess the number of cookies needed. 468 */ 469 ncookies = uio->uio_resid / 16; 470 MALLOC(cookies, u_long *, ncookies * sizeof(u_int), M_TEMP, | 455 idp->saveent.d_namlen = idp->assocent.d_namlen = 0; 456 /* 457 * XXX 458 * Is it worth trying to figure out the type? 459 */ 460 idp->saveent.d_type = idp->assocent.d_type = idp->current.d_type = 461 DT_UNKNOWN; 462 idp->uio = uio; 463 if (ap->a_ncookies == NULL) { 464 idp->cookies = NULL; 465 } else { 466 /* 467 * Guess the number of cookies needed. 468 */ 469 ncookies = uio->uio_resid / 16; 470 MALLOC(cookies, u_long *, ncookies * sizeof(u_int), M_TEMP, |
471 M_WAITOK); | 471 0); |
472 idp->cookies = cookies; 473 idp->ncookies = ncookies; 474 } 475 idp->eofflag = 1; 476 idp->curroff = uio->uio_offset; 477 478 if ((entryoffsetinblock = idp->curroff & bmask) && 479 (error = cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp))) { --- 186 unchanged lines hidden (view full) --- 666 667 /* 668 * Now get a buffer 669 * Abuse a namei buffer for now. 670 */ 671 if (uio->uio_segflg == UIO_SYSSPACE) 672 symname = uio->uio_iov->iov_base; 673 else | 472 idp->cookies = cookies; 473 idp->ncookies = ncookies; 474 } 475 idp->eofflag = 1; 476 idp->curroff = uio->uio_offset; 477 478 if ((entryoffsetinblock = idp->curroff & bmask) && 479 (error = cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp))) { --- 186 unchanged lines hidden (view full) --- 666 667 /* 668 * Now get a buffer 669 * Abuse a namei buffer for now. 670 */ 671 if (uio->uio_segflg == UIO_SYSSPACE) 672 symname = uio->uio_iov->iov_base; 673 else |
674 symname = uma_zalloc(namei_zone, M_WAITOK); | 674 symname = uma_zalloc(namei_zone, 0); |
675 676 /* 677 * Ok, we just gathering a symbolic name in SL record. 678 */ 679 if (cd9660_rrip_getsymname(dirp, symname, &symlen, imp) == 0) { 680 if (uio->uio_segflg != UIO_SYSSPACE) 681 uma_zfree(namei_zone, symname); 682 brelse(bp); --- 155 unchanged lines hidden --- | 675 676 /* 677 * Ok, we just gathering a symbolic name in SL record. 678 */ 679 if (cd9660_rrip_getsymname(dirp, symname, &symlen, imp) == 0) { 680 if (uio->uio_segflg != UIO_SYSSPACE) 681 uma_zfree(namei_zone, symname); 682 brelse(bp); --- 155 unchanged lines hidden --- |