Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1448318 > unrolled thread

[PATCH 00/58] staging: lustre: bug fixes from lustre 2.5.[56-58]

Started byJames Simmons <jsimmons@infradead.org>
First post2016-07-22 05:00 +0200
Last post2016-07-22 06:20 +0200
Articles 20 on this page of 56 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/58] staging: lustre: bug fixes from lustre 2.5.[56-58] James Simmons <jsimmons@infradead.org> - 2016-07-22 05:00 +0200
    [PATCH 07/58] staging: lustre: llite: label the debug info James Simmons <jsimmons@infradead.org> - 2016-07-22 05:00 +0200
    [PATCH 02/58] staging: lustre: obd: rename struct lmv_stripe_md field mea to lmv James Simmons <jsimmons@infradead.org> - 2016-07-22 05:00 +0200
    [PATCH 05/58] staging: lustre: lmv: add new lmv structures James Simmons <jsimmons@infradead.org> - 2016-07-22 05:00 +0200
    [PATCH 10/58] staging: lustre: llite: reduce indent in ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200
    [PATCH 06/58] staging: lustre: mdc: handle IT_READDIR operations James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200
    [PATCH 08/58] staging: lustre: llite: pass struct md_op_data to ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200
    [PATCH 03/58] staging: lustre: ptlrpc: remove wirecheck for struct lmv_stripe_md James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200
    [PATCH 15/58] staging: lustre: llite: clarify some debug messages for statahead James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200
    [PATCH 04/58] staging: lustre: llite: cache directory striping information James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200
    [PATCH 14/58] staging: lustre: llite: rename some variables for ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200
    [PATCH 16/58] staging: lustre: llite: remove code never called James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200
    [PATCH 23/58] staging: lustre: llite: change remove parameter to bool James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200
    [PATCH 24/58] staging: lustre: mdc: don't take rpc lock for readdir case James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200
    [PATCH 17/58] staging: lustre: llite: pass in __u64 pos for ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200
    [PATCH 21/58] staging: lustre: llite: style cleanup for llite_internal.h James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200
    [PATCH 11/58] staging: lustre: llite: set next only when needed in ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200
    [PATCH 13/58] staging: lustre: llite: change done flag in ll_dir_read to bool James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200
    [PATCH 25/58] staging: lustre: lmv: remove unused lmv_get_mea function James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200
    [PATCH 20/58] staging: lustre: llite: remove comment from ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200
    [PATCH 19/58] staging: lustre: llite: add md_op_data parameter to ll_get_dir_page James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200
    [PATCH 26/58] staging: lustre: lmv: remove duplicate MAX_HASH_* James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200
    [PATCH 22/58] staging: lustre: llite: pass inode to ll_release_page James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200
    [PATCH 12/58] staging: lustre: llite: handle done flags differently in ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200
    [PATCH 28/58] staging: lustre: lmv: remove lmv_get_easize James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200
    [PATCH 27/58] staging: lustre: lmv: change handling of lmv striping information James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200
    [PATCH 18/58] staging: lustre: llite: do post work for statahead in readdir case James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200
    [PATCH 36/58] staging: lustre: lmv: fix issue found by Klocwork Insight tool James Simmons <jsimmons@infradead.org> - 2016-07-22 05:40 +0200
    [PATCH 29/58] staging: lustre: lmv: replace obd_free_memmd with lmv_free_memmd James Simmons <jsimmons@infradead.org> - 2016-07-22 05:40 +0200
    [PATCH 34/58] staging: lustre: obdclass: bug fixes for lu_device_type handling James Simmons <jsimmons@infradead.org> - 2016-07-22 05:40 +0200
    [PATCH 31/58] staging: lustre: llite: fix "getdirstripe" to show stripe info James Simmons <jsimmons@infradead.org> - 2016-07-22 05:40 +0200
    [PATCH 32/58] staging: lustre: delete striped directory James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200
    [PATCH 33/58] staging: lustre: obdclass: fix lmd_parse() to handle comma-separated NIDs James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200
    [PATCH 41/58] staging: lustre: mdc: fixup MDS_SWAP_LAYOUTS ELC handling James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200
    [PATCH 38/58] staging: lustre: llite: enable clients to inject error for lfsck James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200
    [PATCH 43/58] staging: lustre: const correct FID/OSTID/... helpers James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200
    [PATCH 40/58] staging: lustre: llite: a few fixes for migration. James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200
    [PATCH 35/58] staging: lustre: add ability to migrate inodes. James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200
    [PATCH 39/58] staging: lustre: osc: allow to call brw_commit() multiple times James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200
    [PATCH 50/58] staging: lustre: lov: handle the case of stripe size is not power 2 James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200
    [PATCH 37/58] staging: lustre: libcfs: Only dump log once per sec. to avoid EEXIST James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200
    [PATCH 49/58] staging: lustre: llite: avoid a deadlock in page write James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200
    [PATCH 46/58] staging: lustre: lmv: access lum_stripe_offset as little endian James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200
    [PATCH 44/58] staging: lustre: use bool for several function in lustre_idl.h/lustre_fid.h James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200
    [PATCH 42/58] staging: lustre: don't need to const __u64 parameters for lustre_idl.h James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200
    [PATCH 45/58] staging: lustre: simplify inline functions in lustre_fid.h James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200
    [PATCH 55/58] staging: lustre: ldlm: flock completion fixes. James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200
    [PATCH 47/58] staging: lustre: lmv: lookup remote migrating object in LMV James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200
    [PATCH 52/58] staging: lustre: lmv: rename request to preq in lmv_getattr_name() James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200
    [PATCH 51/58] staging: lustre: lmv: cleanup req in lmv_getattr_name() James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200
    [PATCH 48/58] staging: lustre: lmv: Ensure lmv_intent_lookup cleans up reqp James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200
    [PATCH 53/58] staging: lustre: obdclass: unified flow control interfaces James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200
    [PATCH 57/58] staging: lustre: llite: add error handler in inode prepare phase James Simmons <jsimmons@infradead.org> - 2016-07-22 06:20 +0200
    [PATCH 58/58] staging: lustre: ptlrpc: Early replies need to honor at_max James Simmons <jsimmons@infradead.org> - 2016-07-22 06:20 +0200
    [PATCH 54/58] staging: lustre: reorder LOV_MAGIC_* definition James Simmons <jsimmons@infradead.org> - 2016-07-22 06:20 +0200
    [PATCH 56/58] staging: lustre: move ioctls to lustre_ioctl.h James Simmons <jsimmons@infradead.org> - 2016-07-22 06:20 +0200

Page 1 of 3  [1] 2 3  Next page →


#1448318 — [PATCH 00/58] staging: lustre: bug fixes from lustre 2.5.[56-58]

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:00 +0200
Subject[PATCH 00/58] staging: lustre: bug fixes from lustre 2.5.[56-58]
Message-ID<rXyQV-88M-3@gated-at.bofh.it>
Here is the next batch of fixes and cleanups that went into
Lustre from versions 2.5.56 up to 2.5.58. Besides those changes
the patches for LU-3531/LU-4906 were broken into several smaller
patches as required for the staging tree. The rest of the patches
here are minor fixes and some removal of dead or obsolete code.

Chris Horn (1):
  staging: lustre: ptlrpc: Early replies need to honor at_max

Dmitry Eremin (1):
  staging: lustre: lmv: fix issue found by Klocwork Insight tool

Fan Yong (4):
  staging: lustre: obdclass: bug fixes for lu_device_type handling
  staging: lustre: llite: enable clients to inject error for lfsck
  staging: lustre: obdclass: unified flow control interfaces
  staging: lustre: reorder LOV_MAGIC_* definition

Jian Yu (1):
  staging: lustre: obdclass: fix lmd_parse() to handle comma-separated
    NIDs

Jinshan Xiong (3):
  staging: lustre: osc: allow to call brw_commit() multiple times
  staging: lustre: llite: avoid a deadlock in page write
  staging: lustre: lov: handle the case of stripe size is not power 2

