public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Export UBI map/unmap/is_mapped in userspace v2
@ 2009-01-07  9:22 Corentin Chary
  2009-01-07  9:25 ` [PATCH 1/3] UBI: map operation via ioctl Corentin Chary
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Corentin Chary @ 2009-01-07  9:22 UTC (permalink / raw)
  To: linux-mtd

Hi,x
These are three patch to make a usespace program able to use map/unmap 
operation and to query if a LEB is mapped.
We are trying to do an UBI based userspace filesystem (using fuse) and we 
needed these, but it could also be used for testing purpose.
CONFIG_MTD_UBI_DEBUG_USERSPACE_IO is needed to enable theses functions.

The patch can also be download here:
http://xf.iksaif.net/dev/uffs/linux/ubi/


Thanks

--
Corentin Chary
http://xf.iksaif.net

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH 2/3] UBI: unmap operation via ioctl
@ 2009-01-05 14:06 Corentin Chary
  0 siblings, 0 replies; 15+ messages in thread
From: Corentin Chary @ 2009-01-05 14:06 UTC (permalink / raw)
  To: linux-mtd

From: Corentin Chary <corentincj@iksaif.net>

UBI: unmap operation via ioctl

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
 drivers/mtd/ubi/cdev.c |   12 ++++++++++++
 include/mtd/ubi-user.h |    3 ++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index db47121..7a9080c 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -530,6 +530,18 @@ static int vol_cdev_ioctl(struct inode *inode,
struct file *file,
 		err = ubi_leb_map(desc, req.lnum, req.dtype);
 		break;
 	}
+	case UBI_IOUNMAP:
+	{
+		int32_t lnum;
+
+		err = get_user(lnum, (__user int32_t *)argp);
+		if (err) {
+			err = -EFAULT;
+			break;
+		}
+		err = ubi_leb_unmap(desc, lnum);
+		break;
+	}

 #endif

diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index 8222f12..bcff3a0 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -135,7 +135,8 @@
 #define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, int32_t)
 /* Map an eraseblock */
 #define UBI_IOMAP   _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req)
-
+/* Unmap an eraseblock */
+#define UBI_IOUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, int32_t)

 /* Maximum MTD device name length supported by UBI */
 #define MAX_UBI_MTD_NAME_LEN 127
-- 
1.6.0.6

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

end of thread, other threads:[~2009-01-20 17:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07  9:22 [PATCH 0/3] Export UBI map/unmap/is_mapped in userspace v2 Corentin Chary
2009-01-07  9:25 ` [PATCH 1/3] UBI: map operation via ioctl Corentin Chary
2009-01-07  9:27 ` [PATCH 2/3] UBI: unmap " Corentin Chary
2009-01-07  9:29 ` [PATCH 3/3] UBI: is_mapped " Corentin Chary
2009-01-07  9:32 ` [PATCH 0/3] Export UBI map/unmap/is_mapped in userspace v2 Artem Bityutskiy
2009-01-07  9:40   ` Corentin Chary
2009-01-07 12:15 ` Artem Bityutskiy
2009-01-07 13:40   ` Corentin Chary
2009-01-18 14:47 ` Artem Bityutskiy
2009-01-18 17:24   ` Corentin Chary
2009-01-19  9:38     ` Corentin Chary
2009-01-19 10:09       ` Artem Bityutskiy
2009-01-19 10:42         ` Artem Bityutskiy
2009-01-20 17:34           ` Corentin Chary
  -- strict thread matches above, loose matches on Subject: below --
2009-01-05 14:06 [PATCH 2/3] UBI: unmap operation via ioctl Corentin Chary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox