Deleted Added
full compact
ext2_bmap.c (170174) ext2_bmap.c (202283)
1/*-
2 * Copyright (c) 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)ufs_bmap.c 8.7 (Berkeley) 3/21/95
1/*-
2 * Copyright (c) 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)ufs_bmap.c 8.7 (Berkeley) 3/21/95
35 * $FreeBSD: head/sys/gnu/fs/ext2fs/ext2_bmap.c 170174 2007-06-01 01:12:45Z jeff $
35 * $FreeBSD: head/sys/fs/ext2fs/ext2_bmap.c 202283 2010-01-14 14:30:54Z lulf $
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/bio.h>
41#include <sys/buf.h>
42#include <sys/proc.h>
43#include <sys/vnode.h>
44#include <sys/mount.h>
45#include <sys/resourcevar.h>
46#include <sys/stat.h>
47
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/bio.h>
41#include <sys/buf.h>
42#include <sys/proc.h>
43#include <sys/vnode.h>
44#include <sys/mount.h>
45#include <sys/resourcevar.h>
46#include <sys/stat.h>
47
48#include <gnu/fs/ext2fs/inode.h>
49#include <gnu/fs/ext2fs/ext2_fs.h>
50#include <gnu/fs/ext2fs/ext2_fs_sb.h>
51#include <gnu/fs/ext2fs/ext2_mount.h>
52#include <gnu/fs/ext2fs/ext2_extern.h>
48#include
49#include <fs/ext2fs/ext2fs.h>
50#include <fs/ext2fs/ext2_mount.h>
51#include <fs/ext2fs/ext2_extern.h>
53
54/*
52
53/*
55 * Bmap converts a the logical block number of a file to its physical block
54 * Bmap converts the logical block number of a file to its physical block
56 * number on the disk. The conversion is done by using the logical block
57 * number to index into the array of block pointers described by the dinode.
58 */
59int
60ext2_bmap(ap)
61 struct vop_bmap_args /* {
62 struct vnode *a_vp;
63 daddr_t a_bn;

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

88/*
89 * Indirect blocks are now on the vnode for the file. They are given negative
90 * logical block numbers. Indirect blocks are addressed by the negative
91 * address of the first data block to which they point. Double indirect blocks
92 * are addressed by one less than the address of the first indirect block to
93 * which they point. Triple indirect blocks are addressed by one less than
94 * the address of the first double indirect block to which they point.
95 *
55 * number on the disk. The conversion is done by using the logical block
56 * number to index into the array of block pointers described by the dinode.
57 */
58int
59ext2_bmap(ap)
60 struct vop_bmap_args /* {
61 struct vnode *a_vp;
62 daddr_t a_bn;

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

87/*
88 * Indirect blocks are now on the vnode for the file. They are given negative
89 * logical block numbers. Indirect blocks are addressed by the negative
90 * address of the first data block to which they point. Double indirect blocks
91 * are addressed by one less than the address of the first indirect block to
92 * which they point. Triple indirect blocks are addressed by one less than
93 * the address of the first double indirect block to which they point.
94 *
96 * ufs_bmaparray does the bmap conversion, and if requested returns the
95 * ext2_bmaparray does the bmap conversion, and if requested returns the
97 * array of logical blocks which must be traversed to get to a block.
98 * Each entry contains the offset into that block that gets you to the
99 * next block and the disk address of the block (if it is assigned).
100 */
101
102int
103ext2_bmaparray(vp, bn, bnp, runp, runb)
104 struct vnode *vp;

--- 231 unchanged lines hidden ---
96 * array of logical blocks which must be traversed to get to a block.
97 * Each entry contains the offset into that block that gets you to the
98 * next block and the disk address of the block (if it is assigned).
99 */
100
101int
102ext2_bmaparray(vp, bn, bnp, runp, runb)
103 struct vnode *vp;

--- 231 unchanged lines hidden ---