linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: increase the number of max hard links
@ 2015-08-11  1:23 Jaegeuk Kim
  2015-08-11  1:23 ` [PATCH 2/2] f2fs: skip checkpoint if there is no dirty segments Jaegeuk Kim
  2015-08-12  9:42 ` [f2fs-dev] [PATCH 1/2] f2fs: increase the number of max hard links Chao Yu
  0 siblings, 2 replies; 7+ messages in thread
From: Jaegeuk Kim @ 2015-08-11  1:23 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim

This patch increases the number of maximum hard links for one file.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/f2fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 3884794..f18d31e 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -321,7 +321,7 @@ enum {
 					 */
 };
 
-#define F2FS_LINK_MAX		32000	/* maximum link count per file */
+#define F2FS_LINK_MAX		65536	/* maximum link count per file */
 
 #define MAX_DIR_RA_PAGES	4	/* maximum ra pages of dir */
 
-- 
2.1.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] f2fs: skip checkpoint if there is no dirty segments
  2015-08-11  1:23 [PATCH 1/2] f2fs: increase the number of max hard links Jaegeuk Kim
@ 2015-08-11  1:23 ` Jaegeuk Kim
  2015-08-12  5:09   ` [PATCH 2/2 v2] " Jaegeuk Kim
  2015-08-12  9:42 ` [f2fs-dev] [PATCH 1/2] f2fs: increase the number of max hard links Chao Yu
  1 sibling, 1 reply; 7+ messages in thread
From: Jaegeuk Kim @ 2015-08-11  1:23 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim

We should avoid wrong checkpoints when there is no dirty segments.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/gc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index fcb263a..c4ed116 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -809,13 +809,14 @@ gc_more:
 	if (unlikely(f2fs_cp_error(sbi)))
 		goto stop;
 
+	if (!__get_victim(sbi, &segno, gc_type))
+		goto stop;
+
 	if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) {
 		gc_type = FG_GC;
 		write_checkpoint(sbi, &cpc);
 	}
 
-	if (!__get_victim(sbi, &segno, gc_type))
-		goto stop;
 	ret = 0;
 
 	/* readahead multi ssa blocks those have contiguous address */
-- 
2.1.1


------------------------------------------------------------------------------

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2 v2] f2fs: skip checkpoint if there is no dirty segments
  2015-08-11  1:23 ` [PATCH 2/2] f2fs: skip checkpoint if there is no dirty segments Jaegeuk Kim
@ 2015-08-12  5:09   ` Jaegeuk Kim
  2015-08-12  9:43     ` [f2fs-dev] " Chao Yu
  0 siblings, 1 reply; 7+ messages in thread
From: Jaegeuk Kim @ 2015-08-12  5:09 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel

Change log from v1:
 - fix skipping gc incorrectly

>From 06f90d3757a6b7ff524cc112168488f31bbf830f Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Tue, 11 Aug 2015 21:59:49 -0700
Subject: [PATCH] f2fs: skip checkpoint if there is no dirty and prefree
 segments

We should avoid needless checkpoints when there is no dirty and prefree segment.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/gc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index fcb263a..98bf538 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -811,7 +811,8 @@ gc_more:
 
 	if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) {
 		gc_type = FG_GC;
-		write_checkpoint(sbi, &cpc);
+		if (dirty_segments(sbi) || prefree_segments(sbi))
+			write_checkpoint(sbi, &cpc);
 	}
 
 	if (!__get_victim(sbi, &segno, gc_type))
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [f2fs-dev] [PATCH 1/2] f2fs: increase the number of max hard links
  2015-08-11  1:23 [PATCH 1/2] f2fs: increase the number of max hard links Jaegeuk Kim
  2015-08-11  1:23 ` [PATCH 2/2] f2fs: skip checkpoint if there is no dirty segments Jaegeuk Kim
@ 2015-08-12  9:42 ` Chao Yu
  2015-08-14 23:22   ` Jaegeuk Kim
  1 sibling, 1 reply; 7+ messages in thread
From: Chao Yu @ 2015-08-12  9:42 UTC (permalink / raw)
  To: 'Jaegeuk Kim'; +Cc: linux-kernel, linux-fsdevel, linux-f2fs-devel

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Tuesday, August 11, 2015 9:23 AM
> To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org;
> linux-f2fs-devel@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 1/2] f2fs: increase the number of max hard links
> 
> This patch increases the number of maximum hard links for one file.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <chao2.yu@samsung.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [f2fs-dev] [PATCH 2/2 v2] f2fs: skip checkpoint if there is no dirty segments
  2015-08-12  5:09   ` [PATCH 2/2 v2] " Jaegeuk Kim
