Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1391150 > unrolled thread

[PATCH 00/11] nilfs2 updates

Started byRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
First post2016-04-29 15:40 +0200
Last post2016-04-29 15:40 +0200
Articles 6 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [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

#1391150 — [PATCH 00/11] nilfs2 updates

FromRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Date2016-04-29 15:40 +0200
Subject[PATCH 00/11] nilfs2 updates
Message-ID<rtgOd-6Lx-3@gated-at.bofh.it>
Hi Andrew,

Please queue the following changes for the next merge window:

Ryusuke Konishi (11):
      nilfs2: fix white space issue in nilfs_mount()
      nilfs2: remove space before comma
      nilfs2: remove FSF mailing address from GPL notices
      nilfs2: clean up old e-mail addresses
      MAINTAINERS: add web link for nilfs project
      nilfs2: clarify permission to replicate the design
      nilfs2: get rid of nilfs_mdt_mark_block_dirty()
      nilfs2: move cleanup code of metadata file from inode routines
      nilfs2: replace __attribute__((packed)) with __packed
      nilfs2: add missing line spacing
      nilfs2: clean trailing semicolons in macros

* Brief summary

These are mostly for cleanup.

> nilfs2: fix white space issue in nilfs_mount()
> nilfs2: remove space before comma
> nilfs2: remove FSF mailing address from GPL notices

These fix style issues that checkpatch.pl reported as error.

> nilfs2: clean up old e-mail addresses
> MAINTAINERS: add web link for nilfs project

These remove obsolete e-mail addresses and update project
information in MAINTAINERS file.

> nilfs2: clarify permission to replicate the design

This clarifies, in response to a developer's request, that
reimplementing nilfs2 is permitted.

> nilfs2: get rid of nilfs_mdt_mark_block_dirty()
> nilfs2: move cleanup code of metadata file from inode routines

These are for refactoring.

> nilfs2: replace __attribute__((packed)) with __packed
> nilfs2: add missing line spacing
> nilfs2: clean trailing semicolons in macros

These fix style issues that checkpatch.pl reported as warning.

Thanks,
Ryusuke Konishi
--

 Documentation/filesystems/nilfs2.txt |  5 +++
 MAINTAINERS                          |  1 +
 fs/nilfs2/alloc.c                    |  9 ++----
 fs/nilfs2/alloc.h                    |  9 ++----
 fs/nilfs2/bmap.c                     |  6 +---
 fs/nilfs2/bmap.h                     |  6 +---
 fs/nilfs2/btnode.c                   |  9 ++----
 fs/nilfs2/btnode.h                   |  8 ++---
 fs/nilfs2/btree.c                    |  6 +---
 fs/nilfs2/btree.h                    |  6 +---
 fs/nilfs2/cpfile.c                   |  8 ++---
 fs/nilfs2/cpfile.h                   |  6 +---
 fs/nilfs2/dat.c                      |  6 +---
 fs/nilfs2/dat.h                      |  6 +---
 fs/nilfs2/dir.c                      |  8 ++---
 fs/nilfs2/direct.c                   |  6 +---
 fs/nilfs2/direct.h                   |  6 +---
 fs/nilfs2/export.h                   |  2 +-
 fs/nilfs2/file.c                     |  7 +----
 fs/nilfs2/gcinode.c                  |  9 ++----
 fs/nilfs2/ifile.c                    |  8 ++---
 fs/nilfs2/ifile.h                    |  9 ++----
 fs/nilfs2/inode.c                    | 12 +++-----
 fs/nilfs2/ioctl.c                    | 17 ++++++-----
 fs/nilfs2/mdt.c                      | 59 ++++++++++++++++--------------------
 fs/nilfs2/mdt.h                      | 15 +++++----
 fs/nilfs2/namei.c                    |  8 ++---
 fs/nilfs2/nilfs.h                    |  7 +----
 fs/nilfs2/page.c                     |  7 +----
 fs/nilfs2/page.h                     |  7 +----
 fs/nilfs2/recovery.c                 |  7 ++---
 fs/nilfs2/segbuf.c                   |  6 +---
 fs/nilfs2/segbuf.h                   |  6 +---
 fs/nilfs2/segment.c                  |  7 ++---
 fs/nilfs2/segment.h                  |  6 +---
 fs/nilfs2/sufile.c                   | 14 ++++-----
 fs/nilfs2/sufile.h                   | 10 ++----
 fs/nilfs2/super.c                    | 17 ++++-------
 fs/nilfs2/sysfs.h                    |  6 ++--
 fs/nilfs2/the_nilfs.c                |  6 +---
 fs/nilfs2/the_nilfs.h                |  8 ++---
 include/linux/nilfs2_fs.h            |  7 +----
 42 files changed, 121 insertions(+), 257 deletions(-)

[toc] | [next] | [standalone]


#1391152 — [PATCH 09/11] nilfs2: replace __attribute__((packed)) with __packed

FromRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Date2016-04-29 15:40 +0200
Subject[PATCH 09/11] nilfs2: replace __attribute__((packed)) with __packed
Message-ID<rtgOf-6Lx-19@gated-at.bofh.it>
In reply to#1391150
This fixes the following checkpatch.pl warning:

  WARNING: __packed is preferred over __attribute__((packed))
  #23: FILE: export.h:23:
  +} __attribute__ ((packed));

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
 fs/nilfs2/export.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nilfs2/export.h b/fs/nilfs2/export.h