John L. Hammond (9):
  staging: lustre: mdc: fixup MDS_SWAP_LAYOUTS ELC handling
  staging: lustre: don't need to const __u64 parameters for
    lustre_idl.h
  staging: lustre: const correct FID/OSTID/... helpers
  staging: lustre: use bool for several function in
    lustre_idl.h/lustre_fid.h
  staging: lustre: simplify inline functions in lustre_fid.h
  staging: lustre: lmv: access lum_stripe_offset as little endian
  staging: lustre: lmv: cleanup req in lmv_getattr_name()
  staging: lustre: lmv: rename request to preq in lmv_getattr_name()
  staging: lustre: move ioctls to lustre_ioctl.h

Nathaniel Clark (1):
  staging: lustre: lmv: Ensure lmv_intent_lookup cleans up reqp

Ryan Haasken (1):
  staging: lustre: libcfs: Only dump log once per sec. to avoid EEXIST

Vitaly Fertman (1):
  staging: lustre: ldlm: flock completion fixes.

wang di (36):
  staging: lustre: obd: expand op_cli_flags
  staging: lustre: obd: rename struct lmv_stripe_md field mea to lmv
  staging: lustre: ptlrpc: remove wirecheck for struct lmv_stripe_md
  staging: lustre: llite: cache directory striping information
  staging: lustre: lmv: add new lmv structures
  staging: lustre: mdc: handle IT_READDIR operations
  staging: lustre: llite: label the debug info
  staging: lustre: llite: pass struct md_op_data to ll_dir_read
  staging: lustre: llite: remove debug message in ll_dir_read
  staging: lustre: llite: reduce indent in ll_dir_read
  staging: lustre: llite: set next only when needed in ll_dir_read
  staging: lustre: llite: handle done flags differently in ll_dir_read
  staging: lustre: llite: change done flag in ll_dir_read to bool
  staging: lustre: llite: rename some variables for ll_dir_read
  staging: lustre: llite: clarify some debug messages for statahead
  staging: lustre: llite: remove code never called
  staging: lustre: llite: pass in __u64 pos for ll_dir_read
  staging: lustre: llite: do post work for statahead in readdir case
  staging: lustre: llite: add md_op_data parameter to ll_get_dir_page
  staging: lustre: llite: remove comment from ll_dir_read
  staging: lustre: llite: style cleanup for llite_internal.h
  staging: lustre: llite: pass inode to ll_release_page
  staging: lustre: llite: change remove parameter to bool
  staging: lustre: mdc: don't take rpc lock for readdir case
  staging: lustre: lmv: remove unused lmv_get_mea function
  staging: lustre: lmv: remove duplicate MAX_HASH_*
  staging: lustre: lmv: change handling of lmv striping information
  staging: lustre: lmv: remove lmv_get_easize
  staging: lustre: lmv: replace obd_free_memmd with lmv_free_memmd
  staging: lustre: create striped directory
  staging: lustre: llite: fix "getdirstripe" to show stripe info
  staging: lustre: delete striped directory
  staging: lustre: add ability to migrate inodes.
  staging: lustre: llite: a few fixes for migration.
  staging: lustre: lmv: lookup remote migrating object in LMV
  staging: lustre: llite: add error handler in inode prepare phase

 .../lustre/include/linux/libcfs/libcfs_fail.h      |    3 +
 drivers/staging/lustre/lnet/libcfs/debug.c         |    9 +-
 drivers/staging/lustre/lnet/libcfs/fail.c          |    6 +-
 drivers/staging/lustre/lustre/fld/fld_request.c    |   55 +--
 drivers/staging/lustre/lustre/include/cl_object.h  |    3 +
 drivers/staging/lustre/lustre/include/lu_object.h  |    3 +-
 .../lustre/lustre/include/lustre/lustre_idl.h      |  250 ++++++--
 .../lustre/lustre/include/lustre/lustre_ioctl.h    |  412 ++++++++++++
 .../lustre/lustre/include/lustre/lustre_user.h     |   39 +-
 drivers/staging/lustre/lustre/include/lustre_dlm.h |   11 +-
 .../lustre/lustre/include/lustre_dlm_flags.h       |   36 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h |   30 +-
 drivers/staging/lustre/lustre/include/lustre_lib.h |  286 +---------
 drivers/staging/lustre/lustre/include/lustre_lmv.h |  130 ++++
 drivers/staging/lustre/lustre/include/lustre_mdc.h |    9 +-
 drivers/staging/lustre/lustre/include/obd.h        |   60 +--
 drivers/staging/lustre/lustre/include/obd_class.h  |   24 +
 .../staging/lustre/lustre/include/obd_support.h    |    5 +
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c    |   98 +++-
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c      |    4 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c     |   23 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |   16 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |    8 +-
 drivers/staging/lustre/lustre/llite/dir.c          |  471 +++++++++-----
 drivers/staging/lustre/lustre/llite/file.c         |  178 +++++-
 .../staging/lustre/lustre/llite/llite_internal.h   |   49 ++-
 drivers/staging/lustre/lustre/llite/llite_lib.c    |  258 ++++++++-
 drivers/staging/lustre/lustre/llite/llite_nfs.c    |   19 +-
 drivers/staging/lustre/lustre/llite/namei.c        |  104 +++-
 drivers/staging/lustre/lustre/llite/rw.c           |    4 +
 drivers/staging/lustre/lustre/llite/rw26.c         |    5 +-
 drivers/staging/lustre/lustre/llite/statahead.c    |   77 ++-
 drivers/staging/lustre/lustre/llite/vvp_dev.c      |    6 -
 drivers/staging/lustre/lustre/llite/vvp_req.c      |    2 +
 drivers/staging/lustre/lustre/llite/xattr.c        |    7 +-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c     |  287 ++++++++--
 drivers/staging/lustre/lustre/lmv/lmv_internal.h   |   67 ++-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c        |  656 ++++++++++++++++----
 drivers/staging/lustre/lustre/lov/lov_obd.c        |    1 +
 drivers/staging/lustre/lustre/lov/lov_object.c     |    1 +
 drivers/staging/lustre/lustre/lov/lov_page.c       |   11 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c      |   17 +-
 drivers/staging/lustre/lustre/mdc/mdc_internal.h   |    2 -
 drivers/staging/lustre/lustre/mdc/mdc_lib.c        |   66 +--
 drivers/staging/lustre/lustre/mdc/mdc_locks.c      |   21 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c    |   22 +-
 drivers/staging/lustre/lustre/obdclass/class_obd.c |    8 +-
 drivers/staging/lustre/lustre/obdclass/genops.c    |  132 ++++
 .../lustre/lustre/obdclass/linux/linux-module.c    |    1 +
 drivers/staging/lustre/lustre/obdclass/lu_object.c |   34 +-
 .../staging/lustre/lustre/obdclass/obd_config.c    |    1 +
 drivers/staging/lustre/lustre/obdclass/obd_mount.c |   21 +-
 .../staging/lustre/lustre/obdecho/echo_client.c    |    1 +
 drivers/staging/lustre/lustre/osc/osc_cache.c      |   19 +-
 drivers/staging/lustre/lustre/osc/osc_request.c    |    9 +-
 drivers/staging/lustre/lustre/ptlrpc/client.c      |    8 +-
 drivers/staging/lustre/lustre/ptlrpc/import.c      |   11 +-
 .../staging/lustre/lustre/ptlrpc/pack_generic.c    |   37 ++
 drivers/staging/lustre/lustre/ptlrpc/service.c     |   18 +-
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c    |   33 +-
 60 files changed, 2942 insertions(+), 1242 deletions(-)
 create mode 100644 drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h
 create mode 100644 drivers/staging/lustre/lustre/include/lustre_lmv.h

[toc] | [next] | [standalone]


#1448319 — [PATCH 07/58] staging: lustre: llite: label the debug info

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:00 +0200
Subject[PATCH 07/58] staging: lustre: llite: label the debug info
Message-ID<rXyQW-88M-17@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

We report the inode size but never print in the debug
message that the number reported is the size.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 5b38177..4d81a64 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -615,7 +615,7 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx)
 	int			api32	= ll_need_32bit_api(sbi);
 	int			rc;
 
