public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	open-osd mailing-list <osd-dev@open-osd.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [osd-dev] [PATCH] open-osd: osdblk User Mode utility
Date: Mon, 22 Jun 2009 15:15:39 +0300	[thread overview]
Message-ID: <4A3F75EB.7090107@panasas.com> (raw)
In-Reply-To: <4A3A393F.4010101@panasas.com>

On 06/18/2009 03:55 PM, Boaz Harrosh wrote:
> A minimal user-mode application to Create / Remove / Resize
> OSD objects from a device, for use with the osdblk.ko block
> device driver.
> 
> See inside patch for Usage instructions.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---

This version had a bug which, if the partition did not exist
it would fail to create the object.

I have squashed the below patch into this one, on the open-osd
git tree

---
Subject: [PATCH] {SQUASHME} open-osd: usr/osdblk: Need to also create the partition

A fall out of the usr/osdblk application

Boaz
---
 usr/osdblk.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/usr/osdblk.c b/usr/osdblk.c
index f7df257..b9982c0 100644
--- a/usr/osdblk.c
+++ b/usr/osdblk.c
@@ -74,7 +74,7 @@ static void usage(void)
 	"       pid_no is the partition 64bit number of the object in question\n"
 	"       Both 0xabc hex or decimal anotation can be used\n"
 	"\n"
-	"--obj=obj_no | -o obj_no\n"
+	"--oid=obj_no | -o obj_no\n"
 	"       obj_no is the object 64bit number of the object in question\n"
 	"       Both 0xabc hex or decimal anotation can be used\n"
 	"\n"
@@ -198,6 +198,19 @@ static int do_create(struct osd_dev *od, struct osd_obj_id *obj, u64 size)
 		return -ENOMEM;
 
 	osdblk_make_credential(creds, obj, osd_req_is_ver1(or));
+
+	/* Create partition OK to fail (all ready exist) */
+	osd_req_create_partition(or, obj->partition);
+	ret = osdblk_exec(or, creds);
+	osd_end_request(or);
+
+	if (ret)
+		OSDBLK_INFO("pid=0x%llx exists\n", _LLU(obj->partition));
+
+	or = osd_start_request(od, GFP_KERNEL);
+	if (unlikely(!or))
+		return -ENOMEM;
+
 	osd_req_create_object(or, obj);
 	ret = osdblk_exec(or, creds);
 	osd_end_request(or);
@@ -280,7 +293,7 @@ int main(int argc, char *argv[])
 		{.name = "resize", .has_arg = 0, .flag = NULL, .val = 's'} ,
 		{.name = "pid", .has_arg = 1, .flag = NULL, .val =  'p'} ,
 		{.name = "oid", .has_arg = 1, .flag = NULL, .val =  'o'} ,
-		{.name = "size", .has_arg = 1, .flag = NULL, .val = 'l'} ,
+		{.name = "length", .has_arg = 1, .flag = NULL, .val = 'l'} ,
 
 		{.name = 0, .has_arg = 0, .flag = 0, .val = 0} ,
 	};
-- 
1.6.2.1


  reply	other threads:[~2009-06-22 12:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-17 16:01 [PATCHSET 0/6] exofs: few patches for Linux 2.6.31 Boaz Harrosh
2009-06-17 16:03 ` [PATCH 1/6] exofs: Fix bio leak in error handling path (sync read) Boaz Harrosh
2009-06-17 16:04 ` [PATCH 2/6] exofs: Remove IBM copyrights Boaz Harrosh
2009-06-17 16:05 ` [PATCH 3/6] exofs: Avoid using file_fsync() Boaz Harrosh
2009-06-17 16:06 ` [PATCH 4/6] MAINTAINERS: Add osd maintained files (F:) Boaz Harrosh
2009-06-17 16:07 ` [PATCH 5/6] osdblk: a Linux block device for OSD objects Boaz Harrosh
2009-06-17 16:07 ` [PATCH 6/6] osdblk: Adjust queue limits to lower device's limits Boaz Harrosh
2009-06-18 12:46 ` [osd-dev] [PATCHSET 0/6] exofs: few patches for Linux 2.6.31 Boaz Harrosh
2009-06-18 12:55   ` [PATCH] open-osd: osdblk User Mode utility Boaz Harrosh
2009-06-22 12:15     ` Boaz Harrosh [this message]
2009-06-18 15:31   ` [osd-dev] [PATCHSET 0/6] exofs: few patches for Linux 2.6.31 Jeff Garzik

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=4A3F75EB.7090107@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=jeff@garzik.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osd-dev@open-osd.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