Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51eaaa67 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6

* '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
parents b7d62660 3477d204
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -4236,7 +4236,7 @@ M: dedekind@infradead.org
P:	Adrian Hunter
P:	Adrian Hunter
M:	ext-adrian.hunter@nokia.com
M:	ext-adrian.hunter@nokia.com
L:	linux-mtd@lists.infradead.org
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
W:	http://www.linux-mtd.infradead.org/doc/ubifs.html
S:	Maintained
S:	Maintained


@@ -4290,7 +4290,7 @@ P: Artem Bityutskiy
M:	dedekind@infradead.org
M:	dedekind@infradead.org
W:	http://www.linux-mtd.infradead.org/
W:	http://www.linux-mtd.infradead.org/
L:	linux-mtd@lists.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
S:	Maintained


USB ACM DRIVER
USB ACM DRIVER
+2 −2
Original line number Original line Diff line number Diff line
@@ -234,7 +234,7 @@ int ubifs_bg_thread(void *info)
	int err;
	int err;
	struct ubifs_info *c = info;
	struct ubifs_info *c = info;


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


+39 −27
Original line number Original line Diff line number Diff line
@@ -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) {
	if (c->key_fmt == UBIFS_SIMPLE_KEY_FMT) {
		switch (type) {
		switch (type) {
		case UBIFS_INO_KEY:
		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));
			       get_key_type(type));
			break;
			break;
		case UBIFS_DENT_KEY:
		case UBIFS_DENT_KEY:
		case UBIFS_XENT_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));
				get_key_type(type), key_hash(c, key));
			break;
			break;
		case UBIFS_DATA_KEY:
		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));
				get_key_type(type), key_block(c, key));
			break;
			break;
		case UBIFS_TRUN_KEY:
		case UBIFS_TRUN_KEY:
			sprintf(p, "(%lu, %s)",
			sprintf(p, "(%lu, %s)",
				key_inum(c, key), get_key_type(type));
				(unsigned long)key_inum(c, key),
				get_key_type(type));
			break;
			break;
		default:
		default:
			sprintf(p, "(bad key type: %#08x, %#08x)",
			sprintf(p, "(bad key type: %#08x, %#08x)",
@@ -364,8 +367,8 @@ void dbg_dump_node(const struct ubifs_info *c, const void *node)
		       le32_to_cpu(mst->ihead_lnum));
		       le32_to_cpu(mst->ihead_lnum));
		printk(KERN_DEBUG "\tihead_offs     %u\n",
		printk(KERN_DEBUG "\tihead_offs     %u\n",
		       le32_to_cpu(mst->ihead_offs));
		       le32_to_cpu(mst->ihead_offs));
		printk(KERN_DEBUG "\tindex_size     %u\n",
		printk(KERN_DEBUG "\tindex_size     %llu\n",
		       le32_to_cpu(mst->index_size));
		       (unsigned long long)le64_to_cpu(mst->index_size));
		printk(KERN_DEBUG "\tlpt_lnum       %u\n",
		printk(KERN_DEBUG "\tlpt_lnum       %u\n",
		       le32_to_cpu(mst->lpt_lnum));
		       le32_to_cpu(mst->lpt_lnum));
		printk(KERN_DEBUG "\tlpt_offs       %u\n",
		printk(KERN_DEBUG "\tlpt_offs       %u\n",
@@ -1589,7 +1592,7 @@ static struct fsck_inode *add_inode(struct ubifs_info *c,


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


@@ -1668,16 +1671,18 @@ static struct fsck_inode *read_add_inode(struct ubifs_info *c,
	ino_key_init(c, &key, inum);
	ino_key_init(c, &key, inum);
	err = ubifs_lookup_level0(c, &key, &znode, &n);
	err = ubifs_lookup_level0(c, &key, &znode, &n);
	if (!err) {
	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);
		return ERR_PTR(-ENOENT);
	} else if (err < 0) {
	} 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);
		return ERR_PTR(err);
	}
	}


	zbr = &znode->zbranch[n];
	zbr = &znode->zbranch[n];
	if (zbr->len < UBIFS_INO_NODE_SZ) {
	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);
		return ERR_PTR(-EINVAL);
	}
	}


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