-	CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p) pos %lu/%llu 32bit_api %d\n",
+	CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p) pos/size %lu/%llu 32bit_api %d\n",
 	       PFID(ll_inode2fid(inode)), inode, (unsigned long)pos,
 	       i_size_read(inode), api32);
 
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448321 — [PATCH 02/58] staging: lustre: obd: rename struct lmv_stripe_md field mea to lmv

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:00 +0200
Subject[PATCH 02/58] staging: lustre: obd: rename struct lmv_stripe_md field mea to lmv
Message-ID<rXyQW-88M-23@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Rename struct lmv_stripe_md in struct lustre_md from mea
to lmv.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/obd.h     |    2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c     |    4 ++--
 drivers/staging/lustre/lustre/mdc/mdc_request.c |    8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index e6fca90..1575c82 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -1031,7 +1031,7 @@ enum {
 struct lustre_md {
 	struct mdt_body	 *body;
 	struct lov_stripe_md    *lsm;
-	struct lmv_stripe_md    *mea;
+	struct lmv_stripe_md    *lmv;
 #ifdef CONFIG_FS_POSIX_ACL
 	struct posix_acl	*posix_acl;
 #endif
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index 0e1588a..fac04f0 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -2571,8 +2571,8 @@ static int lmv_free_lustre_md(struct obd_export *exp, struct lustre_md *md)
 	struct lmv_obd	  *lmv = &obd->u.lmv;
 	struct lmv_tgt_desc *tgt = lmv->tgts[0];
 
-	if (md->mea)
-		obd_free_memmd(exp, (void *)&md->mea);
+	if (md->lmv)
+		obd_free_memmd(exp, (void *)&md->lmv);
 	if (!tgt || !tgt->ltd_exp)
 		return -EINVAL;
 	return md_free_lustre_md(tgt->ltd_exp, md);
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index d4cc73b..4fc3f9b 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -504,15 +504,15 @@ static int mdc_get_lustre_md(struct obd_export *exp,
 				goto out;
 			}
 
-			rc = obd_unpackmd(md_exp, (void *)&md->mea, lmv,
+			rc = obd_unpackmd(md_exp, (void *)&md->lmv, lmv,
 					  lmvsize);
 			if (rc < 0)
 				goto out;
 
-			if (rc < sizeof(*md->mea)) {
+			if (rc < sizeof(*md->lmv)) {
 				CDEBUG(D_INFO,
-				       "size too small: rc < sizeof(*md->mea) (%d < %d)\n",
-					rc, (int)sizeof(*md->mea));
+				       "size too small: rc < sizeof(*md->lmv) (%d < %d)\n",
+					rc, (int)sizeof(*md->lmv));
 				rc = -EPROTO;
 				goto out;
 			}
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448322 — [PATCH 05/58] staging: lustre: lmv: add new lmv structures

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:00 +0200
Subject[PATCH 05/58] staging: lustre: lmv: add new lmv structures
Message-ID<rXyQW-88M-25@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Newer lustre version on metadata servers support different
version of lmv magic. This add the new data structures
to handle these new lmv magic versions.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../lustre/lustre/include/lustre/lustre_idl.h      |   81 +++++++++++++++++---
 drivers/staging/lustre/lustre/include/lustre_lmv.h |   66 ++++++++++++++++
 drivers/staging/lustre/lustre/lmv/lmv_internal.h   |    1 +
 drivers/staging/lustre/lustre/lmv/lmv_obd.c        |    1 +
 drivers/staging/lustre/lustre/mdc/mdc_request.c    |    1 +
 5 files changed, 140 insertions(+), 10 deletions(-)
 create mode 100644 drivers/staging/lustre/lustre/include/lustre_lmv.h

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 051864c..32471a6 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2482,16 +2482,6 @@ struct lmv_desc {
 	struct obd_uuid ld_uuid;
 };
 
-/* TODO: lmv_stripe_md should contain mds capabilities for all slave fids */
-struct lmv_stripe_md {
-	__u32	 mea_magic;
-	__u32	 mea_count;
-	__u32	 mea_master;
-	__u32	 mea_padding;
-	char	  mea_pool_name[LOV_MAXPOOLNAME];
-	struct lu_fid mea_ids[0];
-};
-
 #define MEA_MAGIC_LAST_CHAR      0xb2221ca1
 #define MEA_MAGIC_ALL_CHARS      0xb222a11c
 #define MEA_MAGIC_HASH_SEGMENT   0xb222a11b
@@ -2500,6 +2490,77 @@ struct lmv_stripe_md {
 #define MAX_HASH_SIZE	    0x7fffffffffffffffULL
 #define MAX_HASH_HIGHEST_BIT     0x1000000000000000ULL
 
+/* lmv structures */
+#define LMV_MAGIC_V1	0x0CD10CD0	/* normal stripe lmv magic */
+#define LMV_USER_MAGIC	0x0CD20CD0	/* default lmv magic*/
+#define LMV_MAGIC	LMV_MAGIC_V1
+struct lmv_mds_md_v1 {
+	__u32 lmv_magic;
+	__u32 lmv_stripe_count;		/* stripe count */
+	__u32 lmv_master_mdt_index;	/* master MDT index */
+	__u32 lmv_hash_type;		/* dir stripe policy, i.e. indicate
+					 * which hash function to be used
+					 */
+	__u32 lmv_layout_version;	/* Used for directory restriping */
+	__u32 lmv_padding;
+	char lmv_pool_name[LOV_MAXPOOLNAME];	/* pool name */
+	struct lu_fid lmv_stripe_fids[0];	/* FIDs for each stripe */
+};
+
+union lmv_mds_md {
+	__u32			lmv_magic;
+	struct lmv_mds_md_v1	lmv_md_v1;
+	struct lmv_user_md	lmv_user_md;
+};
+
+static inline ssize_t lmv_mds_md_size(int stripe_count, unsigned int lmm_magic)
+{
+	ssize_t len = -EINVAL;
+
+	switch (lmm_magic) {
+	case LMV_MAGIC_V1: {
+		struct lmv_mds_md_v1 *lmm1;
+
+		len = sizeof(*lmm1);
+		len += stripe_count * sizeof(lmm1->lmv_stripe_fids[0]);
+		break; }
+	default:
+		break;
+	}
+	return len;
+}
+
+static inline int lmv_mds_md_stripe_count_get(const union lmv_mds_md *lmm)
+{
+	switch (le32_to_cpu(lmm->lmv_magic)) {
+	case LMV_MAGIC_V1:
+		return le32_to_cpu(lmm->lmv_md_v1.lmv_stripe_count);
+	case LMV_USER_MAGIC:
+		return le32_to_cpu(lmm->lmv_user_md.lum_stripe_count);
+	default:
+		return -EINVAL;
+	}
+}
+
+static inline int lmv_mds_md_stripe_count_set(union lmv_mds_md *lmm,
+					      unsigned int stripe_count)
+{
+	int rc = 0;
+
+	switch (le32_to_cpu(lmm->lmv_magic)) {
+	case LMV_MAGIC_V1:
+		lmm->lmv_md_v1.lmv_stripe_count = cpu_to_le32(stripe_count);
+		break;
+	case LMV_USER_MAGIC:
+		lmm->lmv_user_md.lum_stripe_count = cpu_to_le32(stripe_count);
+		break;
+	default:
+		rc = -EINVAL;
+		break;
+	}
+	return rc;
+}
+
 enum fld_rpc_opc {
 	FLD_QUERY	= 900,
 	FLD_READ	= 901,
diff --git a/drivers/staging/lustre/lustre/include/lustre_lmv.h b/drivers/staging/lustre/lustre/include/lustre_lmv.h
new file mode 100644
index 0000000..0620c8c
--- /dev/null
+++ b/drivers/staging/lustre/lustre/include/lustre_lmv.h
@@ -0,0 +1,66 @@
+/*
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License version 2 for more details.  A copy is
+ * included in the COPYING file that accompanied this code.
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2013, Intel Corporation.
+ */
+/*
+ * lustre/include/lustre_lmv.h
+ *
+ * Lustre LMV structures and functions.
+ *
+ * Author: Di Wang <di.wang@intel.com>
+ */
+
+#ifndef _LUSTRE_LMV_H
+#define _LUSTRE_LMV_H
+#include "lustre/lustre_idl.h"
+
+struct lmv_oinfo {
+	struct lu_fid	lmo_fid;
+	u32		lmo_mds;
+	struct inode	*lmo_root;
+};
+
+struct lmv_stripe_md {
+	__u32	mea_magic;
+	__u32	mea_count;
+	__u32	mea_master;
+	__u32	mea_padding;
+	char	mea_pool_name[LOV_MAXPOOLNAME];
+	struct lu_fid mea_ids[0];
+};
+
+union lmv_mds_md;
+
+int lmv_unpack_md(struct obd_export *exp, struct lmv_stripe_md **lsmp,
+		  const union lmv_mds_md *lmm, int stripe_count);
+
+static inline int lmv_alloc_memmd(struct lmv_stripe_md **lsmp, int stripe_count)
+{
+	return lmv_unpack_md(NULL, lsmp, NULL, stripe_count);
+}
+
+static inline void lmv_free_memmd(struct lmv_stripe_md *lsm)
+{
+	lmv_unpack_md(NULL, &lsm, NULL, 0);
+}
+#endif
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h
index 0beafc4..471470b 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h
+++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h
@@ -35,6 +35,7 @@
 
 #include "../include/lustre/lustre_idl.h"
 #include "../include/obd.h"
+#include "../include/lustre_lmv.h"
 
 #define LMV_MAX_TGT_COUNT 128
 
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index fac04f0..8e83263 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -46,6 +46,7 @@
 #include "../include/lustre_lib.h"
 #include "../include/lustre_net.h"
 #include "../include/obd_class.h"
+#include "../include/lustre_lmv.h"
 #include "../include/lprocfs_status.h"
 #include "../include/lustre_lite.h"
 #include "../include/lustre_fid.h"
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 4fc3f9b..ab78754 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -40,6 +40,7 @@
 
 #include "../include/lustre_acl.h"
 #include "../include/obd_class.h"
+#include "../include/lustre_lmv.h"
 #include "../include/lustre_fid.h"
 #include "../include/lprocfs_status.h"
 #include "../include/lustre_param.h"
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448324 — [PATCH 10/58] staging: lustre: llite: reduce indent in ll_dir_read

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:10 +0200
Subject[PATCH 10/58] staging: lustre: llite: reduce indent in ll_dir_read
Message-ID<rXz0B-8sT-3@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Instead of making a large chunk of code conditional
based on if a page is valid we reverse the page
validity test and exit the loop if the page is invalid
instead. This allows a section of code to reduce its
indentation one level.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/10761
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4906
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c |  147 ++++++++++++++---------------
 1 files changed, 72 insertions(+), 75 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 5b46dd8..77fadf1 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -508,93 +508,90 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
 	while (rc == 0 && !done) {
 		struct lu_dirpage *dp;
 		struct lu_dirent  *ent;
+		__u64 hash;
+		__u64 next;
+
+		if (IS_ERR(page)) {
+			rc = PTR_ERR(page);
+			break;
+		}
+
+		hash = MDS_DIR_END_OFF;
+		dp = page_address(page);
+		for (ent = lu_dirent_start(dp); ent && !done;
+		     ent = lu_dirent_next(ent)) {
+			__u16	  type;
+			int	    namelen;
+			struct lu_fid  fid;
+			__u64	  lhash;
+			__u64	  ino;
 
-		if (!IS_ERR(page)) {
 			/*
-			 * If page is empty (end of directory is reached),
-			 * use this value.
+			 * XXX: implement correct swabbing here.
 			 */
-			__u64 hash = MDS_DIR_END_OFF;
-			__u64 next;
-
-			dp = page_address(page);
-			for (ent = lu_dirent_start(dp); ent && !done;
-			     ent = lu_dirent_next(ent)) {
-				__u16	  type;
-				int	    namelen;
-				struct lu_fid  fid;
-				__u64	  lhash;
-				__u64	  ino;
 
+			hash = le64_to_cpu(ent->lde_hash);
+			if (hash < pos)
 				/*
-				 * XXX: implement correct swabbing here.
+				 * Skip until we find target hash
+				 * value.
 				 */
+				continue;
 
-				hash = le64_to_cpu(ent->lde_hash);
-				if (hash < pos)
-					/*
-					 * Skip until we find target hash
-					 * value.
-					 */
-					continue;
-
-				namelen = le16_to_cpu(ent->lde_namelen);
-				if (namelen == 0)
-					/*
-					 * Skip dummy record.
-					 */
-					continue;
-
-				if (api32 && hash64)
-					lhash = hash >> 32;
-				else
-					lhash = hash;
-				fid_le_to_cpu(&fid, &ent->lde_fid);
-				ino = cl_fid_build_ino(&fid, api32);
-				type = ll_dirent_type_get(ent);
-				ctx->pos = lhash;
-				/* For 'll_nfs_get_name_filldir()', it will try
-				 * to access the 'ent' through its 'lde_name',
-				 * so the parameter 'name' for 'ctx->actor()'
-				 * must be part of the 'ent'.
+			namelen = le16_to_cpu(ent->lde_namelen);
+			if (namelen == 0)
+				/*
+				 * Skip dummy record.
 				 */
-				done = !dir_emit(ctx, ent->lde_name,
-						 namelen, ino, type);
-			}
-			next = le64_to_cpu(dp->ldp_hash_end);
-			if (!done) {
-				pos = next;
-				if (pos == MDS_DIR_END_OFF) {
-					/*
-					 * End of directory reached.
-					 */
-					done = 1;
-					ll_release_page(page, 0);
-				} else if (1 /* chain is exhausted*/) {
-					/*
-					 * Normal case: continue to the next
-					 * page.
-					 */
-					ll_release_page(page,
-					    le32_to_cpu(dp->ldp_flags) &
-							LDF_COLLIDE);
-					next = pos;
-					page = ll_get_dir_page(inode, pos,
-							       &chain);
-				} else {
-					/*
-					 * go into overflow page.
-					 */
-					LASSERT(le32_to_cpu(dp->ldp_flags) &
+				continue;
+
+			if (api32 && hash64)
+				lhash = hash >> 32;
+			else
+				lhash = hash;
+			fid_le_to_cpu(&fid, &ent->lde_fid);
+			ino = cl_fid_build_ino(&fid, api32);
+			type = ll_dirent_type_get(ent);
+			ctx->pos = lhash;
+			/* For 'll_nfs_get_name_filldir()', it will try
+			 * to access the 'ent' through its 'lde_name',
+			 * so the parameter 'name' for 'ctx->actor()'
+			 * must be part of the 'ent'.
+			 */
+			done = !dir_emit(ctx, ent->lde_name,
+					 namelen, ino, type);
+		}
+		next = le64_to_cpu(dp->ldp_hash_end);
+		if (!done) {
+			pos = next;
+			if (pos == MDS_DIR_END_OFF) {
+				/*
+				 * End of directory reached.
+				 */
+				done = 1;
+				ll_release_page(page, 0);
+			} else if (1 /* chain is exhausted*/) {
+				/*
+				 * Normal case: continue to the next
+				 * page.
+				 */
+				ll_release_page(page,
+						le32_to_cpu(dp->ldp_flags) &
 						LDF_COLLIDE);
-					ll_release_page(page, 1);
-				}
+				next = pos;
+				page = ll_get_dir_page(inode, pos,
+						       &chain);
 			} else {
-				pos = hash;
-				ll_release_page(page, 0);
+				/*
+				 * go into overflow page.
+				 */
+				LASSERT(le32_to_cpu(dp->ldp_flags) &
+					LDF_COLLIDE);
+				ll_release_page(page, 1);
 			}
 		} else {
-			rc = PTR_ERR(page);
+			pos = hash;
+			ll_release_page(page, 0);
 		}
 	}
 
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448325 — [PATCH 06/58] staging: lustre: mdc: handle IT_READDIR operations

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:10 +0200
Subject[PATCH 06/58] staging: lustre: mdc: handle IT_READDIR operations
Message-ID<rXz0B-8sT-1@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

The readdir operations lock was incomplete. This
patch fills in the missing pieces.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/obd.h   |    4 +++-
 drivers/staging/lustre/lustre/mdc/mdc_locks.c |    8 +++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index 1575c82..17b8d22 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -801,9 +801,11 @@ static inline int it_to_lock_mode(struct lookup_intent *it)
 	/* CREAT needs to be tested before open (both could be set) */
 	if (it->it_op & IT_CREAT)
 		return LCK_CW;
-	else if (it->it_op & (IT_READDIR | IT_GETATTR | IT_OPEN | IT_LOOKUP |
+	else if (it->it_op & (IT_GETATTR | IT_OPEN | IT_LOOKUP |
 			      IT_LAYOUT))
 		return LCK_CR;
+	else if (it->it_op & IT_READDIR)
+		return LCK_PR;
 	else if (it->it_op &  IT_GETXATTR)
 		return LCK_PR;
 	else if (it->it_op &  IT_SETXATTR)
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index f48b584..06a1274 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -903,6 +903,9 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
 	LASSERT(request != LP_POISON);
 	LASSERT(request->rq_repmsg != LP_POISON);
 
+	if (it->it_op & IT_READDIR)
+		return 0;
+
 	if (!it_disposition(it, DISP_IT_EXECD)) {
 		/* The server failed before it even started executing the
 		 * intent, i.e. because it couldn't unpack the request.
@@ -1042,6 +1045,9 @@ int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
 						  MDS_INODELOCK_LOOKUP |
 						  MDS_INODELOCK_PERM;
 			break;
+		case IT_READDIR:
+			policy.l_inodebits.bits = MDS_INODELOCK_UPDATE;
+			break;
 		case IT_LAYOUT:
 			policy.l_inodebits.bits = MDS_INODELOCK_LAYOUT;
 			break;
@@ -1119,7 +1125,7 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 
 	lockh.cookie = 0;
 	if (fid_is_sane(&op_data->op_fid2) &&
-	    (it->it_op & (IT_LOOKUP | IT_GETATTR))) {
+	    (it->it_op & (IT_LOOKUP | IT_GETATTR | IT_READDIR))) {
 		/* We could just return 1 immediately, but since we should only
 		 * be called in revalidate_it if we already have a lock, let's
 		 * verify that.
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448326 — [PATCH 08/58] staging: lustre: llite: pass struct md_op_data to ll_dir_read

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:10 +0200
Subject[PATCH 08/58] staging: lustre: llite: pass struct md_op_data to ll_dir_read
Message-ID<rXz0B-8sT-9@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Add struct md_op_data as a parameter to ll_dir_read.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c          |   14 ++++++++++++--
 .../staging/lustre/lustre/llite/llite_internal.h   |    3 ++-
 drivers/staging/lustre/lustre/llite/llite_nfs.c    |   11 ++++++++++-
 drivers/staging/lustre/lustre/llite/statahead.c    |    7 +++++++
 4 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 4d81a64..75d0176 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -489,7 +489,8 @@ static __u16 ll_dirent_type_get(struct lu_dirent *ent)
 	return type;
 }
 
-int ll_dir_read(struct inode *inode, struct dir_context *ctx)
+int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
+		struct dir_context *ctx)
 {
 	struct ll_inode_info *info       = ll_i2info(inode);
 	struct ll_sb_info    *sbi	= ll_i2sbi(inode);
@@ -613,6 +614,7 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx)
 	__u64 pos = lfd ? lfd->lfd_pos : 0;
 	int			hash64	= sbi->ll_flags & LL_SBI_64BIT_HASH;
 	int			api32	= ll_need_32bit_api(sbi);
+	struct md_op_data *op_data;
 	int			rc;
 
 	CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p) pos/size %lu/%llu 32bit_api %d\n",
@@ -627,8 +629,15 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx)
 		goto out;
 	}
 
+	op_data = ll_prep_md_op_data(NULL, inode, inode, NULL, 0, 0,
+				     LUSTRE_OPC_ANY, inode);
+	if (IS_ERR(op_data)) {
+		rc = PTR_ERR(op_data);
+		goto out;
+	}
+
 	ctx->pos = pos;
-	rc = ll_dir_read(inode, ctx);
+	rc = ll_dir_read(inode, op_data, ctx);
 	if (lfd)
 		lfd->lfd_pos = ctx->pos;
 	if (ctx->pos == MDS_DIR_END_OFF) {
@@ -640,6 +649,7 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx)
 		if (api32 && hash64)
 			ctx->pos >>= 32;
 	}
+	ll_finish_md_op_data(op_data);
 	filp->f_version = inode->i_version;
 
 out:
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index baa208f..623455f 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -653,7 +653,8 @@ extern const struct file_operations ll_dir_operations;
 extern const struct inode_operations ll_dir_inode_operations;
 struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
 			     struct ll_dir_chain *chain);
-int ll_dir_read(struct inode *inode, struct dir_context *ctx);
+int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
+		struct dir_context *ctx);
 
 int ll_get_mdt_idx(struct inode *inode);
 /* llite/namei.c */
diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index 65972c8..b74582a 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -255,6 +255,7 @@ static int ll_get_name(struct dentry *dentry, char *name,
 		.lgd_fid = ll_i2info(d_inode(child))->lli_fid,
 		.ctx.actor = ll_nfs_get_name_filldir,
 	};
+	struct md_op_data *op_data;
 
 	if (!dir || !S_ISDIR(dir->i_mode)) {
 		rc = -ENOTDIR;
@@ -266,9 +267,17 @@ static int ll_get_name(struct dentry *dentry, char *name,
 		goto out;
 	}
 
+	op_data = ll_prep_md_op_data(NULL, dir, dir, NULL, 0, 0,
+				     LUSTRE_OPC_ANY, dir);
+	if (IS_ERR(op_data)) {
+		rc = PTR_ERR(op_data);
+		goto out;
+	}
+
 	inode_lock(dir);
-	rc = ll_dir_read(dir, &lgd.ctx);
+	rc = ll_dir_read(dir, op_data, &lgd.ctx);
 	inode_unlock(dir);
+	ll_finish_md_op_data(op_data);
 	if (!rc && !lgd.lgd_found)
 		rc = -ENOENT;
 out:
diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c
index f775242..7a7b11c 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -1037,6 +1037,7 @@ static int ll_statahead_thread(void *arg)
 	__u64		     pos    = 0;
 	int		       first  = 0;
 	int		       rc     = 0;
+	struct md_op_data *op_data;
 	struct ll_dir_chain       chain;
 	struct l_wait_info	lwi    = { 0 };
 
@@ -1044,6 +1045,11 @@ static int ll_statahead_thread(void *arg)
 	CDEBUG(D_READA, "statahead thread starting: sai %p, parent %pd\n",
 	       sai, parent);
 
+	op_data = ll_prep_md_op_data(NULL, dir, dir, NULL, 0, 0,
+				     LUSTRE_OPC_ANY, dir);
+	if (IS_ERR(op_data))
+		return PTR_ERR(op_data);
+
 	if (sbi->ll_flags & LL_SBI_AGL_ENABLED)
 		ll_start_agl(parent, sai);
 
@@ -1234,6 +1240,7 @@ do_it:
 	}
 
 out:
+	ll_finish_md_op_data(op_data);
 	if (sai->sai_agl_valid) {
 		spin_lock(&plli->lli_agl_lock);
 		thread_set_flags(agl_thread, SVC_STOPPING);
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448327 — [PATCH 03/58] staging: lustre: ptlrpc: remove wirecheck for struct lmv_stripe_md

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:10 +0200
Subject[PATCH 03/58] staging: lustre: ptlrpc: remove wirecheck for struct lmv_stripe_md
Message-ID<rXz0B-8sT-5@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Remove the wiretest check for this data structure.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c |   29 -----------------------
 1 files changed, 0 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
index 6cc2b2e..4c500a9 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
@@ -2617,35 +2617,6 @@ void lustre_assert_wire_constants(void)
 	LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_uuid) == 40, "found %lld\n",
 		 (long long)(int)sizeof(((struct lmv_desc *)0)->ld_uuid));
 
-	/* Checks for struct lmv_stripe_md */
-	LASSERTF((int)sizeof(struct lmv_stripe_md) == 32, "found %lld\n",
-		 (long long)(int)sizeof(struct lmv_stripe_md));
-	LASSERTF((int)offsetof(struct lmv_stripe_md, mea_magic) == 0, "found %lld\n",
-		 (long long)(int)offsetof(struct lmv_stripe_md, mea_magic));
-	LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_magic) == 4, "found %lld\n",
-		 (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_magic));
-	LASSERTF((int)offsetof(struct lmv_stripe_md, mea_count) == 4, "found %lld\n",
-		 (long long)(int)offsetof(struct lmv_stripe_md, mea_count));
-	LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_count) == 4, "found %lld\n",
-		 (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_count));
-	LASSERTF((int)offsetof(struct lmv_stripe_md, mea_master) == 8, "found %lld\n",
-		 (long long)(int)offsetof(struct lmv_stripe_md, mea_master));
-	LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_master) == 4, "found %lld\n",
-		 (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_master));
-	LASSERTF((int)offsetof(struct lmv_stripe_md, mea_padding) == 12, "found %lld\n",
-		 (long long)(int)offsetof(struct lmv_stripe_md, mea_padding));
-	LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_padding) == 4, "found %lld\n",
-		 (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_padding));
-	CLASSERT(LOV_MAXPOOLNAME == 16);
-	LASSERTF((int)offsetof(struct lmv_stripe_md, mea_pool_name[16]) == 32, "found %lld\n",
-		 (long long)(int)offsetof(struct lmv_stripe_md, mea_pool_name[16]));
-	LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_pool_name[16]) == 1, "found %lld\n",
-		 (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_pool_name[16]));
-	LASSERTF((int)offsetof(struct lmv_stripe_md, mea_ids[0]) == 32, "found %lld\n",
-		 (long long)(int)offsetof(struct lmv_stripe_md, mea_ids[0]));
-	LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_ids[0]) == 16, "found %lld\n",
-		 (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_ids[0]));
-
 	/* Checks for struct lov_desc */
 	LASSERTF((int)sizeof(struct lov_desc) == 88, "found %lld\n",
 		 (long long)(int)sizeof(struct lov_desc));
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448328 — [PATCH 15/58] staging: lustre: llite: clarify some debug messages for statahead

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:10 +0200
Subject[PATCH 15/58] staging: lustre: llite: clarify some debug messages for statahead
Message-ID<rXz0B-8sT-11@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Make some of the error reporting more clear for the statahead
thread startup and is_first_dirent() function.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/statahead.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c
index 7a7b11c..fc24a65 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -1073,9 +1073,9 @@ static int ll_statahead_thread(void *arg)
 
 		if (IS_ERR(page)) {
 			rc = PTR_ERR(page);
-			CDEBUG(D_READA, "error reading dir "DFID" at %llu/%llu: [rc %d] [parent %u]\n",
+			CDEBUG(D_READA, "error reading dir "DFID" at %llu/%llu: opendir_pid = %u: rc = %d\n",
 			       PFID(ll_inode2fid(dir)), pos, sai->sai_index,
-			       rc, plli->lli_opendir_pid);
+			       plli->lli_opendir_pid, rc);
 			goto out;
 		}
 
