Deleted Added
full compact
ext2_alloc.c (251809) ext2_alloc.c (252103)
1/*-
2 * modified for Lites 1.1
3 *
4 * Aug 1995, Godmar Back (gback@cs.utah.edu)
5 * University of Utah, Department of Computer Science
6 */
7/*-
8 * Copyright (c) 1982, 1986, 1989, 1993

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

28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)ffs_alloc.c 8.8 (Berkeley) 2/21/94
1/*-
2 * modified for Lites 1.1
3 *
4 * Aug 1995, Godmar Back (gback@cs.utah.edu)
5 * University of Utah, Department of Computer Science
6 */
7/*-
8 * Copyright (c) 1982, 1986, 1989, 1993

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

28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)ffs_alloc.c 8.8 (Berkeley) 2/21/94
36 * $FreeBSD: head/sys/fs/ext2fs/ext2_alloc.c 251809 2013-06-16 16:10:45Z pfg $
36 * $FreeBSD: head/sys/fs/ext2fs/ext2_alloc.c 252103 2013-06-23 02:44:42Z pfg $
37 */
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/conf.h>
42#include <sys/vnode.h>
43#include <sys/stat.h>
44#include <sys/mount.h>

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

160 struct m_ext2fs *fs;
161 struct inode *ip;
162 struct vnode *vp;
163 struct buf *sbp, *ebp;
164 uint32_t *bap, *sbap, *ebap = 0;
165 struct ext2mount *ump;
166 struct cluster_save *buflist;
167 struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp;
37 */
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/conf.h>
42#include <sys/vnode.h>
43#include <sys/stat.h>
44#include <sys/mount.h>

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

160 struct m_ext2fs *fs;
161 struct inode *ip;
162 struct vnode *vp;
163 struct buf *sbp, *ebp;
164 uint32_t *bap, *sbap, *ebap = 0;
165 struct ext2mount *ump;
166 struct cluster_save *buflist;
167 struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp;
168 int32_t start_lbn, end_lbn, soff, newblk, blkno;
168 e2fs_lbn_t start_lbn, end_lbn;
169 int32_t soff, newblk, blkno;
169 int i, len, start_lvl, end_lvl, pref, ssize;
170
171 if (doreallocblks == 0)
172 return (ENOSPC);
173
174 vp = ap->a_vp;
175 ip = VTOI(vp);
176 fs = ip->i_e2fs;

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

545 * a direct block or a pointer block at the first level of indirection
546 * (In other words, stuff that will go in i_db[] or i_ib[])
547 *
548 * blocknr != 0 means that we're allocating a block that is none
549 * of the above. Then, blocknr tells us the number of the block
550 * that will hold the pointer
551 */
552int32_t
170 int i, len, start_lvl, end_lvl, pref, ssize;
171
172 if (doreallocblks == 0)
173 return (ENOSPC);
174
175 vp = ap->a_vp;
176 ip = VTOI(vp);
177 fs = ip->i_e2fs;

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

546 * a direct block or a pointer block at the first level of indirection
547 * (In other words, stuff that will go in i_db[] or i_ib[])
548 *
549 * blocknr != 0 means that we're allocating a block that is none
550 * of the above. Then, blocknr tells us the number of the block
551 * that will hold the pointer
552 */
553int32_t
553ext2_blkpref(struct inode *ip, int32_t lbn, int indx, int32_t *bap,
554ext2_blkpref(struct inode *ip, e2fs_lbn_t lbn, int indx, int32_t *bap,
554 int32_t blocknr)
555{
556 int tmp;
557 mtx_assert(EXT2_MTX(ip->i_ump), MA_OWNED);
558
559 /* if the next block is actually what we thought it is,
560 then set the goal to what we thought it should be
561 */

--- 550 unchanged lines hidden ---
555 int32_t blocknr)
556{
557 int tmp;
558 mtx_assert(EXT2_MTX(ip->i_ump), MA_OWNED);
559
560 /* if the next block is actually what we thought it is,
561 then set the goal to what we thought it should be
562 */

--- 550 unchanged lines hidden ---