@@ -1786,7 +1791,8 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
		if (IS_ERR(fscki)) {
		if (IS_ERR(fscki)) {
			err = PTR_ERR(fscki);
			err = PTR_ERR(fscki);
			ubifs_err("error %d while processing data node and "
			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;
			goto out_dump;
		}
		}


@@ -1819,7 +1825,8 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
		if (IS_ERR(fscki)) {
		if (IS_ERR(fscki)) {
			err = PTR_ERR(fscki);
			err = PTR_ERR(fscki);
			ubifs_err("error %d while processing entry node and "
			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;
			goto out_dump;
		}
		}


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


@@ -1923,7 +1930,8 @@ static int check_inodes(struct ubifs_info *c, struct fsck_data *fsckd)
			    fscki->references != 1) {
			    fscki->references != 1) {
				ubifs_err("directory inode %lu has %d "
				ubifs_err("directory inode %lu has %d "
					  "direntries which refer it, but "
					  "direntries which refer it, but "
					  "should be 1", fscki->inum,
					  "should be 1",
					  (unsigned long)fscki->inum,
					  fscki->references);
					  fscki->references);
				goto out_dump;
				goto out_dump;
			}
			}
@@ -1931,27 +1939,29 @@ static int check_inodes(struct ubifs_info *c, struct fsck_data *fsckd)
			    fscki->references != 0) {
			    fscki->references != 0) {
				ubifs_err("root inode %lu has non-zero (%d) "
				ubifs_err("root inode %lu has non-zero (%d) "
					  "direntries which refer it",
					  "direntries which refer it",
					  fscki->inum, fscki->references);
					  (unsigned long)fscki->inum,
					  fscki->references);
				goto out_dump;
				goto out_dump;
			}
			}
			if (fscki->calc_sz != fscki->size) {
			if (fscki->calc_sz != fscki->size) {
				ubifs_err("directory inode %lu size is %lld, "
				ubifs_err("directory inode %lu size is %lld, "
					  "but calculated size is %lld",
					  "but calculated size is %lld",
					  fscki->inum, fscki->size,
					  (unsigned long)fscki->inum,
					  fscki->calc_sz);
					  fscki->size, fscki->calc_sz);
				goto out_dump;
				goto out_dump;
			}
			}
			if (fscki->calc_cnt != fscki->nlink) {
			if (fscki->calc_cnt != fscki->nlink) {
				ubifs_err("directory inode %lu nlink is %d, "
				ubifs_err("directory inode %lu nlink is %d, "
					  "but calculated nlink is %d",
					  "but calculated nlink is %d",
					  fscki->inum, fscki->nlink,
					  (unsigned long)fscki->inum,
					  fscki->calc_cnt);
					  fscki->nlink, fscki->calc_cnt);
				goto out_dump;
				goto out_dump;
			}
			}
		} else {
		} else {
			if (fscki->references != fscki->nlink) {
			if (fscki->references != fscki->nlink) {
				ubifs_err("inode %lu nlink is %d, but "
				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);
					  fscki->nlink, fscki->references);
				goto out_dump;
				goto out_dump;
			}
			}