@@ -1362,9 +1362,10 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry)
 			struct ll_inode_info *lli = ll_i2info(dir);
 
 			rc = PTR_ERR(page);
-			CERROR("error reading dir "DFID" at %llu: [rc %d] [parent %u]\n",
+			CERROR("%s: error reading dir "DFID" at %llu: opendir_pid = %u : rc = %d\n",
+			       ll_get_fsname(dir->i_sb, NULL, 0),
 			       PFID(ll_inode2fid(dir)), pos,
-			       rc, lli->lli_opendir_pid);
+			       lli->lli_opendir_pid, rc);
 			break;
 		}
 
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448329 — [PATCH 04/58] staging: lustre: llite: cache directory striping information

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:10 +0200
Subject[PATCH 04/58] staging: lustre: llite: cache directory striping information
Message-ID<rXz0B-8sT-7@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Cache directory striping information that the clients receive
from the metadata servers.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../staging/lustre/lustre/llite/llite_internal.h   |    3 +++
 drivers/staging/lustre/lustre/llite/llite_lib.c    |   15 +++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 27d3f77..baa208f 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -173,6 +173,8 @@ struct ll_inode_info {
 			 * -- I am the owner of dir statahead.
 			 */
 			pid_t			   d_opendir_pid;
+			/* directory stripe information */
+			struct lmv_stripe_md		*d_lmv_md;
 		} d;
 
 #define lli_readdir_mutex       u.d.d_readdir_mutex
