~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to lib/ext2fs/fileio.c

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2014-10-27 09:44:27 UTC
  • mfrom: (8.4.29 sid)
  • Revision ID: package-import@ubuntu.com-20141027094427-g56dce6sg7pasdgm
Tags: 1.42.12-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - debian/rules:
      Block pkg-create-dbgsym from operating on this package.
      Build without dietlibc-dev, which is in universe 
      Use the autotools-dev dh addon to update config.guess/config.sub for new
      ports.
  - debian/control:
      Regenerate with ./debian/rules debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
462
462
        old_truncate = ((old_size + file->fs->blocksize - 1) >>
463
463
                      EXT2_BLOCK_SIZE_BITS(file->fs->super));
464
464
 
465
 
        /* If we're writing a large file, set the large_file flag */
466
 
        if (LINUX_S_ISREG(file->inode.i_mode) &&
467
 
            ext2fs_needs_large_file_feature(EXT2_I_SIZE(&file->inode)) &&
468
 
            (!EXT2_HAS_RO_COMPAT_FEATURE(file->fs->super,
469
 
                                         EXT2_FEATURE_RO_COMPAT_LARGE_FILE) ||
470
 
             file->fs->super->s_rev_level == EXT2_GOOD_OLD_REV)) {
471
 
                file->fs->super->s_feature_ro_compat |=
472
 
                                EXT2_FEATURE_RO_COMPAT_LARGE_FILE;
473
 
                ext2fs_update_dynamic_rev(file->fs);
474
 
                ext2fs_mark_super_dirty(file->fs);
475
 
        }
 
465
        retval = ext2fs_inode_size_set(file->fs, &file->inode, size);
 
466
        if (retval)
 
467
                return retval;
476
468
 
477
 
        file->inode.i_size = size & 0xffffffff;
478
 
        file->inode.i_size_high = (size >> 32);
479
469
        if (file->ino) {
480
470
                retval = ext2fs_write_inode(file->fs, file->ino, &file->inode);
481
471
                if (retval)