index 19ccbf9..00107fd 100644
--- a/fs/nilfs2/export.h
+++ b/fs/nilfs2/export.h
@@ -20,6 +20,6 @@ struct nilfs_fid {
 
 	u32 parent_gen;
 	u64 parent_ino;
-} __attribute__ ((packed));
+} __packed;
 
 #endif
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1391153 — [PATCH 07/11] nilfs2: get rid of nilfs_mdt_mark_block_dirty()

FromRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Date2016-04-29 15:40 +0200
Subject[PATCH 07/11] nilfs2: get rid of nilfs_mdt_mark_block_dirty()
Message-ID<rtgOg-6Lx-45@gated-at.bofh.it>
In reply to#1391150
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

[toc] | [prev] | [next] | [standalone]


#1391155 — [PATCH 06/11] nilfs2: clarify permission to replicate the design

FromRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Date2016-04-29 15:40 +0200
Subject[PATCH 06/11] nilfs2: clarify permission to replicate the design
Message-ID<rtgOg-6Lx-41@gated-at.bofh.it>
In reply to#1391150
To respond to a certain developer's request, this explicitly state
that developers can reimplement the nilfs2 design for other operating
systems to share data stored in that format.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
 Documentation/filesystems/nilfs2.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/filesystems/nilfs2.txt b/Documentation/filesystems/nilfs2.txt
index 41c3d33..5b21ef7 100644
--- a/Documentation/filesystems/nilfs2.txt
+++ b/Documentation/filesystems/nilfs2.txt
@@ -268,3 +268,8 @@ among NILFS2 files can be depicted as follows:
                                     ( regular file, directory, or symlink )
 
 For detail on the format of each file, please see include/linux/nilfs2_fs.h.
+
+There are no patents or other intellectual property that we protect
+with regard to the design of NILFS2.  It is allowed to replicate the
+design in hopes that other operating systems could share (mount, read,
+write, etc.) data stored in this format.
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1391156 — [PATCH 08/11] nilfs2: move cleanup code of metadata file from inode routines

FromRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Date2016-04-29 15:40 +0200
Subject[PATCH 08/11] nilfs2: move cleanup code of metadata file from inode routines
Message-ID<rtgOg-6Lx-39@gated-at.bofh.it>
In reply to#1391150
Refactor nilfs_clear_inode() and nilfs_i_callback() so that cleanup
code or resource deallocation related to metadata file will be moved
out to mdt.c.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
 fs/nilfs2/inode.c |  5 ++---
 fs/nilfs2/mdt.c   | 25 +++++++++++++++++++++++++
 fs/nilfs2/mdt.h   |  8 ++++++++
 fs/nilfs2/super.c |  8 +++-----
 4 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index 3d3ff46..191bc218 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -755,7 +755,6 @@ void nilfs_truncate(struct inode *inode)
 static void nilfs_clear_inode(struct inode *inode)
 {
 	struct nilfs_inode_info *ii = NILFS_I(inode);
-	struct nilfs_mdt_info *mdi = NILFS_MDT(inode);
 
 	/*
 	 * Free resources allocated in nilfs_read_inode(), here.
@@ -764,8 +763,8 @@ static void nilfs_clear_inode(struct inode *inode)
 	brelse(ii->i_bh);
 	ii->i_bh = NULL;
 
-	if (mdi && mdi->mi_palloc_cache)
-		nilfs_palloc_destroy_cache(inode);
+	if (nilfs_is_metadata_file_inode(inode))
+		nilfs_mdt_clear(inode);
 
 	if (test_bit(NILFS_I_BMAP, &ii->i_state))
 		nilfs_bmap_clear(ii->i_bmap);
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
index c8fe584..8a2f8b2 100644
--- a/fs/nilfs2/mdt.c
+++ b/fs/nilfs2/mdt.c
@@ -28,6 +28,7 @@
 #include "segment.h"
 #include "page.h"
 #include "mdt.h"
+#include "alloc.h"		/* nilfs_palloc_destroy_cache() */
 
 #include <trace/events/nilfs2.h>
 
@@ -465,6 +466,30 @@ int nilfs_mdt_init(struct inode *inode, gfp_t gfp_mask, size_t objsz)
 	return 0;
 }
 
+/**
+ * nilfs_mdt_clear - do cleanup for the metadata file
+ * @inode: inode of the metadata file
+ */
+void nilfs_mdt_clear(struct inode *inode)
+{
+	struct nilfs_mdt_info *mdi = NILFS_MDT(inode);
+
+	if (mdi->mi_palloc_cache)
+		nilfs_palloc_destroy_cache(inode);
+}
+
+/**
+ * nilfs_mdt_destroy - release resources used by the metadata file
+ * @inode: inode of the metadata file
+ */
+void nilfs_mdt_destroy(struct inode *inode)
+{
+	struct nilfs_mdt_info *mdi = NILFS_MDT(inode);
+
+	kfree(mdi->mi_bgl); /* kfree(NULL) is safe */
+	kfree(mdi);
+}
+
 void nilfs_mdt_set_entry_size(struct inode *inode, unsigned entry_size,
 			      unsigned header_size)
 {
diff --git a/fs/nilfs2/mdt.h b/fs/nilfs2/mdt.h
index dc88907..ffb876e 100644
--- a/fs/nilfs2/mdt.h
+++ b/fs/nilfs2/mdt.h
@@ -67,6 +67,11 @@ static inline struct nilfs_mdt_info *NILFS_MDT(const struct inode *inode)
 	return inode->i_private;
 }
 
+static inline int nilfs_is_metadata_file_inode(const struct inode *inode)
+{
+	return inode->i_private != NULL;
+}
+
 /* Default GFP flags using highmem */
 #define NILFS_MDT_GFP      (__GFP_RECLAIM | __GFP_IO | __GFP_HIGHMEM)
 