@@ -180,6 +182,7 @@ struct ll_inode_info {
 #define lli_sai		 u.d.d_sai
 #define lli_sa_lock	     u.d.d_sa_lock
 #define lli_opendir_pid	 u.d.d_opendir_pid
+#define lli_lmv_md		u.d.d_lmv_md
 
 		/* for non-directory */
 		struct {
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 75d568f..eb715be 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -2090,11 +2090,22 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
 
 	ll_i2gids(op_data->op_suppgids, i1, i2);
 	op_data->op_fid1 = *ll_inode2fid(i1);
+	if (S_ISDIR(i1->i_mode))
+		op_data->op_mea1 = ll_i2info(i1)->lli_lmv_md;
 
-	if (i2)
+	if (i2) {
 		op_data->op_fid2 = *ll_inode2fid(i2);
-	else
+		if (S_ISDIR(i2->i_mode))
+			op_data->op_mea2 = ll_i2info(i2)->lli_lmv_md;
+	} else {
 		fid_zero(&op_data->op_fid2);
+	}
+
+	if (ll_i2sbi(i1)->ll_flags & LL_SBI_64BIT_HASH)
+		op_data->op_cli_flags |= CLI_HASH64;
+
+	if (ll_need_32bit_api(ll_i2sbi(i1)))
+		op_data->op_cli_flags |= CLI_API32;
 
 	op_data->op_name = name;
 	op_data->op_namelen = namelen;
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448331 — [PATCH 14/58] staging: lustre: llite: rename some variables for ll_dir_read

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:10 +0200
Subject[PATCH 14/58] staging: lustre: llite: rename some variables for ll_dir_read
Message-ID<rXz0B-8sT-15@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

The variables api32 and hash64 was renamed to is_api32 and
is_hash64.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 70a3ca0..907fae4 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -494,8 +494,8 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
 {
 	struct ll_sb_info    *sbi	= ll_i2sbi(inode);
 	__u64		   pos		= ctx->pos;
-	int		   api32      = ll_need_32bit_api(sbi);
-	int		   hash64     = sbi->ll_flags & LL_SBI_64BIT_HASH;
+	int		   is_api32 = ll_need_32bit_api(sbi);
+	int		   is_hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH;
 	struct page	  *page;
 	struct ll_dir_chain   chain;
 	bool		   done = false;
@@ -545,12 +545,12 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
 				 */
 				continue;
 
-			if (api32 && hash64)
+			if (is_api32 && is_hash64)
 				lhash = hash >> 32;
 			else
 				lhash = hash;
 			fid_le_to_cpu(&fid, &ent->lde_fid);
-			ino = cl_fid_build_ino(&fid, api32);
+			ino = cl_fid_build_ino(&fid, is_api32);
 			type = ll_dirent_type_get(ent);
 			ctx->pos = lhash;
 			/* For 'll_nfs_get_name_filldir()', it will try
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448332 — [PATCH 16/58] staging: lustre: llite: remove code never called

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:20 +0200
Subject[PATCH 16/58] staging: lustre: llite: remove code never called
Message-ID<rXzah-65-1@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

We have if (1) conditionals which is pointless so remove
it and the next code block is never called so remove that
as well.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c       |    9 +--------
 drivers/staging/lustre/lustre/llite/statahead.c |   18 +++---------------
 2 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 907fae4..2307e70 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -576,7 +576,7 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
 			 */
 			done = 1;
 			ll_release_page(page, 0);
-		} else if (1 /* chain is exhausted*/) {
+		} else {
 			/*
 			 * Normal case: continue to the next
 			 * page.
@@ -587,13 +587,6 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
 			next = pos;
 			page = ll_get_dir_page(inode, pos,
 					       &chain);
-		} else {
-			/*
-			 * go into overflow page.
-			 */
-			LASSERT(le32_to_cpu(dp->ldp_flags) &
-				LDF_COLLIDE);
-			ll_release_page(page, 1);
 		}
 	}
 
diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c
index fc24a65..e4ca525 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -1222,7 +1222,7 @@ do_it:
 
 			rc = 0;
 			goto out;
-		} else if (1) {
+		} else {
 			/*
 			 * chain is exhausted.
 			 * Normal case: continue to the next page.
@@ -1230,12 +1230,6 @@ do_it:
 			ll_release_page(page, le32_to_cpu(dp->ldp_flags) &
 					      LDF_COLLIDE);
 			page = ll_get_dir_page(dir, pos, &chain);
-		} else {
-			LASSERT(le32_to_cpu(dp->ldp_flags) & LDF_COLLIDE);
-			ll_release_page(page, 1);
-			/*
-			 * go into overflow page.
-			 */
 		}
 	}
 
