Deleted Added
full compact
cd9660_lookup.c (31016) cd9660_lookup.c (43301)
1/*-
2 * Copyright (c) 1989, 1993, 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).

--- 24 unchanged lines hidden (view full) ---

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 * from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91
39 *
40 * @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94
1/*-
2 * Copyright (c) 1989, 1993, 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).

--- 24 unchanged lines hidden (view full) ---

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 * from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91
39 *
40 * @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94
41 * $Id: cd9660_lookup.c,v 1.19 1997/10/16 10:47:33 phk Exp $
41 * $Id: cd9660_lookup.c,v 1.20 1997/11/07 08:52:50 phk Exp $
42 */
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/namei.h>
47#include <sys/buf.h>
48#include <sys/vnode.h>
49#include <sys/mount.h>

--- 126 unchanged lines hidden (view full) ---

176 /*
177 * If offset is on a block boundary,
178 * read the next directory block.
179 * Release previous if it exists.
180 */
181 if ((dp->i_offset & bmask) == 0) {
182 if (bp != NULL)
183 brelse(bp);
42 */
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/namei.h>
47#include <sys/buf.h>
48#include <sys/vnode.h>
49#include <sys/mount.h>

--- 126 unchanged lines hidden (view full) ---

176 /*
177 * If offset is on a block boundary,
178 * read the next directory block.
179 * Release previous if it exists.
180 */
181 if ((dp->i_offset & bmask) == 0) {
182 if (bp != NULL)
183 brelse(bp);
184 if (error =
185 cd9660_blkatoff(vdp, (off_t)dp->i_offset, NULL, &bp))
184 if ((error =
185 cd9660_blkatoff(vdp, (off_t)dp->i_offset, NULL, &bp)) != 0)
186 return (error);
187 entryoffsetinblock = 0;
188 }
189 /*
190 * Get pointer to next entry.
191 */
192 ep = (struct iso_directory_record *)
193 ((char *)bp->b_data + entryoffsetinblock);

--- 80 unchanged lines hidden (view full) ---

274 if (ino) {
275foundino:
276 dp->i_ino = ino;
277 if (saveoffset != dp->i_offset) {
278 if (lblkno(imp, dp->i_offset) !=
279 lblkno(imp, saveoffset)) {
280 if (bp != NULL)
281 brelse(bp);
186 return (error);
187 entryoffsetinblock = 0;
188 }
189 /*
190 * Get pointer to next entry.
191 */
192 ep = (struct iso_directory_record *)
193 ((char *)bp->b_data + entryoffsetinblock);

--- 80 unchanged lines hidden (view full) ---

274 if (ino) {
275foundino:
276 dp->i_ino = ino;
277 if (saveoffset != dp->i_offset) {
278 if (lblkno(imp, dp->i_offset) !=
279 lblkno(imp, saveoffset)) {
280 if (bp != NULL)
281 brelse(bp);
282 if (error = cd9660_blkatoff(vdp,
283 (off_t)saveoffset, NULL, &bp))
282 if ((error = cd9660_blkatoff(vdp,
283 (off_t)saveoffset, NULL, &bp)) != 0)
284 return (error);
285 }
286 entryoffsetinblock = saveoffset & bmask;
287 ep = (struct iso_directory_record *)
288 ((char *)bp->b_data + entryoffsetinblock);
289 dp->i_offset = saveoffset;
290 }
291 goto found;

--- 113 unchanged lines hidden (view full) ---

405 daddr_t lbn;
406 int bsize, error;
407
408 ip = VTOI(vp);
409 imp = ip->i_mnt;
410 lbn = lblkno(imp, offset);
411 bsize = blksize(imp, ip, lbn);
412
284 return (error);
285 }
286 entryoffsetinblock = saveoffset & bmask;
287 ep = (struct iso_directory_record *)
288 ((char *)bp->b_data + entryoffsetinblock);
289 dp->i_offset = saveoffset;
290 }
291 goto found;

--- 113 unchanged lines hidden (view full) ---

405 daddr_t lbn;
406 int bsize, error;
407
408 ip = VTOI(vp);
409 imp = ip->i_mnt;
410 lbn = lblkno(imp, offset);
411 bsize = blksize(imp, ip, lbn);
412
413 if (error = bread(vp, lbn, bsize, NOCRED, &bp)) {
413 if ((error = bread(vp, lbn, bsize, NOCRED, &bp)) != 0) {
414 brelse(bp);
415 *bpp = NULL;
416 return (error);
417 }
418 if (res)
419 *res = (char *)bp->b_data + blkoff(imp, offset);
420 *bpp = bp;
421 return (0);
422}
414 brelse(bp);
415 *bpp = NULL;
416 return (error);
417 }
418 if (res)
419 *res = (char *)bp->b_data + blkoff(imp, offset);
420 *bpp = bp;
421 return (0);
422}