Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1391153
| From | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 07/11] nilfs2: get rid of nilfs_mdt_mark_block_dirty() |
| Date | 2016-04-29 15:40 +0200 |
| Message-ID | <rtgOg-6Lx-45@gated-at.bofh.it> (permalink) |
| References | <rtgOd-6Lx-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
nilfs_mdt_mark_block_dirty() can be replaced with primary functions
like nilfs_mdt_get_block() and mark_buffer_dirty(), and it's used only
by nilfs_ioctl_mark_blocks_dirty().
This gets rid of the function to simplify the interface of metadata
file.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
fs/nilfs2/ioctl.c | 11 ++++++++---
fs/nilfs2/mdt.c | 28 ----------------------------
fs/nilfs2/mdt.h | 1 -
3 files changed, 8 insertions(+), 32 deletions(-)
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index e865998..358b57e 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -779,6 +779,7 @@ static int nilfs_ioctl_mark_blocks_dirty(struct the_nilfs *nilfs,
size_t nmembs = argv->v_nmembs;
struct nilfs_bmap *bmap = NILFS_I(nilfs->ns_dat)->i_bmap;
struct nilfs_bdesc *bdescs = buf;
+ struct buffer_head *bh;
int ret, i;
for (i = 0; i < nmembs; i++) {
@@ -796,12 +797,16 @@ static int nilfs_ioctl_mark_blocks_dirty(struct the_nilfs *nilfs,
/* skip dead block */
continue;
if (bdescs[i].bd_level == 0) {
- ret = nilfs_mdt_mark_block_dirty(nilfs->ns_dat,
- bdescs[i].bd_offset);
- if (ret < 0) {
+ ret = nilfs_mdt_get_block(nilfs->ns_dat,
+ bdescs[i].bd_offset,
+ false, NULL, &bh);
+ if (unlikely(ret)) {
WARN_ON(ret == -ENOENT);
return ret;
}
+ mark_buffer_dirty(bh);
+ nilfs_mdt_mark_dirty(nilfs->ns_dat);
+ put_bh(bh);
} else {
ret = nilfs_bmap_mark(bmap, bdescs[i].bd_offset,
bdescs[i].bd_level);
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
index 36fa941..c8fe584 100644
--- a/fs/nilfs2/mdt.c
+++ b/fs/nilfs2/mdt.c
@@ -389,34 +389,6 @@ int nilfs_mdt_forget_block(struct inode *inode, unsigned long block)
return ret;
}
-/**
- * nilfs_mdt_mark_block_dirty - mark a block on the meta data file dirty.
- * @inode: inode of the meta data file
- * @block: block offset
- *
- * Return Value: On success, it returns 0. On error, the following negative
- * error code is returned.
- *
- * %-ENOMEM - Insufficient memory available.
- *
- * %-EIO - I/O error
- *
- * %-ENOENT - the specified block does not exist (hole block)
- */
-int nilfs_mdt_mark_block_dirty(struct inode *inode, unsigned long block)
-{
- struct buffer_head *bh;
- int err;
-
- err = nilfs_mdt_read_block(inode, block, 0, &bh);
- if (unlikely(err))
- return err;
- mark_buffer_dirty(bh);
- nilfs_mdt_mark_dirty(inode);
- brelse(bh);
- return 0;
-}
-
int nilfs_mdt_fetch_dirty(struct inode *inode)
{
struct nilfs_inode_info *ii = NILFS_I(inode);
diff --git a/fs/nilfs2/mdt.h b/fs/nilfs2/mdt.h
index 54e3b7f..dc88907 100644
--- a/fs/nilfs2/mdt.h
+++ b/fs/nilfs2/mdt.h
@@ -79,7 +79,6 @@ int nilfs_mdt_find_block(struct inode *inode, unsigned long start,
struct buffer_head **out_bh);
int nilfs_mdt_delete_block(struct inode *, unsigned long);
int nilfs_mdt_forget_block(struct inode *, unsigned long);
-int nilfs_mdt_mark_block_dirty(struct inode *, unsigned long);
int nilfs_mdt_fetch_dirty(struct inode *);
int nilfs_mdt_init(struct inode *inode, gfp_t gfp_mask, size_t objsz);
--
1.8.3.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/11] nilfs2 updates Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-04-29 15:40 +0200 [PATCH 09/11] nilfs2: replace __attribute__((packed)) with __packed Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-04-29 15:40 +0200 [PATCH 07/11] nilfs2: get rid of nilfs_mdt_mark_block_dirty() Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-04-29 15:40 +0200 [PATCH 06/11] nilfs2: clarify permission to replicate the design Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-04-29 15:40 +0200 [PATCH 08/11] nilfs2: move cleanup code of metadata file from inode routines Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-04-29 15:40 +0200 [PATCH 02/11] nilfs2: remove space before comma Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-04-29 15:40 +0200
csiph-web