@@ -1959,20 +1969,21 @@ static int check_inodes(struct ubifs_info *c, struct fsck_data *fsckd)
		if (fscki->xattr_sz != fscki->calc_xsz) {
		if (fscki->xattr_sz != fscki->calc_xsz) {
			ubifs_err("inode %lu has xattr size %u, but "
			ubifs_err("inode %lu has xattr size %u, but "
				  "calculated size is %lld",
				  "calculated size is %lld",
				  fscki->inum, fscki->xattr_sz,
				  (unsigned long)fscki->inum, fscki->xattr_sz,
				  fscki->calc_xsz);
				  fscki->calc_xsz);
			goto out_dump;
			goto out_dump;
		}
		}
		if (fscki->xattr_cnt != fscki->calc_xcnt) {
		if (fscki->xattr_cnt != fscki->calc_xcnt) {
			ubifs_err("inode %lu has %u xattrs, but "
			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);
				  fscki->xattr_cnt, fscki->calc_xcnt);
			goto out_dump;
			goto out_dump;
		}
		}
		if (fscki->xattr_nms != fscki->calc_xnms) {
		if (fscki->xattr_nms != fscki->calc_xnms) {
			ubifs_err("inode %lu has xattr names' size %u, but "
			ubifs_err("inode %lu has xattr names' size %u, but "
				  "calculated names' size is %lld",
				  "calculated names' size is %lld",
				  fscki->inum, fscki->xattr_nms,
				  (unsigned long)fscki->inum, fscki->xattr_nms,
				  fscki->calc_xnms);
				  fscki->calc_xnms);
			goto out_dump;
			goto out_dump;
		}
		}
@@ -1985,11 +1996,12 @@ static int check_inodes(struct ubifs_info *c, struct fsck_data *fsckd)
	ino_key_init(c, &key, fscki->inum);
	ino_key_init(c, &key, fscki->inum);
	err = ubifs_lookup_level0(c, &key, &znode, &n);
	err = ubifs_lookup_level0(c, &key, &znode, &n);
	if (!err) {
	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;
		return -ENOENT;
	} else if (err < 0) {
	} else if (err < 0) {
		ubifs_err("error %d while looking up inode %lu",
		ubifs_err("error %d while looking up inode %lu",
			  err, fscki->inum);
			  err, (unsigned long)fscki->inum);
		return err;
		return err;
	}
	}


@@ -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",
	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);
	dbg_dump_node(c, ino);
	kfree(ino);
	kfree(ino);
	return -EINVAL;
	return -EINVAL;
