ext2_inode.c (125781) | ext2_inode.c (125962) |
---|---|
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 --- 23 unchanged lines hidden (view full) --- 32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#)ffs_inode.c 8.5 (Berkeley) 12/30/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 --- 23 unchanged lines hidden (view full) --- 32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#)ffs_inode.c 8.5 (Berkeley) 12/30/93 |
40 * $FreeBSD: head/sys/gnu/fs/ext2fs/ext2_inode.c 125781 2004-02-13 17:49:03Z bde $ | 40 * $FreeBSD: head/sys/gnu/fs/ext2fs/ext2_inode.c 125962 2004-02-18 14:08:25Z tjr $ |
41 */ 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/mount.h> 46#include <sys/bio.h> 47#include <sys/buf.h> 48#include <sys/vnode.h> --- 110 unchanged lines hidden (view full) --- 159 osize = oip->i_size; 160 ext2_discard_prealloc(oip); 161 /* 162 * Lengthen the size of the file. We must ensure that the 163 * last byte of the file is allocated. Since the smallest 164 * value of oszie is 0, length will be at least 1. 165 */ 166 if (osize < length) { | 41 */ 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/mount.h> 46#include <sys/bio.h> 47#include <sys/buf.h> 48#include <sys/vnode.h> --- 110 unchanged lines hidden (view full) --- 159 osize = oip->i_size; 160 ext2_discard_prealloc(oip); 161 /* 162 * Lengthen the size of the file. We must ensure that the 163 * last byte of the file is allocated. Since the smallest 164 * value of oszie is 0, length will be at least 1. 165 */ 166 if (osize < length) { |
167 /* 168 * XXX Refuse to extend files past 2GB on old format 169 * filesystems or ones that don't already have the 170 * large file flag set in the superblock. 171 */ 172 if (osize < 0x8000000 && length >= 0x80000000 && 173 (oip->i_e2fs->s_es->s_rev_level == EXT2_GOOD_OLD_REV || 174 (oip->i_e2fs->s_es->s_feature_ro_compat & 175 EXT2_FEATURE_RO_COMPAT_LARGE_FILE) == 0)) 176 return (EFBIG); |
|
167 offset = blkoff(fs, length - 1); 168 lbn = lblkno(fs, length - 1); 169 aflags = B_CLRBUF; 170 if (flags & IO_SYNC) 171 aflags |= B_SYNC; 172 vnode_pager_setsize(ovp, length); 173 if ((error = ext2_balloc(oip, lbn, offset + 1, cred, &bp, 174 aflags)) != 0) --- 374 unchanged lines hidden --- | 177 offset = blkoff(fs, length - 1); 178 lbn = lblkno(fs, length - 1); 179 aflags = B_CLRBUF; 180 if (flags & IO_SYNC) 181 aflags |= B_SYNC; 182 vnode_pager_setsize(ovp, length); 183 if ((error = ext2_balloc(oip, lbn, offset + 1, cred, &bp, 184 aflags)) != 0) --- 374 unchanged lines hidden --- |