@@ -82,6 +87,9 @@ int nilfs_mdt_forget_block(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);
+void nilfs_mdt_clear(struct inode *inode);
+void nilfs_mdt_destroy(struct inode *inode);
+
 void nilfs_mdt_set_entry_size(struct inode *, unsigned, unsigned);
 
 int nilfs_mdt_setup_shadow_map(struct inode *inode,
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 2ed3e40..2cb78b8 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -169,12 +169,10 @@ struct inode *nilfs_alloc_inode(struct super_block *sb)
 static void nilfs_i_callback(struct rcu_head *head)
 {
 	struct inode *inode = container_of(head, struct inode, i_rcu);
-	struct nilfs_mdt_info *mdi = NILFS_MDT(inode);
 
-	if (mdi) {
-		kfree(mdi->mi_bgl); /* kfree(NULL) is safe */
-		kfree(mdi);
-	}
+	if (nilfs_is_metadata_file_inode(inode))
+		nilfs_mdt_destroy(inode);
+
 	kmem_cache_free(nilfs_inode_cachep, NILFS_I(inode));
 }
 
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1391158 — [PATCH 02/11] nilfs2: remove space before comma

FromRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Date2016-04-29 15:40 +0200
Subject[PATCH 02/11] nilfs2: remove space before comma
Message-ID<rtgOg-6Lx-47@gated-at.bofh.it>
In reply to#1391150
Fix checkpatch.pl error "ERROR: space prohibited before that ','
(ctx:WxW)" at nilfs_sufile_set_suinfo().

This also fixes checkpatch.pl warning "WARNING: Prefer 'unsigned int'
to bare use of 'unsigned'" at nilfs_sufile_set_suinfo() and
nilfs_sufile_get_suinfo().

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
 fs/nilfs2/sufile.c | 4 ++--
 fs/nilfs2/sufile.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nilfs2/sufile.c b/fs/nilfs2/sufile.c
index 52821ff..5b37204 100644
--- a/fs/nilfs2/sufile.c
+++ b/fs/nilfs2/sufile.c
@@ -819,7 +819,7 @@ out:
  * %-ENOMEM - Insufficient amount of memory available.
  */
 ssize_t nilfs_sufile_get_suinfo(struct inode *sufile, __u64 segnum, void *buf,
-				unsigned sisz, size_t nsi)
+				unsigned int sisz, size_t nsi)
 {
 	struct buffer_head *su_bh;
 	struct nilfs_segment_usage *su;
@@ -897,7 +897,7 @@ ssize_t nilfs_sufile_get_suinfo(struct inode *sufile, __u64 segnum, void *buf,
  * %-EINVAL - Invalid values in input (segment number, flags or nblocks)
  */
 ssize_t nilfs_sufile_set_suinfo(struct inode *sufile, void *buf,
-				unsigned supsz, size_t nsup)
+				unsigned int supsz, size_t nsup)
 {
 	struct the_nilfs *nilfs = sufile->i_sb->s_fs_info;
 	struct buffer_head *header_bh, *bh;
diff --git a/fs/nilfs2/sufile.h b/fs/nilfs2/sufile.h
index b8afd72..35e34c8 100644
--- a/fs/nilfs2/sufile.h
+++ b/fs/nilfs2/sufile.h
@@ -42,9 +42,9 @@ int nilfs_sufile_mark_dirty(struct inode *sufile, __u64 segnum);
 int nilfs_sufile_set_segment_usage(struct inode *sufile, __u64 segnum,
 				   unsigned long nblocks, time_t modtime);
 int nilfs_sufile_get_stat(struct inode *, struct nilfs_sustat *);
-ssize_t nilfs_sufile_get_suinfo(struct inode *, __u64, void *, unsigned,
+ssize_t nilfs_sufile_get_suinfo(struct inode *, __u64, void *, unsigned int,
 				size_t);
-ssize_t nilfs_sufile_set_suinfo(struct inode *, void *, unsigned , size_t);
+ssize_t nilfs_sufile_set_suinfo(struct inode *, void *, unsigned int, size_t);
 
 int nilfs_sufile_updatev(struct inode *, __u64 *, size_t, int, size_t *,
 			 void (*dofunc)(struct inode *, __u64,
-- 
1.8.3.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web