From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Artem Bityutskiy <dedekind1@gmail.com>,
Richard Weinberger <richard@nod.at>
Cc: David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Boris Brezillon <boris.brezillon@free-electrons.com>
Subject: [PATCH 1/6] UBI: dissociate the on-flash format version and the userspace ABI version
Date: Mon, 5 Sep 2016 17:31:22 +0200 [thread overview]
Message-ID: <1473089487-29285-2-git-send-email-boris.brezillon@free-electrons.com> (raw)
In-Reply-To: <1473089487-29285-1-git-send-email-boris.brezillon@free-electrons.com>
All user-space tools are currently testing the /sys/class/ubi/version value
to make sure they can interact with the in-kernel layer.
They actually don't care about the on-flash format version since this field
is attached to the UBI subsystem and not to each UBI device instance
(theoretically, each instance could have it's own on-flash format version).
All they care about is whether they are able to use the ioctl they know
about.
Create a new UBI_ABI_VERSION to expose the the ABI version instead of
using the UBI_VERSION value which is about to be increased to support
MLC devices.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
drivers/mtd/ubi/build.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 45ea1ddebc5c..914fcf07b573 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -103,11 +103,13 @@ DEFINE_MUTEX(ubi_devices_mutex);
/* Protects @ubi_devices and @ubi->ref_count */
static DEFINE_SPINLOCK(ubi_devices_lock);
+#define UBI_ABI_VERSION 1
+
/* "Show" method for files in '/<sysfs>/class/ubi/' */
static ssize_t ubi_version_show(struct class *class,
struct class_attribute *attr, char *buf)
{
- return sprintf(buf, "%d\n", UBI_VERSION);
+ return sprintf(buf, "%d\n", UBI_ABI_VERSION);
}
/* UBI version attribute ('/<sysfs>/class/ubi/version') */
@@ -1490,7 +1492,7 @@ MODULE_PARM_DESC(fm_autoconvert, "Set this parameter to enable fastmap automatic
module_param(fm_debug, bool, 0);
MODULE_PARM_DESC(fm_debug, "Set this parameter to enable fastmap debugging by default. Warning, this will make fastmap slow!");
#endif
-MODULE_VERSION(__stringify(UBI_VERSION));
+MODULE_VERSION(__stringify(UBI_ABI_VERSION));
MODULE_DESCRIPTION("UBI - Unsorted Block Images");
MODULE_AUTHOR("Artem Bityutskiy");
MODULE_LICENSE("GPL");
--
2.7.4
next prev parent reply other threads:[~2016-09-05 15:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-05 15:31 [PATCH 0/6] UBI: add support for 'SLC mode' volumes Boris Brezillon
2016-09-05 15:31 ` Boris Brezillon [this message]
2016-09-05 15:31 ` [PATCH 2/6] UBI: rework the on-flash format versioning logic Boris Brezillon
2016-09-05 15:31 ` [PATCH 3/6] UBI: use vol->usable_leb_size instead of (ubi->leb_size - vol->data_pad) Boris Brezillon
2016-09-05 17:42 ` Boris Brezillon
2016-09-05 15:31 ` [PATCH 4/6] UBI: introduce per-volume leb_size Boris Brezillon
2016-09-05 15:31 ` [PATCH 5/6] UBI: io: support SLC mode accesses Boris Brezillon
2016-09-05 15:31 ` [PATCH 6/6] UBI: add SLC mode support Boris Brezillon
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=1473089487-29285-2-git-send-email-boris.brezillon@free-electrons.com \
--to=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox