Skip to content

Commit

Permalink
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
Browse files Browse the repository at this point in the history
* 'linux-next' of git://git.infradead.org/ubifs-2.6:
  UBIFS: pre-allocate bulk-read buffer
  UBIFS: do not allocate too much
  UBIFS: do not print scary memory allocation warnings
  UBIFS: allow for gaps when dirtying the LPT
  UBIFS: fix compilation warnings
  MAINTAINERS: change UBI/UBIFS git tree URLs
  UBIFS: endian handling fixes and annotations
  UBIFS: remove printk
  • Loading branch information
Linus Torvalds committed Dec 2, 2008
2 parents b7d6266 + 3477d20 commit 51eaaa6
Show file tree
Hide file tree
Showing 15 changed files with 223 additions and 111 deletions.
4 changes: 2 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4236,7 +4236,7 @@ M: dedekind@infradead.org
P: Adrian Hunter
M: ext-adrian.hunter@nokia.com
L: linux-mtd@lists.infradead.org
T: git git://git.infradead.org/~dedekind/ubifs-2.6.git
T: git git://git.infradead.org/ubifs-2.6.git
W: http://www.linux-mtd.infradead.org/doc/ubifs.html
S: Maintained

Expand Down Expand Up @@ -4290,7 +4290,7 @@ P: Artem Bityutskiy
M: dedekind@infradead.org
W: http://www.linux-mtd.infradead.org/
L: linux-mtd@lists.infradead.org
T: git git://git.infradead.org/~dedekind/ubi-2.6.git
T: git git://git.infradead.org/ubi-2.6.git
S: Maintained

USB ACM DRIVER
Expand Down
4 changes: 2 additions & 2 deletions fs/ubifs/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ int ubifs_bg_thread(void *info)
int err;
struct ubifs_info *c = info;

ubifs_msg("background thread \"%s\" started, PID %d",
c->bgt_name, current->pid);
dbg_msg("background thread \"%s\" started, PID %d",
c->bgt_name, current->pid);
set_freezable();