@ 2015-08-12  9:43     ` Chao Yu
  2015-08-13  1:26       ` [PATCH 2/2 v3] " Jaegeuk Kim
  0 siblings, 1 reply; 7+ messages in thread
From: Chao Yu @ 2015-08-12  9:43 UTC (permalink / raw)
  To: 'Jaegeuk Kim'; +Cc: linux-kernel, linux-fsdevel, linux-f2fs-devel

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Wednesday, August 12, 2015 1:09 PM
> To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org;
> linux-f2fs-devel@lists.sourceforge.net
> Subject: Re: [f2fs-dev] [PATCH 2/2 v2] f2fs: skip checkpoint if there is no dirty segments
> 
> Change log from v1:
>  - fix skipping gc incorrectly
> 
> >From 06f90d3757a6b7ff524cc112168488f31bbf830f Mon Sep 17 00:00:00 2001
> From: Jaegeuk Kim <jaegeuk@kernel.org>
> Date: Tue, 11 Aug 2015 21:59:49 -0700
> Subject: [PATCH] f2fs: skip checkpoint if there is no dirty and prefree
>  segments
> 
> We should avoid needless checkpoints when there is no dirty and prefree segment.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <chao2.yu@samsung.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2 v3] f2fs: skip checkpoint if there is no dirty segments
  2015-08-12  9:43     ` [f2fs-dev] " Chao Yu
@ 2015-08-13  1:26       ` Jaegeuk Kim
  0 siblings, 0 replies; 7+ messages in thread
From: Jaegeuk Kim @ 2015-08-13  1:26 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel

Change log from v2:
 - consider omitting current dirty segments

>From 181cb245f6a406e89c00976f65a5727956a72942 Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Tue, 11 Aug 2015 21:59:49 -0700
Subject: [PATCH] f2fs: skip checkpoint if there is no dirty and prefree
 segments

We should avoid needless checkpoints when there is no dirty and prefree segment.

eviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/gc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index fcb263a..81de28d8 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -792,7 +792,8 @@ static void do_garbage_collect(struct f2fs_sb_info *sbi, unsigned int segno,
 
 int f2fs_gc(struct f2fs_sb_info *sbi)
 {
-	unsigned int segno, i;
+	unsigned int segno = NULL_SEGNO;
+	unsigned int i;
 	int gc_type = BG_GC;
 	int nfree = 0;
 	int ret = -1;
@@ -811,10 +812,11 @@ gc_more:
 
 	if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) {
 		gc_type = FG_GC;
-		write_checkpoint(sbi, &cpc);
+		if (__get_victim(sbi, &segno, gc_type) || prefree_segments(sbi))
+			write_checkpoint(sbi, &cpc);
 	}
 
-	if (!__get_victim(sbi, &segno, gc_type))
+	if (segno == NULL_SEGNO && !__get_victim(sbi, &segno, gc_type))
 		goto stop;
 	ret = 0;
 
-- 
2.1.1


------------------------------------------------------------------------------

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] f2fs: increase the number of max hard links
  2015-08-12  9:42 ` [f2fs-dev] [PATCH 1/2] f2fs: increase the number of max hard links Chao Yu
@ 2015-08-14 23:22   ` Jaegeuk Kim
  0 siblings, 0 replies; 7+ messages in thread
From: Jaegeuk Kim @ 2015-08-14 23:22 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel

Change log from v1:
 o increase to the maximum since we have 32 bit structure

>From 448ffa6a623cae1c3537114b9d10f92d1ddf03f5 Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Mon, 10 Aug 2015 15:01:12 -0700
Subject: [PATCH] f2fs: increase the number of max hard links

This patch increases the number of maximum hard links for one file.

Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/f2fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index a55169a..00591f7 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -322,7 +322,7 @@ enum {
 					 */
 };
 
-#define F2FS_LINK_MAX		32000	/* maximum link count per file */
+#define F2FS_LINK_MAX	0xffffffff	/* maximum link count per file */
 
 #define MAX_DIR_RA_PAGES	4	/* maximum ra pages of dir */
 
-- 
2.1.1

------------------------------------------------------------------------------

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-08-14 23:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-11  1:23 [PATCH 1/2] f2fs: increase the number of max hard links Jaegeuk Kim
2015-08-11  1:23 ` [PATCH 2/2] f2fs: skip checkpoint if there is no dirty segments Jaegeuk Kim
2015-08-12  5:09   ` [PATCH 2/2 v2] " Jaegeuk Kim
2015-08-12  9:43     ` [f2fs-dev] " Chao Yu
2015-08-13  1:26       ` [PATCH 2/2 v3] " Jaegeuk Kim
2015-08-12  9:42 ` [f2fs-dev] [PATCH 1/2] f2fs: increase the number of max hard links Chao Yu
2015-08-14 23:22   ` Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).