linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: andros@netapp.com
To: iisaman@netapp.com
Cc: linux-nfs@vger.kernel.org,
	Andy Adamson <andros@fedora-2.andros.fake>,
	Andy Adamson <andros@netapp.com>
Subject: [PATCH 5/6] PYNFS: add mdsthreshold to file layout server
Date: Tue, 29 May 2012 17:57:58 -0400	[thread overview]
Message-ID: <1338328679-28837-6-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1338328679-28837-1-git-send-email-andros@netapp.com>

From: Andy Adamson <andros@fedora-2.andros.fake>

NOTE: values are hard coded and apply to all files. Edit nfs4server.py to
change the values.

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 nfs4.1/fs.py      |    9 ++++++++-
 nfs4.1/nfs4lib.py |    2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/nfs4.1/fs.py b/nfs4.1/fs.py
index 2d92d77..c0f18fa 100644
--- a/nfs4.1/fs.py
+++ b/nfs4.1/fs.py
@@ -1,6 +1,6 @@
 from nfs4state import FileState
 from nfs4_const import *
-from nfs4_type import fsid4, layout4, layout_content4, nfsv4_1_file_layout4
+from nfs4_type import fsid4, layout4, layout_content4, nfsv4_1_file_layout4, mdsthreshold4, threshold_item4
 import nfs4lib
 from nfs4lib import NFS4Error
 import struct
@@ -1429,6 +1429,13 @@ class FileLayoutFS(FileSystem):
         self.fattr4_maxread = 8192
         self.fattr4_supported_attrs |= 1 << FATTR4_MAXWRITE
         self.fattr4_supported_attrs |= 1 << FATTR4_MAXREAD
+        threshold_item4.thi_layout_type = LAYOUT4_NFSV4_1_FILES
+        # set mdsthreashold read_size, read_iosize and write_iosize
+        threshold_item4.thi_hintset = nfs4lib.list2bitmap([0, 2, 3])
+        threshold_item4.thi_hintlist = struct.pack('!QQQ',512,512,512)
+        mdsthreshold4.mth_hints = [threshold_item4]
+        self.fattr4_mdsthreshold = mdsthreshold4
+        self.fattr4_supported_attrs |= 1 << FATTR4_MDSTHRESHOLD
         self.sync(self.root, FILE_SYNC4)
 
     def attach_to_server(self, server):
diff --git a/nfs4.1/nfs4lib.py b/nfs4.1/nfs4lib.py
index 82045a7..a380cce 100644
--- a/nfs4.1/nfs4lib.py
+++ b/nfs4.1/nfs4lib.py
@@ -676,7 +676,7 @@ attr_info = { FATTR4_SUPPORTED_ATTRS : A("r", "fs"),
               FATTR4_LAYOUT_BLKSIZE : A("r", "fs"),
               FATTR4_LAYOUT_ALIGNMENT : A("r", "obj"),
               FATTR4_FS_LOCATIONS_INFO : A("r", "fs"),
-              FATTR4_MDSTHRESHOLD : A("r", "obj"),
+              FATTR4_MDSTHRESHOLD : A("r", "fs"),
               FATTR4_RETENTION_GET : A("r", "obj"),
               FATTR4_RETENTION_SET : A("w", "obj"),
               FATTR4_RETENTEVT_GET : A("r", "obj"),
-- 
1.7.7.6


  parent reply	other threads:[~2012-06-01 21:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29 21:57 [PATCH 0/6] PYNFS various patches andros
2012-05-29 21:57 ` [PATCH 1/6] PYNFS rpc drop fix andros
2012-05-29 21:57 ` [PATCH 2/6] PYNFS fix rpcgen andros
2012-05-29 21:57 ` [PATCH 3/6] PYNFS use loopback addresses for MDS<->DS communication andros
2012-06-01 21:57   ` Adamson, Dros
2012-05-29 21:57 ` [PATCH 4/6] PYNFS use requested iomode on layoutget andros
2012-05-29 21:57 ` andros [this message]
2012-05-29 21:57 ` [PATCH 6/6] PYNFS implement FREE_STATEID and TEST_STATEID operations andros

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=1338328679-28837-6-git-send-email-andros@netapp.com \
    --to=andros@netapp.com \
    --cc=andros@fedora-2.andros.fake \
    --cc=iisaman@netapp.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).