ext2_ino_t inode_num EXT2FS_ATTR((unused)),
struct ext2_inode_large *inode)
{
- struct ext2_ext_attr_entry *entry;
- __u32 *magic;
- char *start, *end;
- unsigned int storage_size;
-
fprintf(out, "Size of extra inode fields: %u\n", inode->i_extra_isize);
if (inode->i_extra_isize > EXT2_INODE_SIZE(current_fs->super) -
EXT2_GOOD_OLD_INODE_SIZE) {
void do_mknod(int argc, char *argv[])
{
- unsigned long mode, major, minor;
+ unsigned long major, minor;
errcode_t retval;
- int filetype, nr;
+ int nr;
struct stat st;
if (check_fs_open(argv[0]))
return;
}
- mode = minor = major = 0;
+ minor = major = 0;
switch (argv[2][0]) {
case 'p':
st.st_mode = S_IFIFO;
goto out;
for (i = 2; i < argc; i++) {
- size_t buflen;
- char *buf;
-
err = ext2fs_xattr_remove(h, argv[i]);
if (err)
goto out;
errcode_t errcode;
blk64_t block;
char *file = NULL;
- unsigned int i, j;
int c, err;
if (check_fs_open(argv[0]))
if (try_repairs && problem) {
report_problem:
if (fix_problem(ctx, problem, pctx)) {
-fix_problem_now:
if (ctx->invalid_bitmaps) {
/*
* If fsck knows the bitmaps are bad,
struct ext2_dir_entry *d;
void *top;
struct ext2_dir_entry_tail *t;
- unsigned int rec_len;
d = dirbuf;
top = EXT2_DIRENT_TAIL(dirbuf, fs->blocksize);
errcode_t retval;
struct expand_dir_struct es;
struct ext2_inode inode;
- blk64_t sz, before, after;
+ blk64_t sz;
if (!(fs->flags & EXT2_FLAG_RW))
return EXT2_ET_RO_FILSYS;
problem_t problem, save_problem;
int fixit, had_problem;
errcode_t retval;
- int old_desc_blocks = 0;
- int count = 0;
- int cmp_block = 0;
int redo_flag = 0;
- blk64_t super_blk, old_desc_blk, new_desc_blk;
char *actual_buf, *bitmap_buf;
actual_buf = (char *) e2fsck_allocate_memory(ctx, fs->blocksize,
{
struct ext2_ext_attr_header *header;
void *block_buf = NULL;
- dgrp_t grp;
- blk64_t blk, goal;
+ blk64_t blk;
errcode_t err;
struct ext2_inode_large i;
struct ext2_xattr *x;
struct ext2_ext_attr_entry *entry;
const char *prefix;
- void *ptr;
unsigned int remain, prefix_len;
errcode_t err;
unsigned int values_size = storage_size +
errcode_t ext2fs_xattrs_read(struct ext2_xattr_handle *handle)
{
- struct ext2_xattr *attrs = NULL, *x;
struct ext2_inode_large *inode;
struct ext2_ext_attr_header *header;
__u32 ea_inode_magic;
void *data)
{
struct ext2_xattr *x;
- errcode_t err;
int ret;
EXT2_CHECK_MAGIC(h, EXT2_ET_MAGIC_EA_HANDLE);
errcode_t ext2fs_xattr_inode_max_size(ext2_filsys fs, ext2_ino_t ino,
size_t *size)
{
- struct ext2_ext_attr_header *header;
struct ext2_ext_attr_entry *entry;
struct ext2_inode_large *inode;
__u32 ea_inode_magic;
- unsigned int storage_size, freesize, minoff;
+ unsigned int minoff;
void *start;
int i;
errcode_t err;
inode->i_extra_isize, sizeof(__u32));
if (ea_inode_magic == EXT2_EXT_ATTR_MAGIC) {
/* has xattrs. calculate the size */
- storage_size = EXT2_INODE_SIZE(fs->super) -
- EXT2_GOOD_OLD_INODE_SIZE - inode->i_extra_isize -
- sizeof(__u32);
start= ((char *) inode) + EXT2_GOOD_OLD_INODE_SIZE +
inode->i_extra_isize + sizeof(__u32);
entry = start;
const char *key)
{
struct ext2_xattr *x;
- errcode_t err;
EXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EA_HANDLE);
for (x = handle->attrs; x < handle->attrs + handle->length; x++) {
{
struct ext2_dir_entry *dir = NULL;
errcode_t retval;
- char *buf;
int rec_len;
- int filetype = 0;
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
char *cp;
ext2_ino_t parent_ino;
errcode_t retval;
- struct ext2_inode inode;
- struct stat st;
cp = strrchr(name, '/');
if (cp) {
struct stat *st, ext2_ino_t root)
{
char *cp;
- ext2_ino_t parent_ino, ino;
+ ext2_ino_t parent_ino;
errcode_t retval;
- struct ext2_inode inode;
cp = strrchr(name, '/');
perror("open");
exit(0);
}
- read(fd, &r, sizeof(r));
+ if (read(fd, &r, sizeof(r)) != sizeof(r))
+ printf("Unable to read random seed!\n");
close(fd);
return r;
}
static int get_journal_sb(ext2_filsys jfs, char buf[SUPERBLOCK_SIZE])
{
int retval;
- int start;
journal_superblock_t *jsb;
if (!(jfs->super->s_feature_incompat &
static errcode_t zero_empty_inodes(ext2_filsys fs)
{
int length = EXT2_INODE_SIZE(fs->super);
- struct ext2_inode *inode;
+ struct ext2_inode *inode = NULL;
ext2_inode_scan scan;
errcode_t retval;
ext2_ino_t ino;
dgrp_t i;
errcode_t retval;
blk64_t b, c, d;
- int has_super;
/* Load bitmaps to ensure that the uninit ones get written out */
fs->super->s_feature_ro_compat |= csum_feature_flag;