ext2_balloc.c (252103) | ext2_balloc.c (254283) |
---|---|
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_balloc.c 8.4 (Berkeley) 9/23/93 | 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_balloc.c 8.4 (Berkeley) 9/23/93 |
36 * $FreeBSD: head/sys/fs/ext2fs/ext2_balloc.c 252103 2013-06-23 02:44:42Z pfg $ | 36 * $FreeBSD: head/sys/fs/ext2fs/ext2_balloc.c 254283 2013-08-13 15:40:43Z pfg $ |
37 */ 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/bio.h> 42#include <sys/buf.h> 43#include <sys/lock.h> 44#include <sys/mount.h> --- 15 unchanged lines hidden (view full) --- 60ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size, struct ucred *cred, 61 struct buf **bpp, int flags) 62{ 63 struct m_ext2fs *fs; 64 struct ext2mount *ump; 65 struct buf *bp, *nbp; 66 struct vnode *vp = ITOV(ip); 67 struct indir indirs[NIADDR + 2]; | 37 */ 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/bio.h> 42#include <sys/buf.h> 43#include <sys/lock.h> 44#include <sys/mount.h> --- 15 unchanged lines hidden (view full) --- 60ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size, struct ucred *cred, 61 struct buf **bpp, int flags) 62{ 63 struct m_ext2fs *fs; 64 struct ext2mount *ump; 65 struct buf *bp, *nbp; 66 struct vnode *vp = ITOV(ip); 67 struct indir indirs[NIADDR + 2]; |
68 uint32_t nb, newb; 69 int32_t *bap, pref; | 68 e4fs_daddr_t nb, newb; 69 e2fs_daddr_t *bap, pref; |
70 int osize, nsize, num, i, error; 71 72 *bpp = NULL; 73 if (lbn < 0) 74 return (EFBIG); 75 fs = ip->i_e2fs; 76 ump = ip->i_ump; 77 --- 112 unchanged lines hidden (view full) --- 190 */ 191 for (i = 1;;) { 192 error = bread(vp, 193 indirs[i].in_lbn, (int)fs->e2fs_bsize, NOCRED, &bp); 194 if (error) { 195 brelse(bp); 196 return (error); 197 } | 70 int osize, nsize, num, i, error; 71 72 *bpp = NULL; 73 if (lbn < 0) 74 return (EFBIG); 75 fs = ip->i_e2fs; 76 ump = ip->i_ump; 77 --- 112 unchanged lines hidden (view full) --- 190 */ 191 for (i = 1;;) { 192 error = bread(vp, 193 indirs[i].in_lbn, (int)fs->e2fs_bsize, NOCRED, &bp); 194 if (error) { 195 brelse(bp); 196 return (error); 197 } |
198 bap = (int32_t *)bp->b_data; | 198 bap = (e2fs_daddr_t *)bp->b_data; |
199 nb = bap[indirs[i].in_off]; 200 if (i == num) 201 break; 202 i += 1; 203 if (nb != 0) { 204 bqrelse(bp); 205 continue; 206 } --- 90 unchanged lines hidden --- | 199 nb = bap[indirs[i].in_off]; 200 if (i == num) 201 break; 202 i += 1; 203 if (nb != 0) { 204 bqrelse(bp); 205 continue; 206 } --- 90 unchanged lines hidden --- |