+3 −2
Original line number Original line Diff line number Diff line
@@ -161,7 +161,7 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir,
			return ERR_PTR(-EINVAL);
			return ERR_PTR(-EINVAL);
		}
		}
		ubifs_warn("running out of inode numbers (current %lu, max %d)",
		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;
	inode->i_ino = ++c->highest_inum;
@@ -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",
		dbg_gen("feed '%s', ino %llu, new f_pos %#x",
			dent->name, (unsigned long long)le64_to_cpu(dent->inum),
			dent->name, (unsigned long long)le64_to_cpu(dent->inum),
			key_hash_flash(c, &dent->key));
			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);
		nm.len = le16_to_cpu(dent->nlen);
		over = filldir(dirent, dent->name, nm.len, file->f_pos,
		over = filldir(dirent, dent->name, nm.len, file->f_pos,
+63 −28
Original line number Original line Diff line number Diff line
@@ -72,7 +72,7 @@ static int read_block(struct inode *inode, void *addr, unsigned int block,
		return err;
		return err;
	}
	}


	ubifs_assert(dn->ch.sqnum > ubifs_inode(inode)->creat_sqnum);
	ubifs_assert(le64_to_cpu(dn->ch.sqnum) > ubifs_inode(inode)->creat_sqnum);


	len = le32_to_cpu(dn->size);
	len = le32_to_cpu(dn->size);
	if (len <= 0 || len > UBIFS_BLOCK_SIZE)
	if (len <= 0 || len > UBIFS_BLOCK_SIZE)
@@ -626,7 +626,7 @@ static int populate_page(struct ubifs_info *c, struct page *page,


			dn = bu->buf + (bu->zbranch[nn].offs - offs);
			dn = bu->buf + (bu->zbranch[nn].offs - offs);


			ubifs_assert(dn->ch.sqnum >
			ubifs_assert(le64_to_cpu(dn->ch.sqnum) >
				     ubifs_inode(inode)->creat_sqnum);
				     ubifs_inode(inode)->creat_sqnum);


			len = le32_to_cpu(dn->size);
			len = le32_to_cpu(dn->size);
@@ -691,32 +691,22 @@ static int populate_page(struct ubifs_info *c, struct page *page,
/**
/**
 * ubifs_do_bulk_read - do bulk-read.
 * ubifs_do_bulk_read - do bulk-read.
 * @c: UBIFS file-system description object
 * @c: UBIFS file-system description object
 * @page1: first page
 * @bu: bulk-read information
 * @page1: first page to read
 *
 *
 * This function returns %1 if the bulk-read is done, otherwise %0 is returned.
 * This function returns %1 if the bulk-read is done, otherwise %0 is returned.
 */
 */
static int ubifs_do_bulk_read(struct ubifs_info *c, struct page *page1)
static int ubifs_do_bulk_read(struct ubifs_info *c, struct bu_info *bu,
			      struct page *page1)
{
{
	pgoff_t offset = page1->index, end_index;
	pgoff_t offset = page1->index, end_index;
	struct address_space *mapping = page1->mapping;
	struct address_space *mapping = page1->mapping;
	struct inode *inode = mapping->host;
	struct inode *inode = mapping->host;
	struct ubifs_inode *ui = ubifs_inode(inode);
	struct ubifs_inode *ui = ubifs_inode(inode);
	struct bu_info *bu;
	int err, page_idx, page_cnt, ret = 0, n = 0;
	int err, page_idx, page_cnt, ret = 0, n = 0;
	int allocate = bu->buf ? 0 : 1;
	loff_t isize;
	loff_t isize;


	bu = kmalloc(sizeof(struct bu_info), GFP_NOFS);
	if (!bu)
		return 0;

	bu->buf_len = c->bulk_read_buf_size;
	bu->buf = kmalloc(bu->buf_len, GFP_NOFS);
	if (!bu->buf)
		goto out_free;

	data_key_init(c, &bu->key, inode->i_ino,
		      offset << UBIFS_BLOCKS_PER_PAGE_SHIFT);

	err = ubifs_tnc_get_bu_keys(c, bu);
	err = ubifs_tnc_get_bu_keys(c, bu);
	if (err)
	if (err)
		goto out_warn;
		goto out_warn;
@@ -735,12 +725,25 @@ static int ubifs_do_bulk_read(struct ubifs_info *c, struct page *page1)
		 * together. If all the pages were like this, bulk-read would
		 * together. If all the pages were like this, bulk-read would
		 * reduce performance, so we turn it off for a while.
		 * reduce performance, so we turn it off for a while.
		 */
		 */
		ui->read_in_a_row = 0;
		goto out_bu_off;
		ui->bulk_read = 0;
		goto out_free;
	}
	}


	if (bu->cnt) {
	if (bu->cnt) {
		if (allocate) {
			/*
			 * Allocate bulk-read buffer depending on how many data
			 * nodes we are going to read.
			 */
			bu->buf_len = bu->zbranch[bu->cnt - 1].offs +
				      bu->zbranch[bu->cnt - 1].len -
				      bu->zbranch[0].offs;
			ubifs_assert(bu->buf_len > 0);
			ubifs_assert(bu->buf_len <= c->leb_size);
			bu->buf = kmalloc(bu->buf_len, GFP_NOFS | __GFP_NOWARN);
			if (!bu->buf)
				goto out_bu_off;
		}

		err = ubifs_tnc_bulk_read(c, bu);
		err = ubifs_tnc_bulk_read(c, bu);
		if (err)
		if (err)
			goto out_warn;
			goto out_warn;
@@ -779,13 +782,17 @@ static int ubifs_do_bulk_read(struct ubifs_info *c, struct page *page1)
	ui->last_page_read = offset + page_idx - 1;
	ui->last_page_read = offset + page_idx - 1;


out_free:
out_free:
	if (allocate)
		kfree(bu->buf);
		kfree(bu->buf);
	kfree(bu);
	return ret;
	return ret;


out_warn:
out_warn:
	ubifs_warn("ignoring error %d and skipping bulk-read", err);
	ubifs_warn("ignoring error %d and skipping bulk-read", err);
	goto out_free;
	goto out_free;

out_bu_off:
	ui->read_in_a_row = ui->bulk_read = 0;
	goto out_free;
}
}


/**
/**
@@ -803,18 +810,20 @@ static int ubifs_bulk_read(struct page *page)
	struct ubifs_info *c = inode->i_sb->s_fs_info;
	struct ubifs_info *c = inode->i_sb->s_fs_info;
	struct ubifs_inode *ui = ubifs_inode(inode);
	struct ubifs_inode *ui = ubifs_inode(inode);
	pgoff_t index = page->index, last_page_read = ui->last_page_read;
	pgoff_t index = page->index, last_page_read = ui->last_page_read;
	int ret = 0;
	struct bu_info *bu;
	int err = 0, allocated = 0;


	ui->last_page_read = index;
	ui->last_page_read = index;

	if (!c->bulk_read)
	if (!c->bulk_read)
		return 0;
		return 0;

	/*
	/*
	 * Bulk-read is protected by ui_mutex, but it is an optimization, so
	 * Bulk-read is protected by @ui->ui_mutex, but it is an optimization,
	 * don't bother if we cannot lock the mutex.
	 * so don't bother if we cannot lock the mutex.
	 */
	 */
	if (!mutex_trylock(&ui->ui_mutex))
	if (!mutex_trylock(&ui->ui_mutex))
		return 0;
		return 0;

	if (index != last_page_read + 1) {
	if (index != last_page_read + 1) {
		/* Turn off bulk-read if we stop reading sequentially */
		/* Turn off bulk-read if we stop reading sequentially */
		ui->read_in_a_row = 1;
		ui->read_in_a_row = 1;
@@ -822,6 +831,7 @@ static int ubifs_bulk_read(struct page *page)
			ui->bulk_read = 0;
			ui->bulk_read = 0;
		goto out_unlock;
		goto out_unlock;
	}
	}

	if (!ui->bulk_read) {
	if (!ui->bulk_read) {
		ui->read_in_a_row += 1;
		ui->read_in_a_row += 1;
		if (ui->read_in_a_row < 3)
		if (ui->read_in_a_row < 3)
@@ -829,10 +839,35 @@ static int ubifs_bulk_read(struct page *page)
		/* Three reads in a row, so switch on bulk-read */
		/* Three reads in a row, so switch on bulk-read */
		ui->bulk_read = 1;
		ui->bulk_read = 1;
	}
	}
	ret = ubifs_do_bulk_read(c, page);

	/*
	 * If possible, try to use pre-allocated bulk-read information, which
	 * is protected by @c->bu_mutex.
	 */
	if (mutex_trylock(&c->bu_mutex))
		bu = &c->bu;
	else {
		bu = kmalloc(sizeof(struct bu_info), GFP_NOFS | __GFP_NOWARN);
		if (!bu)
			goto out_unlock;

		bu->buf = NULL;
		allocated = 1;
	}

	bu->buf_len = c->max_bu_buf_len;
	data_key_init(c, &bu->key, inode->i_ino,
		      page->index << UBIFS_BLOCKS_PER_PAGE_SHIFT);
	err = ubifs_do_bulk_read(c, bu, page);

	if (!allocated)
		mutex_unlock(&c->bu_mutex);
	else
		kfree(bu);

out_unlock:
out_unlock:
	mutex_unlock(&ui->ui_mutex);
	mutex_unlock(&ui->ui_mutex);
	return ret;
	return err;
}
}


static int ubifs_readpage(struct file *file, struct page *page)
static int ubifs_readpage(struct file *file, struct page *page)
Loading