@@ -1432,8 +1426,8 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry)
 			 * End of directory reached.
 			 */
 			ll_release_page(page, 0);
-			break;
-		} else if (1) {
+			goto out;
+		} else {
 			/*
 			 * chain is exhausted
 			 * Normal case: continue to the next page.
@@ -1441,12 +1435,6 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry)
 			ll_release_page(page, le32_to_cpu(dp->ldp_flags) &
 					      LDF_COLLIDE);
 			page = ll_get_dir_page(dir, pos, &chain);
-		} else {
-			/*
-			 * go into overflow page.
-			 */
-			LASSERT(le32_to_cpu(dp->ldp_flags) & LDF_COLLIDE);
-			ll_release_page(page, 1);
 		}
 	}
 
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448333 — [PATCH 23/58] staging: lustre: llite: change remove parameter to bool

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:20 +0200
Subject[PATCH 23/58] staging: lustre: llite: change remove parameter to bool
Message-ID<rXzah-65-3@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Change the 3rd parameter remove to a bool for ll_release_page
function.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c          |   10 +++++-----
 .../staging/lustre/lustre/llite/llite_internal.h   |    2 +-
 drivers/staging/lustre/lustre/llite/statahead.c    |   10 +++++-----
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 3a800b2..a72b486 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -236,7 +236,7 @@ static int ll_dir_filler(void *_hash, struct page *page0)
 	return rc;
 }
 
