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

Commit b65f0d67 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
  nilfs2: unfold nilfs_dat_inode function
  nilfs2: do not pass sbi to functions which can get it from inode
  nilfs2: get rid of nilfs_mount_options structure
  nilfs2: simplify nilfs_mdt_freeze_buffer
  nilfs2: get rid of loaded flag from nilfs object
  nilfs2: fix a checkpatch error in page.c
  nilfs2: fiemap support
  nilfs2: mark buffer heads as delayed until the data is written to disk
  nilfs2: call nilfs_error inside bmap routines
  fs/nilfs2/super.c: Use printf extension %pV
  MAINTAINERS: add nilfs2 git tree entry
parents f3ea5972 365e215c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4268,6 +4268,7 @@ NILFS2 FILESYSTEM
M:	KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
L:	linux-nilfs@vger.kernel.org
W:	http://www.nilfs.org/en/
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2.git
S:	Supported
F:	Documentation/filesystems/nilfs2.txt
F:	fs/nilfs2/
+36 −11
Original line number Diff line number Diff line
@@ -35,7 +35,20 @@

struct inode *nilfs_bmap_get_dat(const struct nilfs_bmap *bmap)
{
	return nilfs_dat_inode(NILFS_I_NILFS(bmap->b_inode));
	return NILFS_I_NILFS(bmap->b_inode)->ns_dat;
}

static int nilfs_bmap_convert_error(struct nilfs_bmap *bmap,
				     const char *fname, int err)
{
	struct inode *inode = bmap->b_inode;

	if (err == -EINVAL) {
		nilfs_error(inode->i_sb, fname,
			    "broken bmap (inode number=%lu)\n", inode->i_ino);
		err = -EIO;
	}
	return err;
}

/**
@@ -66,8 +79,10 @@ int nilfs_bmap_lookup_at_level(struct nilfs_bmap *bmap, __u64 key, int level,

	down_read(&bmap->b_sem);
	ret = bmap->b_ops->bop_lookup(bmap, key, level, ptrp);
	if (ret < 0)
	if (ret < 0) {
		ret = nilfs_bmap_convert_error(bmap, __func__, ret);
		goto out;
	}
	if (NILFS_BMAP_USE_VBN(bmap)) {
		ret = nilfs_dat_translate(nilfs_bmap_get_dat(bmap), *ptrp,
					  &blocknr);
@@ -88,7 +103,8 @@ int nilfs_bmap_lookup_contig(struct nilfs_bmap *bmap, __u64 key, __u64 *ptrp,
	down_read(&bmap->b_sem);
	ret = bmap->b_ops->bop_lookup_contig(bmap, key, ptrp, maxblocks);
	up_read(&bmap->b_sem);
	return ret;

	return nilfs_bmap_convert_error(bmap, __func__, ret);
}

static int nilfs_bmap_do_insert(struct nilfs_bmap *bmap, __u64 key, __u64 ptr)
@@ -144,7 +160,8 @@ int nilfs_bmap_insert(struct nilfs_bmap *bmap,
	down_write(&bmap->b_sem);
	ret = nilfs_bmap_do_insert(bmap, key, rec);
	up_write(&bmap->b_sem);
	return ret;

	return nilfs_bmap_convert_error(bmap, __func__, ret);
}

static int nilfs_bmap_do_delete(struct nilfs_bmap *bmap, __u64 key)
@@ -180,9 +197,12 @@ int nilfs_bmap_last_key(struct nilfs_bmap *bmap, unsigned long *key)

	down_read(&bmap->b_sem);
	ret = bmap->b_ops->bop_last_key(bmap, &lastkey);
	if (!ret)
		*key = lastkey;
	up_read(&bmap->b_sem);

	if (ret < 0)
		ret = nilfs_bmap_convert_error(bmap, __func__, ret);
	else
		*key = lastkey;
	return ret;
}

@@ -210,7 +230,8 @@ int nilfs_bmap_delete(struct nilfs_bmap *bmap, unsigned long key)
	down_write(&bmap->b_sem);
	ret = nilfs_bmap_do_delete(bmap, key);
	up_write(&bmap->b_sem);
	return ret;

	return nilfs_bmap_convert_error(bmap, __func__, ret);
}

static int nilfs_bmap_do_truncate(struct nilfs_bmap *bmap, unsigned long key)
@@ -261,7 +282,8 @@ int nilfs_bmap_truncate(struct nilfs_bmap *bmap, unsigned long key)
	down_write(&bmap->b_sem);
	ret = nilfs_bmap_do_truncate(bmap, key);
	up_write(&bmap->b_sem);
	return ret;

	return nilfs_bmap_convert_error(bmap, __func__, ret);
}

/**
@@ -300,7 +322,8 @@ int nilfs_bmap_propagate(struct nilfs_bmap *bmap, struct buffer_head *bh)
	down_write(&bmap->b_sem);
	ret = bmap->b_ops->bop_propagate(bmap, bh);
	up_write(&bmap->b_sem);
	return ret;

	return nilfs_bmap_convert_error(bmap, __func__, ret);
}

/**
@@ -344,7 +367,8 @@ int nilfs_bmap_assign(struct nilfs_bmap *bmap,
	down_write(&bmap->b_sem);
	ret = bmap->b_ops->bop_assign(bmap, bh, blocknr, binfo);
	up_write(&bmap->b_sem);
	return ret;

	return nilfs_bmap_convert_error(bmap, __func__, ret);
}

/**
@@ -373,7 +397,8 @@ int nilfs_bmap_mark(struct nilfs_bmap *bmap, __u64 key, int level)
	down_write(&bmap->b_sem);
	ret = bmap->b_ops->bop_mark(bmap, key, level);
	up_write(&bmap->b_sem);
	return ret;

	return nilfs_bmap_convert_error(bmap, __func__, ret);
}

/**
+1 −2
Original line number Diff line number Diff line
@@ -104,8 +104,7 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
	if (pblocknr == 0) {
		pblocknr = blocknr;
		if (inode->i_ino != NILFS_DAT_INO) {
			struct inode *dat =
				nilfs_dat_inode(NILFS_I_NILFS(inode));
			struct inode *dat = NILFS_I_NILFS(inode)->ns_dat;

			/* blocknr is a virtual block number */
			err = nilfs_dat_translate(dat, blocknr, &pblocknr);
+1 −2
Original line number Diff line number Diff line
@@ -91,7 +91,6 @@ static void nilfs_commit_chunk(struct page *page,
			       unsigned from, unsigned to)
{
	struct inode *dir = mapping->host;
	struct nilfs_sb_info *sbi = NILFS_SB(dir->i_sb);
	loff_t pos = page_offset(page) + from;
	unsigned len = to - from;
	unsigned nr_dirty, copied;
@@ -103,7 +102,7 @@ static void nilfs_commit_chunk(struct page *page,
		i_size_write(dir, pos + copied);
	if (IS_DIRSYNC(dir))
		nilfs_set_transaction_flag(NILFS_TI_SYNC);
	err = nilfs_set_file_dirty(sbi, dir, nr_dirty);
	err = nilfs_set_file_dirty(dir, nr_dirty);
	WARN_ON(err); /* do not happen */
	unlock_page(page);
}
+1 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ const struct inode_operations nilfs_file_inode_operations = {
	.truncate	= nilfs_truncate,
	.setattr	= nilfs_setattr,
	.permission     = nilfs_permission,
	.fiemap		= nilfs_fiemap,
};

/* end of file */
Loading