version 1.20, 2012/07/22 00:53:18 |
version 1.20.2.3, 2013/06/23 06:18:27 |
Line 151 cd9660_lookup(void *v) |
|
Line 151 cd9660_lookup(void *v) |
|
* check the name cache to see if the directory/name pair |
* check the name cache to see if the directory/name pair |
* we are looking for is known already. |
* we are looking for is known already. |
*/ |
*/ |
if ((error = cache_lookup(vdp, vpp, cnp)) >= 0) |
if (cache_lookup(vdp, cnp->cn_nameptr, cnp->cn_namelen, |
return (error); |
cnp->cn_nameiop, cnp->cn_flags, NULL, vpp)) { |
|
return *vpp == NULLVP ? ENOENT : 0; |
|
} |
|
|
len = cnp->cn_namelen; |
len = cnp->cn_namelen; |
name = cnp->cn_nameptr; |
name = cnp->cn_nameptr; |
|
|
/* |
/* |
* Insert name into cache (as non-existent) if appropriate. |
* Insert name into cache (as non-existent) if appropriate. |
*/ |
*/ |
cache_enter(vdp, *vpp, cnp); |
cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags); |
return (nameiop == CREATE || nameiop == RENAME) ? EROFS : ENOENT; |
return (nameiop == CREATE || nameiop == RENAME) ? EROFS : ENOENT; |
|
|
found: |
found: |
|
|
/* |
/* |
* Insert name into cache if appropriate. |
* Insert name into cache if appropriate. |
*/ |
*/ |
cache_enter(vdp, *vpp, cnp); |
cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags); |
return 0; |
return 0; |
} |
} |
|
|
Line 420 cd9660_blkatoff(struct vnode *vp, off_t |
|
Line 422 cd9660_blkatoff(struct vnode *vp, off_t |
|
ip = VTOI(vp); |
ip = VTOI(vp); |
imp = ip->i_mnt; |
imp = ip->i_mnt; |
lbn = lblkno(imp, offset); |
lbn = lblkno(imp, offset); |
bsize = blksize(imp, ip, lbn); |
bsize = cd9660_blksize(imp, ip, lbn); |
|
|
if ((error = bread(vp, lbn, bsize, NOCRED, 0, &bp)) != 0) { |
if ((error = bread(vp, lbn, bsize, NOCRED, 0, &bp)) != 0) { |
brelse(bp, 0); |
|
*bpp = NULL; |
*bpp = NULL; |
return (error); |
return (error); |
} |
} |
if (res) |
if (res) |
*res = (char *)bp->b_data + blkoff(imp, offset); |
*res = (char *)bp->b_data + cd9660_blkoff(imp, offset); |
*bpp = bp; |
*bpp = bp; |
return (0); |
return (0); |
} |
} |