-void ll_release_page(struct inode *inode, struct page *page, int remove)
+void ll_release_page(struct inode *inode, struct page *page, bool remove)
 {
 	kunmap(page);
 	if (remove) {
@@ -297,7 +297,7 @@ static struct page *ll_dir_page_locate(struct inode *dir, __u64 *hash,
 			CDEBUG(D_VFSTRACE, "page %lu [%llu %llu], hash %llu\n",
 			       offset, *start, *end, *hash);
 			if (*hash > *end) {
-				ll_release_page(dir, page, 0);
+				ll_release_page(dir, page, false);
 				page = NULL;
 			} else if (*end != *start && *hash == *end) {
 				/*
@@ -463,7 +463,7 @@ out_unlock:
 	return page;
 
 fail:
-	ll_release_page(dir, page, 1);
+	ll_release_page(dir, page, true);
 	page = ERR_PTR(-EIO);
 	goto out_unlock;
 }
@@ -561,7 +561,7 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
 
 		if (done) {
 			pos = hash;
-			ll_release_page(inode, page, 0);
+			ll_release_page(inode, page, false);
 			break;
 		}
 
@@ -572,7 +572,7 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
 			 * End of directory reached.
 			 */
 			done = 1;
-			ll_release_page(inode, page, 0);
+			ll_release_page(inode, page, false);
 		} else {
 			/*
 			 * Normal case: continue to the next
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 4b03a64..07b6918 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -655,7 +655,7 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
 int ll_get_mdt_idx(struct inode *inode);
 struct page *ll_get_dir_page(struct inode *dir, struct md_op_data *op_data,
 			     __u64 hash, struct ll_dir_chain *chain);
-void ll_release_page(struct inode *inode, struct page *page, int remove);
+void ll_release_page(struct inode *inode, struct page *page, bool remove);
 
 /* llite/namei.c */
 extern const struct inode_operations ll_special_inode_operations;
diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c
index 1551e7a..7b23497 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -1140,7 +1140,7 @@ interpret_it:
 				ll_post_statahead(sai);
 
 			if (unlikely(!thread_is_running(thread))) {
-				ll_release_page(dir, page, 0);
+				ll_release_page(dir, page, false);
 				rc = 0;
 				goto out;
 			}
@@ -1164,7 +1164,7 @@ interpret_it:
 
 					if (unlikely(
 						!thread_is_running(thread))) {
-						ll_release_page(dir, page, 0);
+						ll_release_page(dir, page, false);
 						rc = 0;
 						goto out;
 					}
@@ -1187,7 +1187,7 @@ do_it:
 			/*
 			 * End of directory reached.
 			 */
-			ll_release_page(dir, page, 0);
+			ll_release_page(dir, page, false);
 			while (1) {
 				l_wait_event(thread->t_ctl_waitq,
 					     !list_empty(&sai->sai_entries_received) ||
@@ -1426,7 +1426,7 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry)
 			else
 				rc = LS_FIRST_DOT_DE;
 
-			ll_release_page(dir, page, 0);
+			ll_release_page(dir, page, false);
 			goto out;
 		}
 		pos = le64_to_cpu(dp->ldp_hash_end);
@@ -1434,7 +1434,7 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry)
 			/*
 			 * End of directory reached.
 			 */
-			ll_release_page(dir, page, 0);
+			ll_release_page(dir, page, false);
 			goto out;
 		} else {
 			/*
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448334 — [PATCH 24/58] staging: lustre: mdc: don't take rpc lock for readdir case

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:20 +0200
Subject[PATCH 24/58] staging: lustre: mdc: don't take rpc lock for readdir case
Message-ID<rXzah-65-11@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

If the operation is IT_READDIR don't need to handle the
mdc RPC lock.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/10761
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4906
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/lustre_mdc.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_mdc.h b/drivers/staging/lustre/lustre/include/lustre_mdc.h
index fa62b95..0a8c639 100644
--- a/drivers/staging/lustre/lustre/include/lustre_mdc.h
+++ b/drivers/staging/lustre/lustre/include/lustre_mdc.h
@@ -96,7 +96,7 @@ static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
 				    struct lookup_intent *it)
 {
 	if (it && (it->it_op == IT_GETATTR || it->it_op == IT_LOOKUP ||
-		   it->it_op == IT_LAYOUT))
+		   it->it_op == IT_LAYOUT || it->it_op == IT_READDIR))
 		return;
 
 	/* This would normally block until the existing request finishes.
@@ -136,7 +136,7 @@ static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
 				    struct lookup_intent *it)
 {
 	if (it && (it->it_op == IT_GETATTR || it->it_op == IT_LOOKUP ||
-		   it->it_op == IT_LAYOUT))
+		   it->it_op == IT_LAYOUT || it->it_op == IT_READDIR))
 		return;
 
 	if (lck->rpcl_it == MDC_FAKE_RPCL_IT) { /* OBD_FAIL_MDC_RPCS_SEM */
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448335 — [PATCH 17/58] staging: lustre: llite: pass in __u64 pos for ll_dir_read

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:20 +0200
Subject[PATCH 17/58] staging: lustre: llite: pass in __u64 pos for ll_dir_read
Message-ID<rXzah-65-5@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Some cases we want to preserve the ctx->pos value or use
a different value altogther. So allow the passing in of
a position offset to ll_dir_read.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/10761
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4906
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c          |   19 +++++++++++--------
 .../staging/lustre/lustre/llite/llite_internal.h   |    2 +-
 drivers/staging/lustre/lustre/llite/llite_nfs.c    |    3 ++-
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 2307e70..031c9e4 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -489,11 +489,11 @@ static __u16 ll_dirent_type_get(struct lu_dirent *ent)
 	return type;
 }
 
-int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
+int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
 		struct dir_context *ctx)
 {
 	struct ll_sb_info    *sbi	= ll_i2sbi(inode);
-	__u64		   pos		= ctx->pos;
+	__u64		   pos		= *ppos;
 	int		   is_api32 = ll_need_32bit_api(sbi);
 	int		   is_hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH;
 	struct page	  *page;
@@ -626,18 +626,21 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx)
 	}
 
 	ctx->pos = pos;
