public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Corentin Chary <corentincj@iksaif.net>
To: linux-mtd@lists.infradead.org
Subject: [PATCH 2/3] UBI: unmap operation via ioctl
Date: Wed, 7 Jan 2009 10:27:14 +0100	[thread overview]
Message-ID: <200901071027.14992.corentincj@iksaif.net> (raw)
In-Reply-To: <200901071022.46343.corentincj@iksaif.net>

From 4c15079a77b4a871fc96f2267222626a7e91b86a Mon Sep 17 00:00:00 2001
From: Corentin Chary <corentincj@iksaif.net>
Date: Mon, 5 Jan 2009 14:46:19 +0100

[PATCH 2/3] 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


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

  parent reply	other threads:[~2009-01-07  9:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Corentin Chary [this message]
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

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=200901071027.14992.corentincj@iksaif.net \
    --to=corentincj@iksaif.net \
    --cc=linux-mtd@lists.infradead.org \
    /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