From: Alexandros Batsakis <batsakis@netapp.com>
To: linux-nfs@vger.kernel.org
Cc: bhalevy@panasas.com, Alexandros Batsakis <batsakis@netapp.com>
Subject: [PATCH 5/8] pnfs-submit: request whole file layouts only
Date: Wed, 5 May 2010 10:00:55 -0700 [thread overview]
Message-ID: <1273078858-1923-6-git-send-email-batsakis@netapp.com> (raw)
In-Reply-To: <1273078858-1923-5-git-send-email-batsakis@netapp.com>
In the first iteration of the pNFS code, we support only whole file layouts.
To facilitate the move to multiple-segments, we keep the segment processing
code, but the segment list should always contain at most one segment per I/O type
Signed-off-by: Alexandros Batsakis <batsakis@netapp.com>
---
fs/nfs/callback_proc.c | 7 ++++---
fs/nfs/pnfs.c | 25 ++++++++-----------------
2 files changed, 12 insertions(+), 20 deletions(-)
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index dcf3747..acd72b7 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -213,6 +213,10 @@ static int pnfs_recall_layout(void *data)
then return layouts, resume after layoutreturns complete
*/
+ /* support whole file layouts only */
+ rl.cbl_seg.offset = 0;
+ rl.cbl_seg.length = NFS4_MAX_UINT64;
+
if (rl.cbl_recall_type == RETURN_FILE) {
status = pnfs_return_layout(inode, &rl.cbl_seg, &rl.cbl_stateid,
RETURN_FILE, true);
@@ -221,9 +225,6 @@ static int pnfs_recall_layout(void *data)
goto out;
}
- rl.cbl_seg.offset = 0;
- rl.cbl_seg.length = NFS4_MAX_UINT64;
-
/* FIXME: This loop is inefficient, running in O(|s_inodes|^2) */
while ((ino = nfs_layoutrecall_find_inode(clp, &rl)) != NULL) {
/* XXX need to check status on pnfs_return_layout */
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 7189173..52879f6 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -552,12 +552,6 @@ pnfs_layout_from_open_stateid(nfs4_stateid *dst, struct nfs4_state *state)
* for now, assume that whole file layouts are requested.
* arg->offset: 0
* arg->length: all ones
-*
-* for now, assume the LAYOUTGET operation is triggered by an I/O request.
-* the count field is the count in the I/O request, and will be used
-* as the minlength. for the file operation that piggy-backs
-* the LAYOUTGET operation with an OPEN, s
-* arg->minlength = count.
*/
static int
get_layout(struct inode *ino,
@@ -578,11 +572,11 @@ get_layout(struct inode *ino,
return -ENOMEM;
}
lgp->lo = lo;
- lgp->args.minlength = PAGE_CACHE_SIZE;
+ lgp->args.minlength = NFS4_MAX_UINT64;
lgp->args.maxcount = PNFS_LAYOUT_MAXSIZE;
lgp->args.lseg.iomode = range->iomode;
- lgp->args.lseg.offset = range->offset;
- lgp->args.lseg.length = max(range->length, lgp->args.minlength);
+ lgp->args.lseg.offset = 0;
+ lgp->args.lseg.length = NFS4_MAX_UINT64;
lgp->args.type = server->pnfs_curr_ld->id;
lgp->args.inode = ino;
lgp->lsegpp = lsegpp;
@@ -757,7 +751,7 @@ _pnfs_return_layout(struct inode *ino, struct nfs4_pnfs_layout_segment *range,
else {
arg.iomode = IOMODE_ANY;
arg.offset = 0;
- arg.length = ~0;
+ arg.length = NFS4_MAX_UINT64;
}
if (type == RETURN_FILE) {
lo = get_lock_current_layout(nfsi);
@@ -1076,8 +1070,8 @@ pnfs_update_layout(struct inode *ino,
{
struct nfs4_pnfs_layout_segment arg = {
.iomode = iomode,
- .offset = pos,
- .length = count
+ .offset = 0,
+ .length = ~0
};
struct nfs_inode *nfsi = NFS_I(ino);
struct pnfs_layout_type *lo;
@@ -1167,7 +1161,6 @@ out_put:
void
pnfs_get_layout_done(struct nfs4_pnfs_layoutget *lgp, int rpc_status)
{
- struct nfs4_pnfs_layoutget_res *res = &lgp->res;
struct pnfs_layout_segment *lseg = NULL;
struct nfs_inode *nfsi = PNFS_NFS_INODE(lgp->lo);
time_t suspend = 0;
@@ -1176,11 +1169,10 @@ pnfs_get_layout_done(struct nfs4_pnfs_layoutget *lgp, int rpc_status)
lgp->status = rpc_status;
if (likely(!rpc_status)) {
- if (unlikely(res->layout.len <= 0)) {
+ if (unlikely(lgp->res.layout.len < 0)) {
printk(KERN_ERR
- "%s: ERROR! Layout size is ZERO!\n", __func__);
+ "%s: ERROR Returned layout size is ZERO\n", __func__);
lgp->status = -EIO;
- goto get_out;
}
goto out;
}
@@ -1258,7 +1250,6 @@ pnfs_get_layout_done(struct nfs4_pnfs_layoutget *lgp, int rpc_status)
break;
}
-get_out:
/* remember that get layout failed and suspend trying */
nfsi->layout.pnfs_layout_suspend = suspend;
set_bit(lo_fail_bit(lgp->args.lseg.iomode),
--
1.6.2.5
next prev parent reply other threads:[~2010-06-07 5:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-05 17:00 [PATCH 0/8] pnfs-submit: forgetful client v2 Alexandros Batsakis
2010-05-05 17:00 ` [PATCH 1/8] pnfs-submit: clean struct nfs_inode Alexandros Batsakis
2010-05-05 17:00 ` [PATCH 2/8] pnfs-submit: clean locking infrastructure Alexandros Batsakis
2010-05-05 17:00 ` [PATCH 3/8] pnfs-submit: remove lgetcount, lretcount (outstanding LAYOUTGETs/LAYOUTRETUNs) Alexandros Batsakis
2010-05-05 17:00 ` [PATCH 4/8] pnfs-submit: change stateid to be a union Alexandros Batsakis
2010-05-05 17:00 ` Alexandros Batsakis [this message]
2010-05-05 17:00 ` [PATCH 6/8] pnfs-submit: change layouts list to be similar to the other state list management Alexandros Batsakis
2010-05-05 17:00 ` [PATCH 7/8] pnfs-submit: forgetful client model Alexandros Batsakis
2010-05-05 17:00 ` [PATCH 8/8] pnfs-submit: support for cb_recall_any (layouts) Alexandros Batsakis
2010-06-07 14:34 ` [PATCH 2/8] pnfs-submit: clean locking infrastructure Fred Isaman
2010-06-07 8:52 ` [PATCH 0/8] pnfs-submit: forgetful client v2 Boaz Harrosh
2010-06-07 8:54 ` Boaz Harrosh
2010-06-07 15:38 ` Alexandros Batsakis
-- strict thread matches above, loose matches on Subject: below --
2010-05-17 17:56 [PATCH 0/8] pnfs-submit: Forgetful cleint and some layout cleanups Alexandros Batsakis
2010-05-17 17:56 ` [PATCH 1/8] pnfs-submit: clean struct nfs_inode Alexandros Batsakis
2010-05-17 17:56 ` [PATCH 2/8] pnfs-submit: clean locking infrastructure Alexandros Batsakis
2010-05-17 17:56 ` [PATCH 3/8] pnfs-submit: remove lgetcount, lretcount (outstanding LAYOUTGETs/LAYOUTRETUNs) Alexandros Batsakis
2010-05-17 17:56 ` [PATCH 4/8] pnfs-submit: change stateid to be a union Alexandros Batsakis
2010-05-17 17:56 ` [PATCH 5/8] pnfs-submit: request whole file layouts only Alexandros Batsakis
2010-05-26 8:42 ` Benny Halevy
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=1273078858-1923-6-git-send-email-batsakis@netapp.com \
--to=batsakis@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).