All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: linux-mtd@lists.infradead.org
Cc: tglx@linutronix.de, dedekind1@gmail.com,
	linux-kernel@vger.kernel.org, Heinz.Egger@linutronix.de,
	tim.bird@am.sony.com, Richard Weinberger <richard@nod.at>
Subject: [PATCH 2/7] [RFC] UBI: Export compare_lebs()
Date: Tue, 15 May 2012 19:11:06 +0200	[thread overview]
Message-ID: <1337101871-31181-3-git-send-email-richard@nod.at> (raw)
In-Reply-To: <1337101871-31181-1-git-send-email-richard@nod.at>

The fastmap mechanism needs this funtion,
rename it to ubi_compare_lebs() and export it.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/scan.c |    8 ++++----
 drivers/mtd/ubi/ubi.h  |    4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index c26b1ad..69be65f 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -295,7 +295,7 @@ static struct ubi_scan_volume *add_volume(struct ubi_scan_info *si, int vol_id,
 }
 
 /**
- * compare_lebs - find out which logical eraseblock is newer.
+ * ubi_compare_lebs - find out which logical eraseblock is newer.
  * @ubi: UBI device description object
  * @seb: first logical eraseblock to compare
  * @pnum: physical eraseblock number of the second logical eraseblock to
@@ -314,7 +314,7 @@ static struct ubi_scan_volume *add_volume(struct ubi_scan_info *si, int vol_id,
  *     o bit 2 is cleared: the older LEB is not corrupted;
  *     o bit 2 is set: the older LEB is corrupted.
  */
-static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
+int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
 			int pnum, const struct ubi_vid_hdr *vid_hdr)
 {
 	void *buf;
@@ -503,7 +503,7 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
 		 * sequence numbers. We still can attach these images, unless
 		 * there is a need to distinguish between old and new
 		 * eraseblocks, in which case we'll refuse the image in
-		 * 'compare_lebs()'. In other words, we attach old clean
+		 * 'ubi_compare_lebs()'. In other words, we attach old clean
 		 * images, but refuse attaching old images with duplicated
 		 * logical eraseblocks because there was an unclean reboot.
 		 */
@@ -519,7 +519,7 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
 		 * Now we have to drop the older one and preserve the newer
 		 * one.
 		 */
-		cmp_res = compare_lebs(ubi, seb, pnum, vid_hdr);
+		cmp_res = ubi_compare_lebs(ubi, seb, pnum, vid_hdr);
 		if (cmp_res < 0)
 			return cmp_res;
 
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 00c48f6..50c2af2 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -576,6 +576,10 @@ void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di);
 void ubi_do_get_volume_info(struct ubi_device *ubi, struct ubi_volume *vol,
 			    struct ubi_volume_info *vi);
 
+/* scan.c */
+int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
+		      int pnum, const struct ubi_vid_hdr *vid_hdr);
+
 /*
  * ubi_rb_for_each_entry - walk an RB-tree.
  * @rb: a pointer to type 'struct rb_node' to use as a loop counter
-- 
1.7.6.5


WARNING: multiple messages have this Message-ID (diff)
From: Richard Weinberger <richard@nod.at>
To: linux-mtd@lists.infradead.org
Cc: dedekind1@gmail.com, Richard Weinberger <richard@nod.at>,
	linux-kernel@vger.kernel.org, Heinz.Egger@linutronix.de,
	tim.bird@am.sony.com, tglx@linutronix.de
Subject: [PATCH 2/7] [RFC] UBI: Export compare_lebs()
Date: Tue, 15 May 2012 19:11:06 +0200	[thread overview]
Message-ID: <1337101871-31181-3-git-send-email-richard@nod.at> (raw)
In-Reply-To: <1337101871-31181-1-git-send-email-richard@nod.at>

The fastmap mechanism needs this funtion,
rename it to ubi_compare_lebs() and export it.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/scan.c |    8 ++++----
 drivers/mtd/ubi/ubi.h  |    4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index c26b1ad..69be65f 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -295,7 +295,7 @@ static struct ubi_scan_volume *add_volume(struct ubi_scan_info *si, int vol_id,
 }
 
 /**
- * compare_lebs - find out which logical eraseblock is newer.
+ * ubi_compare_lebs - find out which logical eraseblock is newer.
  * @ubi: UBI device description object
  * @seb: first logical eraseblock to compare
  * @pnum: physical eraseblock number of the second logical eraseblock to
@@ -314,7 +314,7 @@ static struct ubi_scan_volume *add_volume(struct ubi_scan_info *si, int vol_id,
  *     o bit 2 is cleared: the older LEB is not corrupted;
  *     o bit 2 is set: the older LEB is corrupted.
  */
-static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
+int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
 			int pnum, const struct ubi_vid_hdr *vid_hdr)
 {
 	void *buf;
@@ -503,7 +503,7 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
 		 * sequence numbers. We still can attach these images, unless
 		 * there is a need to distinguish between old and new
 		 * eraseblocks, in which case we'll refuse the image in
-		 * 'compare_lebs()'. In other words, we attach old clean
+		 * 'ubi_compare_lebs()'. In other words, we attach old clean
 		 * images, but refuse attaching old images with duplicated
 		 * logical eraseblocks because there was an unclean reboot.
 		 */
@@ -519,7 +519,7 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
 		 * Now we have to drop the older one and preserve the newer
 		 * one.
 		 */
-		cmp_res = compare_lebs(ubi, seb, pnum, vid_hdr);
+		cmp_res = ubi_compare_lebs(ubi, seb, pnum, vid_hdr);
 		if (cmp_res < 0)
 			return cmp_res;
 
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 00c48f6..50c2af2 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -576,6 +576,10 @@ void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di);
 void ubi_do_get_volume_info(struct ubi_device *ubi, struct ubi_volume *vol,
 			    struct ubi_volume_info *vi);
 
