All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] ubifs: Some simple fixes
@ 2018-05-14  8:18 Sascha Hauer
  2018-05-14  8:18 ` [PATCH 1/6] ubifs: remove set but never used variable Sascha Hauer
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sascha Hauer @ 2018-05-14  8:18 UTC (permalink / raw)
  To: linux-mtd
  Cc: Artem Bityutskiy, Richard Weinberger, Adrian Hunter, Sascha Hauer

Having looked at UBIFS more closely recently I collected some spelling
fixes, fixes for wrong comments and a removal for an unused variable.

Sascha

Sascha Hauer (6):
  ubifs: remove set but never used variable
  ubifs: journal: Remove wrong comment
  ubifs: Spelling fix someting -> something
  ubifs: log: Some spelling fixes
  ubifs: gc: Fix typo
  ubifs: lpt: Fix wrong pnode number range in comment

 fs/ubifs/gc.c         | 2 +-
 fs/ubifs/journal.c    | 5 ++---
 fs/ubifs/log.c        | 6 +++---
 fs/ubifs/lpt_commit.c | 2 +-
 fs/ubifs/replay.c     | 5 +----
 fs/ubifs/ubifs.h      | 2 --
 6 files changed, 8 insertions(+), 14 deletions(-)

-- 
2.17.0

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

* [PATCH 1/6] ubifs: remove set but never used variable
  2018-05-14  8:18 [PATCH 0/6] ubifs: Some simple fixes Sascha Hauer
@ 2018-05-14  8:18 ` Sascha Hauer
  2018-05-14  8:18 ` [PATCH 2/6] ubifs: journal: Remove wrong comment Sascha Hauer
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2018-05-14  8:18 UTC (permalink / raw)
  To: linux-mtd
  Cc: Artem Bityutskiy, Richard Weinberger, Adrian Hunter, Sascha Hauer

replay_sqnum is set but never used. Remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/ubifs/replay.c | 3 ---
 fs/ubifs/ubifs.h  | 2 --
 2 files changed, 5 deletions(-)

diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c
index ae5c02f22f3e..f10a72a75ed7 100644
--- a/fs/ubifs/replay.c
+++ b/fs/ubifs/replay.c
@@ -223,9 +223,6 @@ static int apply_replay_entry(struct ubifs_info *c, struct replay_entry *r)
 	dbg_mntk(&r->key, "LEB %d:%d len %d deletion %d sqnum %llu key ",
 		 r->lnum, r->offs, r->len, r->deletion, r->sqnum);
 
-	/* Set c->replay_sqnum to help deal with dangling branches. */
-	c->replay_sqnum = r->sqnum;
-
 	if (is_hash_key(c, &r->key)) {
 		if (r->deletion)
 			err = ubifs_tnc_remove_nm(c, &r->key, &r->nm);
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index 5ee7af879cc4..209d6369ae71 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -1206,7 +1206,6 @@ struct ubifs_debug_info;
  * @replay_list: temporary list used during journal replay
  * @replay_buds: list of buds to replay
  * @cs_sqnum: sequence number of first node in the log (commit start node)
- * @replay_sqnum: sequence number of node currently being replayed
  * @unclean_leb_list: LEBs to recover when re-mounting R/O mounted FS to R/W
  *                    mode
  * @rcvrd_mst_node: recovered master node to write when re-mounting R/O mounted
@@ -1438,7 +1437,6 @@ struct ubifs_info {
 	struct list_head replay_list;
 	struct list_head replay_buds;
 	unsigned long long cs_sqnum;
-	unsigned long long replay_sqnum;
 	struct list_head unclean_leb_list;
 	struct ubifs_mst_node *rcvrd_mst_node;
 	struct rb_root size_tree;
-- 
2.17.0

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

* [PATCH 2/6] ubifs: journal: Remove wrong comment
  2018-05-14  8:18 [PATCH 0/6] ubifs: Some simple fixes Sascha Hauer
  2018-05-14  8:18 ` [PATCH 1/6] ubifs: remove set but never used variable Sascha Hauer
@ 2018-05-14  8:18 ` Sascha Hauer
  2018-05-14  8:18 ` [PATCH 3/6] ubifs: Spelling fix someting -> something Sascha Hauer
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2018-05-14  8:18 UTC (permalink / raw)
  To: linux-mtd
  Cc: Artem Bityutskiy, Richard Weinberger, Adrian Hunter, Sascha Hauer

