All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Benny Halevy <bhalevy@panasas.com>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	NFS list <linux-nfs@vger.kernel.org>
Subject: [PATCH 06/13] SQUASHME: pnfs-obj: Change API of objlayout_io_set_result
Date: Sat, 21 May 2011 13:31:40 +0300	[thread overview]
Message-ID: <1305973900-17388-1-git-send-email-bharrosh@panasas.com> (raw)
In-Reply-To: <4DD79273.9030202@panasas.com>

Remove the dependency of objlayout_io_set_result() on the existence of
a pnfs_osd_layout at the generic level, by passing the needed pnfs_osd_objid
in question directly. The io-driver has it at hand more readily. It also
decouples the error to be at the index of the original device and enables
a shorter io_err array with only the error devices.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfs/objlayout/objio_osd.c |    5 ++++-
 fs/nfs/objlayout/objlayout.c |    7 +++----
 fs/nfs/objlayout/objlayout.h |    4 ++--
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index 1e80f82..f3f7640 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -429,6 +429,7 @@ static int _io_check(struct objio_state *ios, bool is_write)
 	for (i = 0; i <  ios->numdevs; i++) {
 		struct osd_sense_info osi;
 		struct osd_request *or = ios->per_dev[i].or;
+		unsigned dev;
 		int ret;
 
 		if (!or)
@@ -449,7 +450,9 @@ static int _io_check(struct objio_state *ios, bool is_write)
 
 			continue; /* we recovered */
 		}
-		objlayout_io_set_result(&ios->ol_state, ios->per_dev[i].dev,
+		dev = ios->per_dev[i].dev;
+		objlayout_io_set_result(&ios->ol_state, dev,
+					&ios->layout->comps[dev].oc_object_id,
 					osd_pri_2_pnfs_err(osi.osd_err_pri),
 					ios->per_dev[i].offset,
 					ios->per_dev[i].length,
diff --git a/fs/nfs/objlayout/objlayout.c b/fs/nfs/objlayout/objlayout.c
index 1ab9bdc..c80f06c 100644
--- a/fs/nfs/objlayout/objlayout.c
+++ b/fs/nfs/objlayout/objlayout.c
@@ -292,15 +292,14 @@ objlayout_iodone(struct objlayout_io_state *state)
  */
 void
 objlayout_io_set_result(struct objlayout_io_state *state, unsigned index,
-			int osd_error, u64 offset, u64 length, bool is_write)
+			struct pnfs_osd_objid *pooid, int osd_error,
+			u64 offset, u64 length, bool is_write)
 {
 	struct pnfs_osd_ioerr *ioerr = &state->ioerrs[index];
 
 	BUG_ON(index >= state->num_comps);
 	if (osd_error) {
-		struct pnfs_osd_layout *layout = &state->objlseg->layout;
-
-		ioerr->oer_component = layout->olo_comps[index].oc_object_id;
+		ioerr->oer_component = *pooid;
 		ioerr->oer_comp_offset = offset;
 		ioerr->oer_comp_length = length;
 		ioerr->oer_iswrite = is_write;
diff --git a/fs/nfs/objlayout/objlayout.h b/fs/nfs/objlayout/objlayout.h
index 6ea54f6..01a3e4f 100644
--- a/fs/nfs/objlayout/objlayout.h
+++ b/fs/nfs/objlayout/objlayout.h
@@ -132,8 +132,8 @@ extern ssize_t objio_write_pagelist(struct objlayout_io_state *ol_state,
  * callback API
  */
 extern void objlayout_io_set_result(struct objlayout_io_state *state,
-				    unsigned index, int osd_error,
-				    u64 offset, u64 length, bool is_write);
+			unsigned index, struct pnfs_osd_objid *pooid,
+			int osd_error, u64 offset, u64 length, bool is_write);
 
 static inline void
 objlayout_add_delta_space_used(struct objlayout_io_state *state, s64 space_used)
-- 
1.7.2.3


  parent reply	other threads:[~2011-05-21 10:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-21 10:22 [PATCHSET 00/13] SQUASHME pnfs-obj: Lots of changes addressing comments by Trond and Benny Boaz Harrosh
2011-05-21 10:29 ` [PATCH 01/13] SQUASHME: re-reorder the functions so it compares better with raids base Boaz Harrosh
2011-05-21 11:06   ` pnfs-obj: git diff pnfs-all-2.6.38 to pnfs-submit. Without the reordering Boaz Harrosh
2011-05-21 10:30 ` [PATCH 02/13] SQUASHME: pnfs-obj: objio_segment only needs the pnfs_osd_layout->olo_comps Boaz Harrosh
2011-05-21 10:30 ` [PATCH 03/13] SQUASHME: pnfs-obj: Rename ios->objio_seg => ios->layout Boaz Harrosh
2011-05-21 10:31 ` [PATCH 05/13] SQUASHME: pnfs-obj: Convert layout and deviceinfo decoding to new XDR Boaz Harrosh
2011-05-21 10:31 ` Boaz Harrosh [this message]
2011-05-21 10:31 ` [PATCH 07/13] SQUASHME: pnfs-obj: Avoid double allocation logic in objlayout_alloc_lseg Boaz Harrosh
2011-05-21 10:32 ` [PATCH 08/13] SQUASHME: pnfs_osd_xdr: Remove Server API declarations Boaz Harrosh
2011-05-21 10:32 ` [PATCH 09/13] SQUASHME: pnfs_osd_xdr: Avoid using xdr_rewind_stream Boaz Harrosh
2011-05-21 10:33 ` [PATCH 10/13] [RFC] Bugs in new pnfs write path Boaz Harrosh
2011-05-22 18:08   ` Benny Halevy
2011-05-23  4:19     ` Boaz Harrosh
2011-05-23  4:26       ` Boaz Harrosh
2011-05-21 10:33 ` [PATCH 11/13] SQUASHME: pnfs_osd_xdr: Add Server API for encoding/decoding osd XDRs Boaz Harrosh
2011-05-21 10:34 ` [PATCH 12/13] SQUASHME: XDR API changes to pnfs_osd_xdr_decode_ioerr() Boaz Harrosh
2011-05-21 10:34 ` [PATCH 13/13] SQUASHME: dbg Print the full device_id returned Boaz Harrosh

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=1305973900-17388-1-git-send-email-bharrosh@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bhalevy@panasas.com \
    --cc=linux-nfs@vger.kernel.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 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.