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


Groups > linux.kernel > #1367678

[PATCH v2 34/46] staging/lustre/llite: Rename struct ccc_grouplock to ll_grouplock

From green@linuxhacker.ru
Newsgroups linux.kernel
Subject [PATCH v2 34/46] staging/lustre/llite: Rename struct ccc_grouplock to ll_grouplock
Date 2016-03-31 02:00 +0200
Message-ID <riybM-4r2-5@gated-at.bofh.it> (permalink)
References <riy25-4mi-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: John Hammond <john.hammond@intel.com>

And move the definition from vvp_internal.h to llite_internal.h.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/13714
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5971
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/llite/file.c         | 16 ++++++-------
 drivers/staging/lustre/lustre/llite/lcommon_misc.c | 26 +++++++++++-----------
 .../staging/lustre/lustre/llite/llite_internal.h   | 14 +++++++++++-
 drivers/staging/lustre/lustre/llite/vvp_internal.h | 11 ---------
 drivers/staging/lustre/lustre/llite/vvp_io.c       |  2 +-
 5 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index 63aa080..210d1e2 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -278,7 +278,7 @@ static int ll_md_close(struct obd_export *md_exp, struct inode *inode,
 
 	/* clear group lock, if present */
 	if (unlikely(fd->fd_flags & LL_FILE_GROUP_LOCKED))
-		ll_put_grouplock(inode, file, fd->fd_grouplock.cg_gid);
+		ll_put_grouplock(inode, file, fd->fd_grouplock.lg_gid);
 
 	if (fd->fd_lease_och) {
 		bool lease_broken;
@@ -1570,7 +1570,7 @@ ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg)
 {
 	struct ll_inode_info   *lli = ll_i2info(inode);
 	struct ll_file_data    *fd = LUSTRE_FPRIVATE(file);
-	struct ccc_grouplock    grouplock;
+	struct ll_grouplock    grouplock;
 	int		     rc;
 
 	if (arg == 0) {
@@ -1584,11 +1584,11 @@ ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg)
 	spin_lock(&lli->lli_lock);
 	if (fd->fd_flags & LL_FILE_GROUP_LOCKED) {
 		CWARN("group lock already existed with gid %lu\n",
-		      fd->fd_grouplock.cg_gid);
+		      fd->fd_grouplock.lg_gid);
 		spin_unlock(&lli->lli_lock);
 		return -EINVAL;
 	}
-	LASSERT(!fd->fd_grouplock.cg_lock);
+	LASSERT(!fd->fd_grouplock.lg_lock);
 	spin_unlock(&lli->lli_lock);
 
 	rc = cl_get_grouplock(ll_i2info(inode)->lli_clob,
@@ -1617,7 +1617,7 @@ static int ll_put_grouplock(struct inode *inode, struct file *file,
 {
 	struct ll_inode_info   *lli = ll_i2info(inode);
 	struct ll_file_data    *fd = LUSTRE_FPRIVATE(file);
-	struct ccc_grouplock    grouplock;
+	struct ll_grouplock    grouplock;
 
 	spin_lock(&lli->lli_lock);
 	if (!(fd->fd_flags & LL_FILE_GROUP_LOCKED)) {
@@ -1625,11 +1625,11 @@ static int ll_put_grouplock(struct inode *inode, struct file *file,
 		CWARN("no group lock held\n");
 		return -EINVAL;
 	}
-	LASSERT(fd->fd_grouplock.cg_lock);
+	LASSERT(fd->fd_grouplock.lg_lock);
 
-	if (fd->fd_grouplock.cg_gid != arg) {
+	if (fd->fd_grouplock.lg_gid != arg) {
 		CWARN("group lock %lu doesn't match current id %lu\n",
-		      arg, fd->fd_grouplock.cg_gid);
+		      arg, fd->fd_grouplock.lg_gid);
 		spin_unlock(&lli->lli_lock);
 		return -EINVAL;
 	}
diff --git a/drivers/staging/lustre/lustre/llite/lcommon_misc.c b/drivers/staging/lustre/lustre/llite/lcommon_misc.c
index 68e3db1..5e3e43f 100644
--- a/drivers/staging/lustre/lustre/llite/lcommon_misc.c
+++ b/drivers/staging/lustre/lustre/llite/lcommon_misc.c
@@ -42,8 +42,8 @@
 #include "../include/obd.h"
 #include "../include/cl_object.h"
 
-#include "vvp_internal.h"
 #include "../include/lustre_lite.h"
+#include "llite_internal.h"
 
 /* Initialize the default and maximum LOV EA and cookie sizes.  This allows
  * us to make MDS RPCs with large enough reply buffers to hold the
@@ -126,7 +126,7 @@ int cl_ocd_update(struct obd_device *host,
 #define GROUPLOCK_SCOPE "grouplock"
 
 int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
-		     struct ccc_grouplock *cg)
+		     struct ll_grouplock *cg)
 {
 	struct lu_env	  *env;
 	struct cl_io	   *io;
@@ -172,25 +172,25 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
 		return rc;
 	}
 
-	cg->cg_env  = cl_env_get(&refcheck);
-	cg->cg_io   = io;
-	cg->cg_lock = lock;
-	cg->cg_gid  = gid;
-	LASSERT(cg->cg_env == env);
+	cg->lg_env  = cl_env_get(&refcheck);
+	cg->lg_io   = io;
+	cg->lg_lock = lock;
+	cg->lg_gid  = gid;
+	LASSERT(cg->lg_env == env);
 
 	cl_env_unplant(env, &refcheck);
 	return 0;
 }
 
-void cl_put_grouplock(struct ccc_grouplock *cg)
+void cl_put_grouplock(struct ll_grouplock *cg)
 {
-	struct lu_env  *env  = cg->cg_env;
-	struct cl_io   *io   = cg->cg_io;
-	struct cl_lock *lock = cg->cg_lock;
+	struct lu_env  *env  = cg->lg_env;
+	struct cl_io   *io   = cg->lg_io;
+	struct cl_lock *lock = cg->lg_lock;
 	int	     refcheck;
 
-	LASSERT(cg->cg_env);
-	LASSERT(cg->cg_gid);
+	LASSERT(cg->lg_env);
+	LASSERT(cg->lg_gid);
 
 	cl_env_implant(env, &refcheck);
 	cl_env_put(env, &refcheck);
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 86e93c0..8b943df 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -99,6 +99,13 @@ struct ll_remote_perm {
 					     */
 };
 
+struct ll_grouplock {
+	struct lu_env	*lg_env;
+	struct cl_io	*lg_io;
+	struct cl_lock	*lg_lock;
+	unsigned long	 lg_gid;
+};
+
 enum lli_flags {
 	/* MDS has an authority for the Size-on-MDS attributes. */
 	LLIF_MDS_SIZE_LOCK      = (1 << 0),
@@ -612,7 +619,7 @@ extern struct kmem_cache *ll_file_data_slab;
 struct lustre_handle;
 struct ll_file_data {
 	struct ll_readahead_state fd_ras;
-	struct ccc_grouplock fd_grouplock;
+	struct ll_grouplock fd_grouplock;
 	__u64 lfd_pos;
 	__u32 fd_flags;
 	fmode_t fd_omode;
@@ -655,6 +662,11 @@ static inline int ll_need_32bit_api(struct ll_sb_info *sbi)
 
 void ll_ras_enter(struct file *f);
 
+/* llite/lcommon_misc.c */
+int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
+		     struct ll_grouplock *cg);
+void cl_put_grouplock(struct ll_grouplock *cg);
+
 /* llite/lproc_llite.c */
 int ldebugfs_register_mountpoint(struct dentry *parent,
 				 struct super_block *sb, char *osc, char *mdc);
diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h
index 99e7ef3..4740ff5 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_internal.h
+++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h
@@ -388,17 +388,6 @@ int cl_ocd_update(struct obd_device *host,
 		  struct obd_device *watched,
 		  enum obd_notify_event ev, void *owner, void *data);
 
-struct ccc_grouplock {
-	struct lu_env	*cg_env;
-	struct cl_io	*cg_io;
-	struct cl_lock	*cg_lock;
-	unsigned long	 cg_gid;
-};
-
-int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
-		     struct ccc_grouplock *cg);
-void cl_put_grouplock(struct ccc_grouplock *cg);
-
 /**
  * New interfaces to get and put lov_stripe_md from lov layer. This violates
  * layering because lov_stripe_md is supposed to be a private data in lov.
diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c
index 48b0693..18bc71b 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_io.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_io.c
@@ -235,7 +235,7 @@ static int vvp_io_one_lock_index(const struct lu_env *env, struct cl_io *io,
 
 	if (vio->vui_fd && (vio->vui_fd->fd_flags & LL_FILE_GROUP_LOCKED)) {
 		descr->cld_mode = CLM_GROUP;
-		descr->cld_gid  = vio->vui_fd->fd_grouplock.cg_gid;
+		descr->cld_gid  = vio->vui_fd->fd_grouplock.lg_gid;
 	} else {
 		descr->cld_mode  = mode;
 	}
-- 
2.1.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/46] Lustre IO stack simplifications and cleanups green@linuxhacker.ru - 2016-03-31 01:50 +0200
  [PATCH v2 04/46] staging/lustre: Reintroduce global env list green@linuxhacker.ru - 2016-03-31 01:50 +0200
  [PATCH v2 06/46] staging/lustre/osc: to drop LRU pages with cl_lru_work green@linuxhacker.ru - 2016-03-31 01:50 +0200
  [PATCH v2 31/46] staging/lustre/llite: use vui prefix for struct vvp_io members green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 34/46] staging/lustre/llite: Rename struct ccc_grouplock to ll_grouplock green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 43/46] staging/lustre/ldlm: restore the ELC for enqueue green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 36/46] staging/lustre/llite: rename struct ccc_thread_info to vvp_thread_info green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 15/46] staging/lustre/obd: remove struct client_obd_lock green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 18/46] staging/lustre/clio: generalize cl_sync_io green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 14/46] staging/lustre/lmv: remove lmv_init_{lock,unlock}() green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 16/46] staging/lustre/llite: remove some cl wrappers green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 37/46] staging/lustre/llite: Remove ccc_global_{init,fini}() green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 33/46] staging/lustre/llite: rename ccc_req to vvp_req green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 27/46] staging/lustre/llite: rename ccc_page to vvp_page green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 29/46] staging/lustre:llite: remove struct ll_ra_read green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 21/46] staging/lustre/llite: clip page correctly for vvp_io_commit_sync green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 22/46] staging/lustre/llite: deadlock for page write green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 45/46] staging/lustre/ldlm: Solve a race for LRU lock cancel green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 30/46] staging/lustre/llite: merge ccc_io and vvp_io green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 10/46] staging/lustre/osc: add weight function for DLM lock green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 38/46] staging/lustre/llite: Move ll_dirent_type_get and make it static green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 35/46] staging/lustre/llite: Rename struct vvp_thread_info to ll_thread_info green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 23/46] staging/lustre/llite: make sure we do cl_page_clip on the last page green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 32/46] staging/lustre/llite: move vvp_io functions to vvp_io.c green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 17/46] staging/lustre: Remove struct ll_iattr green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 46/46] staging/lustre: lov_io_init() should return error code green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 25/46] staging/lustre/llite: rename ccc_device to vvp_device green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 08/46] staging/lustre/obdclass: Add a preallocated percpu cl_env green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 44/46] staging/lustre: Fix spacing style before open parenthesis green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 28/46] staging/lustre/llite: rename ccc_lock to vvp_lock green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 13/46] staging/lustre/llite: remove lli_lvb green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 41/46] staging/lustre/ldlm: ELC picks locks in a safer policy green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 40/46] staging/lustre/llite: Remove unused vui_local_lock field green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 12/46] staging/lustre/clio: optimize read ahead code green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 42/46] staging/lustre/ldlm: revert changes to ldlm_cancel_aged_policy() green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 39/46] staging/lustre/llite: Move several declarations to llite_internal.h green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 20/46] staging/lustre: update comments after cl_lock simplification green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 24/46] staging/lustre/llite: merge lclient.h into llite/vvp_internal.h green@linuxhacker.ru - 2016-03-31 02:00 +0200
  [PATCH v2 01/46] staging/lustre/obdclass: limit lu_site hash table size green@linuxhacker.ru - 2016-03-31 02:10 +0200
  [PATCH v2 02/46] staging/lustre: Get rid of CFS_PAGE_MASK green@linuxhacker.ru - 2016-03-31 02:10 +0200
  [PATCH v2 05/46] staging/lustre/osc: Adjustment on osc LRU for performance green@linuxhacker.ru - 2016-03-31 02:10 +0200

csiph-web