In the description of reserve_space() it is claimed that write_node()
and write_head() unlock the journal head. This is not true and has never
been true. All callers of write_node() and write_head() call
release_head() themselves. Remove the wrong comment.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/ubifs/journal.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index 04c4ec6483e5..da8afdfccaa6 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -98,9 +98,8 @@ static inline void zero_trun_node_unused(struct ubifs_trun_node *trun)
  *
  * This function reserves space in journal head @head. If the reservation
  * succeeded, the journal head stays locked and later has to be unlocked using
- * 'release_head()'. 'write_node()' and 'write_head()' functions also unlock
- * it. Returns zero in case of success, %-EAGAIN if commit has to be done, and
- * other negative error codes in case of other failures.
+ * 'release_head()'. Returns zero in case of success, %-EAGAIN if commit has to
+ * be done, and other negative error codes in case of other failures.
  */
 static int reserve_space(struct ubifs_info *c, int jhead, int len)
 {
-- 
2.17.0

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

* [PATCH 3/6] ubifs: Spelling fix someting -> something
  2018-05-14  8:18 [PATCH 0/6] ubifs: Some simple fixes Sascha Hauer
  2018-05-14  8:18 ` [PATCH 1/6] ubifs: remove set but never used variable Sascha Hauer
  2018-05-14  8:18 ` [PATCH 2/6] ubifs: journal: Remove wrong comment Sascha Hauer
@ 2018-05-14  8:18 ` Sascha Hauer
  2018-05-14  8:18 ` [PATCH 4/6] ubifs: log: Some spelling fixes Sascha Hauer
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2018-05-14  8:18 UTC (permalink / raw)
  To: linux-mtd
  Cc: Artem Bityutskiy, Richard Weinberger, Adrian Hunter, Sascha Hauer

Replace "someting" with "something"

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/ubifs/replay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c
index f10a72a75ed7..85c2a43082b7 100644
--- a/fs/ubifs/replay.c
+++ b/fs/ubifs/replay.c
@@ -1034,7 +1034,7 @@ int ubifs_replay_journal(struct ubifs_info *c)
 			 * The head of the log must always start with the
 			 * "commit start" node on a properly formatted UBIFS.
 			 * But we found no nodes at all, which means that
-			 * someting went wrong and we cannot proceed mounting
+			 * something went wrong and we cannot proceed mounting
 			 * the file-system.
 			 */
 			ubifs_err(c, "no UBIFS nodes found at the log head LEB %d:%d, possibly corrupted",
-- 
2.17.0

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

* [PATCH 4/6] ubifs: log: Some spelling fixes
  2018-05-14  8:18 [PATCH 0/6] ubifs: Some simple fixes Sascha Hauer
                   ` (2 preceding siblings ...)
  2018-05-14  8:18 ` [PATCH 3/6] ubifs: Spelling fix someting -> something Sascha Hauer
@ 2018-05-14  8:18 ` Sascha Hauer
  2018-05-14  8:18 ` [PATCH 5/6] ubifs: gc: Fix typo Sascha Hauer
  2018-05-14  8:18 ` [PATCH 6/6] ubifs: lpt: Fix wrong pnode number range in comment Sascha Hauer
  5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2018-05-14  8:18 UTC (permalink / raw)
  To: linux-mtd
  Cc: Artem Bityutskiy, Richard Weinberger, Adrian Hunter, Sascha Hauer

- add missing article
- remove misplaced 'it'
- s/tress/trees

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/ubifs/log.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ubifs/log.c b/fs/ubifs/log.c
index 8c795e6392b1..7cffa120a750 100644
--- a/fs/ubifs/log.c
+++ b/fs/ubifs/log.c
@@ -167,10 +167,10 @@ void ubifs_add_bud(struct ubifs_info *c, struct ubifs_bud *bud)
  * @lnum: LEB number of the bud
  * @offs: starting offset of the bud
  *
- * This function writes reference node for the new bud LEB @lnum it to the log,
- * and adds it to the buds tress. It also makes sure that log size does not
+ * This function writes a reference node for the new bud LEB @lnum to the log,
+ * and adds it to the buds trees. It also makes sure that log size does not
  * exceed the 'c->max_bud_bytes' limit. Returns zero in case of success,
- * %-EAGAIN if commit is required, and a negative error codes in case of
+ * %-EAGAIN if commit is required, and a negative error code in case of
  * failure.
  */
 int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs)
-- 
2.17.0

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

* [PATCH 5/6] ubifs: gc: Fix typo
  2018-05-14  8:18 [PATCH 0/6] ubifs: Some simple fixes Sascha Hauer
                   ` (3 preceding siblings ...)
  2018-05-14  8:18 ` [PATCH 4/6] ubifs: log: Some spelling fixes Sascha Hauer
@ 2018-05-14  8:18 ` Sascha Hauer
  2018-05-14  8:18 ` [PATCH 6/6] ubifs: lpt: Fix wrong pnode number range in comment Sascha Hauer
  5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2018-05-14  8:18 UTC (permalink / raw)
  To: linux-mtd
  Cc: Artem Bityutskiy, Richard Weinberger, Adrian Hunter, Sascha Hauer

"point of view" makes more sense than "point of few". Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/ubifs/gc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
index 7b35e3d6cde7..a03a47cf880d 100644
--- a/fs/ubifs/gc.c
+++ b/fs/ubifs/gc.c
@@ -49,7 +49,7 @@
  * maximum size. So dark watermark is the amount of free + dirty space in LEB
  * which are guaranteed to be reclaimable. If LEB has less space, the GC might
  * be unable to reclaim it. So, LEBs with free + dirty greater than dark
- * watermark are "good" LEBs from GC's point of few. The other LEBs are not so
+ * watermark are "good" LEBs from GC's point of view. The other LEBs are not so
  * good, and GC takes extra care when moving them.
  */
 
-- 
2.17.0

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

* [PATCH 6/6] ubifs: lpt: Fix wrong pnode number range in comment
  2018-05-14  8:18 [PATCH 0/6] ubifs: Some simple fixes Sascha Hauer
                   ` (4 preceding siblings ...)
  2018-05-14  8:18 ` [PATCH 5/6] ubifs: gc: Fix typo Sascha Hauer
@ 2018-05-14  8:18 ` Sascha Hauer
  5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2018-05-14  8:18 UTC (permalink / raw)
  To: linux-mtd
  Cc: Artem Bityutskiy, Richard Weinberger, Adrian Hunter, Sascha Hauer

The comment above pnode_lookup claims the range for the pnode number is
from 0 to main_lebs - 1. This is wrong because every pnode has
informations about UBIFS_LPT_FANOUT LEBs, thus the corrent range is
0 to to (main_lebs - 1) / UBIFS_LPT_FANOUT.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/ubifs/lpt_commit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c
index 235654c2fe89..78da65b2fb85 100644
--- a/fs/ubifs/lpt_commit.c
+++ b/fs/ubifs/lpt_commit.c
@@ -619,7 +619,7 @@ static struct ubifs_pnode *next_pnode_to_dirty(struct ubifs_info *c,
 /**
  * pnode_lookup - lookup a pnode in the LPT.
  * @c: UBIFS file-system description object
- * @i: pnode number (0 to main_lebs - 1)
+ * @i: pnode number (0 to (main_lebs - 1) / UBIFS_LPT_FANOUT))
  *
  * This function returns a pointer to the pnode on success or a negative
  * error code on failure.
-- 
2.17.0

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

end of thread, other threads:[~2018-05-14  8:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14  8:18 [PATCH 0/6] ubifs: Some simple fixes Sascha Hauer
2018-05-14  8:18 ` [PATCH 1/6] ubifs: remove set but never used variable Sascha Hauer
2018-05-14  8:18 ` [PATCH 2/6] ubifs: journal: Remove wrong comment Sascha Hauer
2018-05-14  8:18 ` [PATCH 3/6] ubifs: Spelling fix someting -> something Sascha Hauer
2018-05-14  8:18 ` [PATCH 4/6] ubifs: log: Some spelling fixes Sascha Hauer
2018-05-14  8:18 ` [PATCH 5/6] ubifs: gc: Fix typo Sascha Hauer
2018-05-14  8:18 ` [PATCH 6/6] ubifs: lpt: Fix wrong pnode number range in comment Sascha Hauer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.