while (1) {
Expand Down
66 changes: 39 additions & 27 deletions fs/ubifs/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,24 @@ static void sprintf_key(const struct ubifs_info *c, const union ubifs_key *key,
if (c->key_fmt == UBIFS_SIMPLE_KEY_FMT) {
switch (type) {
case UBIFS_INO_KEY:
sprintf(p, "(%lu, %s)", key_inum(c, key),
sprintf(p, "(%lu, %s)", (unsigned long)key_inum(c, key),
get_key_type(type));
break;
case UBIFS_DENT_KEY:
case UBIFS_XENT_KEY:
sprintf(p, "(%lu, %s, %#08x)", key_inum(c, key),
sprintf(p, "(%lu, %s, %#08x)",
(unsigned long)key_inum(c, key),
get_key_type(type), key_hash(c, key));
break;
case UBIFS_DATA_KEY:
sprintf(p, "(%lu, %s, %u)", key_inum(c, key),
sprintf(p, "(%lu, %s, %u)",
(unsigned long)key_inum(c, key),
get_key_type(type), key_block(c, key));
break;
case UBIFS_TRUN_KEY:
sprintf(p, "(%lu, %s)",
key_inum(c, key), get_key_type(type));
(unsigned long)key_inum(c, key),
get_key_type(type));
break;
default:
sprintf(p, "(bad key type: %#08x, %#08x)",
Expand Down Expand Up @@ -364,8 +367,8 @@ void dbg_dump_node(const struct ubifs_info *c, const void *node)
le32_to_cpu(mst->ihead_lnum));
printk(KERN_DEBUG "\tihead_offs %u\n",
le32_to_cpu(mst->ihead_offs));
printk(KERN_DEBUG "\tindex_size %u\n",
le32_to_cpu(mst->index_size));
printk(KERN_DEBUG "\tindex_size %llu\n",
(unsigned long long)le64_to_cpu(mst->index_size));
printk(KERN_DEBUG "\tlpt_lnum %u\n",
le32_to_cpu(mst->lpt_lnum));
printk(KERN_DEBUG "\tlpt_offs %u\n",
Expand Down Expand Up @@ -1589,7 +1592,7 @@ static struct fsck_inode *add_inode(struct ubifs_info *c,

if (inum > c->highest_inum) {
ubifs_err("too high inode number, max. is %lu",
c->highest_inum);
(unsigned long)c->highest_inum);
return ERR_PTR(-EINVAL);
}

Expand Down Expand Up @@ -1668,16 +1671,18 @@ static struct fsck_inode *read_add_inode(struct ubifs_info *c,
ino_key_init(c, &key, inum);
err = ubifs_lookup_level0(c, &key, &znode, &n);
if (!err) {
ubifs_err("inode %lu not found in index", inum);
ubifs_err("inode %lu not found in index", (unsigned long)inum);
return ERR_PTR(-ENOENT);
} else if (err < 0) {
ubifs_err("error %d while looking up inode %lu", err, inum);
ubifs_err("error %d while looking up inode %lu",
err, (unsigned long)inum);
return ERR_PTR(err);
}

zbr = &znode->zbranch[n];
if (zbr->len < UBIFS_INO_NODE_SZ) {
ubifs_err("bad node %lu node length %d", inum, zbr->len);
ubifs_err("bad node %lu node length %d",
(unsigned long)inum, zbr->len);
return ERR_PTR(-EINVAL);
}

Expand All @@ -1697,7 +1702,7 @@ static struct fsck_inode *read_add_inode(struct ubifs_info *c,
kfree(ino);
if (IS_ERR(fscki)) {
ubifs_err("error %ld while adding inode %lu node",
PTR_ERR(fscki), inum);
PTR_ERR(fscki), (unsigned long)inum);
return fscki;
}

Expand Down Expand Up @@ -1786,7 +1791,8 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
if (IS_ERR(fscki)) {
err = PTR_ERR(fscki);
ubifs_err("error %d while processing data node and "
"trying to find inode node %lu", err, inum);
"trying to find inode node %lu",
err, (unsigned long)inum);
goto out_dump;
}

Expand Down Expand Up @@ -1819,7 +1825,8 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
if (IS_ERR(fscki)) {
err = PTR_ERR(fscki);
ubifs_err("error %d while processing entry node and "
"trying to find inode node %lu", err, inum);
"trying to find inode node %lu",
err, (unsigned long)inum);
goto out_dump;
}

Expand All @@ -1832,7 +1839,7 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
err = PTR_ERR(fscki);
ubifs_err("error %d while processing entry node and "
"trying to find parent inode node %lu",
err, inum);
err, (unsigned long)inum);
goto out_dump;
}

Expand Down Expand Up @@ -1923,56 +1930,60 @@ static int check_inodes(struct ubifs_info *c, struct fsck_data *fsckd)
fscki->references != 1) {
ubifs_err("directory inode %lu has %d "
"direntries which refer it, but "
"should be 1", fscki->inum,
"should be 1",
(unsigned long)fscki->inum,
fscki->references);
goto out_dump;
}
if (fscki->inum == UBIFS_ROOT_INO &&
fscki->references != 0) {
ubifs_err("root inode %lu has non-zero (%d) "
"direntries which refer it",
fscki->inum, fscki->references);
(unsigned long)fscki->inum,
fscki->references);
goto out_dump;
}
if (fscki->calc_sz != fscki->size) {
ubifs_err("directory inode %lu size is %lld, "
"but calculated size is %lld",
fscki->inum, fscki->size,
fscki->calc_sz);
(unsigned long)fscki->inum,
fscki->size, fscki->calc_sz);
goto out_dump;
}
if (fscki->calc_cnt != fscki->nlink) {
ubifs_err("directory inode %lu nlink is %d, "
"but calculated nlink is %d",
fscki->inum, fscki->nlink,
fscki->calc_cnt);
(unsigned long)fscki->inum,
fscki->nlink, fscki->calc_cnt);
goto out_dump;
}
} else {
if (fscki->references != fscki->nlink) {
ubifs_err("inode %lu nlink is %d, but "
"calculated nlink is %d", fscki->inum,
"calculated nlink is %d",
(unsigned long)fscki->inum,
fscki->nlink, fscki->references);
goto out_dump;
}
}
if (fscki->xattr_sz != fscki->calc_xsz) {
ubifs_err("inode %lu has xattr size %u, but "
"calculated size is %lld",
fscki->inum, fscki->xattr_sz,
(unsigned long)fscki->inum, fscki->xattr_sz,
fscki->calc_xsz);
goto out_dump;
}
if (fscki->xattr_cnt != fscki->calc_xcnt) {
ubifs_err("inode %lu has %u xattrs, but "
"calculated count is %lld", fscki->inum,
"calculated count is %lld",
(unsigned long)fscki->inum,
fscki->xattr_cnt, fscki->calc_xcnt);
goto out_dump;
}
if (fscki->xattr_nms != fscki->calc_xnms) {
ubifs_err("inode %lu has xattr names' size %u, but "
"calculated names' size is %lld",
fscki->inum, fscki->xattr_nms,
(unsigned long)fscki->inum, fscki->xattr_nms,
fscki->calc_xnms);
goto out_dump;
}
Expand All @@ -1985,11 +1996,12 @@ static int check_inodes(struct ubifs_info *c, struct fsck_data *fsckd)
ino_key_init(c, &key, fscki->inum);
err = ubifs_lookup_level0(c, &key, &znode, &n);
if (!err) {
ubifs_err("inode %lu not found in index", fscki->inum);
ubifs_err("inode %lu not found in index",
(unsigned long)fscki->inum);
return -ENOENT;
} else if (err < 0) {
ubifs_err("error %d while looking up inode %lu",
err, fscki->inum);
err, (unsigned long)fscki->inum);
return err;
}

Expand All @@ -2007,7 +2019,7 @@ static int check_inodes(struct ubifs_info *c, struct fsck_data *fsckd)
}

ubifs_msg("dump of the inode %lu sitting in LEB %d:%d",
fscki->inum, zbr->lnum, zbr->offs);
(unsigned long)fscki->inum, zbr->lnum, zbr->offs);
dbg_dump_node(c, ino);
kfree(ino);
return -EINVAL;
Expand Down
5 changes: 3 additions & 2 deletions fs/ubifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir,
return ERR_PTR(-EINVAL);
}
ubifs_warn("running out of inode numbers (current %lu, max %d)",
c->highest_inum, INUM_WATERMARK);
(unsigned long)c->highest_inum, INUM_WATERMARK);
}

inode->i_ino = ++c->highest_inum;
Expand Down Expand Up @@ -428,7 +428,8 @@ static int ubifs_readdir(struct file *file, void *dirent, filldir_t filldir)
dbg_gen("feed '%s', ino %llu, new f_pos %#x",
dent->name, (unsigned long long)le64_to_cpu(dent->inum),
key_hash_flash(c, &dent->key));
ubifs_assert(dent->ch.sqnum > ubifs_inode(dir)->creat_sqnum);
ubifs_assert(le64_to_cpu(dent->ch.sqnum) >
ubifs_inode(dir)->creat_sqnum);

nm.len = le16_to_cpu(dent->nlen);
over = filldir(dirent, dent->name, nm.len, file->f_pos,
Expand Down
Loading

0 comments on commit 51eaaa6

Please sign in to comment.