-	rc = ll_dir_read(inode, op_data, ctx);
+	rc = ll_dir_read(inode, &pos, op_data, ctx);
+	pos = ctx->pos;
 	if (lfd)
-		lfd->lfd_pos = ctx->pos;
-	if (ctx->pos == MDS_DIR_END_OFF) {
+		lfd->lfd_pos = pos;
+
+	if (pos == MDS_DIR_END_OFF) {
 		if (api32)
-			ctx->pos = LL_DIR_END_OFF_32BIT;
+			pos = LL_DIR_END_OFF_32BIT;
 		else
-			ctx->pos = LL_DIR_END_OFF;
+			pos = LL_DIR_END_OFF;
 	} else {
 		if (api32 && hash64)
-			ctx->pos >>= 32;
+			pos >>= 32;
 	}
+	ctx->pos = pos;
 	ll_finish_md_op_data(op_data);
 	filp->f_version = inode->i_version;
 
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 623455f..e650aeb 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -653,7 +653,7 @@ extern const struct file_operations ll_dir_operations;
 extern const struct inode_operations ll_dir_inode_operations;
 struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
 			     struct ll_dir_chain *chain);
-int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
+int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
 		struct dir_context *ctx);
 
 int ll_get_mdt_idx(struct inode *inode);
diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index b74582a..74eb1fc 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -256,6 +256,7 @@ static int ll_get_name(struct dentry *dentry, char *name,
 		.ctx.actor = ll_nfs_get_name_filldir,
 	};
 	struct md_op_data *op_data;
+	__u64 pos = 0;
 
 	if (!dir || !S_ISDIR(dir->i_mode)) {
 		rc = -ENOTDIR;
@@ -275,7 +276,7 @@ static int ll_get_name(struct dentry *dentry, char *name,
 	}
 
 	inode_lock(dir);
-	rc = ll_dir_read(dir, op_data, &lgd.ctx);
+	rc = ll_dir_read(dir, &pos, op_data, &lgd.ctx);
 	inode_unlock(dir);
 	ll_finish_md_op_data(op_data);
 	if (!rc && !lgd.lgd_found)
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448336 — [PATCH 21/58] staging: lustre: llite: style cleanup for llite_internal.h

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:20 +0200
Subject[PATCH 21/58] staging: lustre: llite: style cleanup for llite_internal.h
Message-ID<rXzah-65-13@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Group function prototypes together related to dir.c. Move
ll_release_page to be with function declarations.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../staging/lustre/lustre/llite/llite_internal.h   |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index fc0c72c..1ced397 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -648,15 +648,15 @@ void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
 		       size_t count, int rw);
 
 /* llite/dir.c */
-void ll_release_page(struct page *page, int remove);
 extern const struct file_operations ll_dir_operations;
 extern const struct inode_operations ll_dir_inode_operations;
-struct page *ll_get_dir_page(struct inode *dir, struct md_op_data *op_data,
-			     __u64 hash, struct ll_dir_chain *chain);
 int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
 		struct dir_context *ctx);
-
 int ll_get_mdt_idx(struct inode *inode);
+struct page *ll_get_dir_page(struct inode *dir, struct md_op_data *op_data,
+			     __u64 hash, struct ll_dir_chain *chain);
+void ll_release_page(struct page *page, int remove);
+
 /* llite/namei.c */
 extern const struct inode_operations ll_special_inode_operations;
 
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448337 — [PATCH 11/58] staging: lustre: llite: set next only when needed in ll_dir_read

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:20 +0200
Subject[PATCH 11/58] staging: lustre: llite: set next only when needed in ll_dir_read
Message-ID<rXzah-65-15@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

The variable next needs only to be set when done is false.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/10761
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4906
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 77fadf1..48eacee 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -561,8 +561,9 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
 			done = !dir_emit(ctx, ent->lde_name,
 					 namelen, ino, type);
 		}
-		next = le64_to_cpu(dp->ldp_hash_end);
+
 		if (!done) {
+			next = le64_to_cpu(dp->ldp_hash_end);
 			pos = next;
 			if (pos == MDS_DIR_END_OFF) {
 				/*
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448338 — [PATCH 13/58] staging: lustre: llite: change done flag in ll_dir_read to bool

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:20 +0200
Subject[PATCH 13/58] staging: lustre: llite: change done flag in ll_dir_read to bool
Message-ID<rXzah-65-17@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Change the done flag from integer to bool.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/10761
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4906
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index e4d3176..70a3ca0 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -498,7 +498,7 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
 	int		   hash64     = sbi->ll_flags & LL_SBI_64BIT_HASH;
 	struct page	  *page;
 	struct ll_dir_chain   chain;
-	int		   done = 0;
+	bool		   done = false;
 	int		   rc = 0;
 
 	ll_dir_chain_init(&chain);
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448339 — [PATCH 25/58] staging: lustre: lmv: remove unused lmv_get_mea function

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:30 +0200
Subject[PATCH 25/58] staging: lustre: lmv: remove unused lmv_get_mea function
Message-ID<rXzjX-a6-1@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

The function lmv_get_mea() is not used so remove it.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/lmv/lmv_internal.h |   24 ----------------------
 1 files changed, 0 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h
index 471470b..ab01560 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h
+++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h
@@ -55,30 +55,6 @@ int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid, u32 mds);
 int lmv_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
 		  struct md_op_data *op_data);
 
-static inline struct lmv_stripe_md *lmv_get_mea(struct ptlrpc_request *req)
-{
-	struct mdt_body	 *body;
-	struct lmv_stripe_md    *mea;
-
-	LASSERT(req);
-
-	body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
-
-	if (!body || !S_ISDIR(body->mode) || !body->eadatasize)
-		return NULL;
-
-	mea = req_capsule_server_sized_get(&req->rq_pill, &RMF_MDT_MD,
-					   body->eadatasize);
-	if (mea->mea_count == 0)
-		return NULL;
-	if (mea->mea_magic != MEA_MAGIC_LAST_CHAR &&
-	    mea->mea_magic != MEA_MAGIC_ALL_CHARS &&
-	    mea->mea_magic != MEA_MAGIC_HASH_SEGMENT)
-		return NULL;
-
-	return mea;
-}
-
 static inline int lmv_get_easize(struct lmv_obd *lmv)
 {
 	return sizeof(struct lmv_stripe_md) +
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


#1448340 — [PATCH 20/58] staging: lustre: llite: remove comment from ll_dir_read

FromJames Simmons <jsimmons@infradead.org>
Date2016-07-22 05:30 +0200
Subject[PATCH 20/58] staging: lustre: llite: remove comment from ll_dir_read
Message-ID<rXzjX-a6-3@gated-at.bofh.it>
In reply to#1448318
From: wang di <di.wang@intel.com>

Remove comment about fixing swabbing that is not needed.

Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/dir.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 82c7f88..d854edd 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -526,10 +526,6 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
 			__u64	  lhash;
 			__u64	  ino;
 
-			/*
-			 * XXX: implement correct swabbing here.
-			 */
-
 			hash = le64_to_cpu(ent->lde_hash);
 			if (hash < pos)
 				/*
-- 
1.7.1

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | linux.kernel


csiph-web