+/* scan.c */
+int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
+		      int pnum, const struct ubi_vid_hdr *vid_hdr);
+
 /*
  * ubi_rb_for_each_entry - walk an RB-tree.
  * @rb: a pointer to type 'struct rb_node' to use as a loop counter
-- 
1.7.6.5

  parent reply	other threads:[~2012-05-15 17:12 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15 17:11 [RFC v4] UBI: Fastmap support (aka checkpointing) Richard Weinberger
2012-05-15 17:11 ` Richard Weinberger
2012-05-15 17:11 ` [PATCH 1/7] [RFC] UBI: Export next_sqnum() Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-16 13:01   ` Artem Bityutskiy
2012-05-16 13:01     ` Artem Bityutskiy
2012-05-21 13:34     ` Richard Weinberger
2012-05-21 13:34       ` Richard Weinberger
2012-05-21 14:00       ` Artem Bityutskiy
2012-05-21 14:00         ` Artem Bityutskiy
2012-05-21 14:16         ` Richard Weinberger
2012-05-21 14:16           ` Richard Weinberger
2012-05-22  8:23           ` Artem Bityutskiy
2012-05-22  8:23             ` Artem Bityutskiy
2012-05-22 10:58       ` Artem Bityutskiy
2012-05-22 10:58         ` Artem Bityutskiy
2012-05-16 14:03   ` Shmulik Ladkani
2012-05-16 14:03     ` Shmulik Ladkani
2012-05-16 14:27     ` Artem Bityutskiy
2012-05-16 14:27       ` Artem Bityutskiy
2012-05-17  9:45       ` Shmulik Ladkani
2012-05-17  9:45         ` Shmulik Ladkani
2012-05-17 11:44         ` Artem Bityutskiy
2012-05-17 11:44           ` Artem Bityutskiy
2012-05-17 11:47           ` Richard Weinberger
2012-05-17 11:47             ` Richard Weinberger
2012-05-17 12:34             ` Artem Bityutskiy
2012-05-17 12:34               ` Artem Bityutskiy
2012-05-15 17:11 ` Richard Weinberger [this message]
2012-05-15 17:11   ` [PATCH 2/7] [RFC] UBI: Export compare_lebs() Richard Weinberger
2012-05-16 14:09   ` Shmulik Ladkani
2012-05-16 14:09     ` Shmulik Ladkani
2012-05-15 17:11 ` [PATCH 3/7] [RFC] UBI: Add fastmap on-flash layout Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-15 17:11 ` [PATCH 4/7] [RFC] UBI: Add fastmap structs to ubi_device Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-15 17:11 ` [PATCH 5/7] [RFC] UBI: Make wl subsystem fastmap aware Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-15 17:11 ` [PATCH 6/7] [RFC] UBI: Implement fastmapping support Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-15 17:11 ` [PATCH 7/7] [RFC] UBI: Wire up fastmap support Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-15 17:48 ` [RFC v4] UBI: Fastmap support (aka checkpointing) Subodh Nijsure
2012-05-15 17:48   ` Subodh Nijsure
2012-05-15 18:10   ` Richard Weinberger
2012-05-15 18:10     ` Richard Weinberger
2012-05-15 18:02 ` Richard Weinberger
2012-05-15 18:02   ` Richard Weinberger
2012-05-15 19:46 ` Shmulik Ladkani
2012-05-15 19:46   ` Shmulik Ladkani
2012-05-16  6:54   ` Fastmap - please, review and test Artem Bityutskiy
2012-05-16  6:54     ` Artem Bityutskiy
2012-05-16 11:51     ` Richard Weinberger
2012-05-16 11:51       ` Richard Weinberger
2012-05-16  9:38 ` [RFC v4] UBI: Fastmap support (aka checkpointing) Artem Bityutskiy
2012-05-16  9:38   ` Artem Bityutskiy
2012-05-16  9:42   ` Artem Bityutskiy
2012-05-16  9:42     ` Artem Bityutskiy
2012-05-16 10:50   ` Richard Weinberger
2012-05-16 10:50     ` Richard Weinberger
2012-05-16 11:09     ` Artem Bityutskiy
2012-05-16 11:09       ` Artem Bityutskiy
2012-05-16 11:18       ` Artem Bityutskiy
2012-05-16 11:18         ` Artem Bityutskiy
2012-05-16 11:29         ` Richard Weinberger
2012-05-16 11:29           ` Richard Weinberger
2012-05-16 20:51 [RFC v5] " Richard Weinberger
2012-05-16 20:51 ` [PATCH 2/7] [RFC] UBI: Export compare_lebs() Richard Weinberger
2012-05-16 20:51   ` Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337101871-31181-3-git-send-email-richard@nod.at \
    --to=richard@nod.at \
    --cc=Heinz.Egger@linutronix.de \
    --cc=dedekind1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tim.bird@am.sony.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.