All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH 21/28] lustre: llite: enhance vvp_dev data structure naming
Date: Sat, 20 Oct 2018 19:55:41 +0100 (BST)	[thread overview]
Message-ID: <alpine.LFD.2.21.1810201952370.16676@casper.infradead.org> (raw)
In-Reply-To: <877eigc85g.fsf@notabene.neil.brown.name>


> On Sun, Oct 14 2018, James Simmons wrote:
> 
> > The new code that added struct seq_private to the vvp_dev.c code
> > has very generic naming which doesn't fit the lustre / kernel style.
> > See http://wiki.lustre.org/Lustre_Coding_Style_Guidelines for the
> > naming conventions. Rename the struct seq_private and it fields.
> 
> The guidelines say:
> 
>   unique member names for global structures, using a prefix to identify
>   the parent structure type, helps readability.
> 
> As this structure is local to vvp_dev.c, I don't think of it as a
> "global structure" and so I don't think the rule applies.
> 
> But I don't really care.

The gudeline needs to be updated to state "member names for all 
structures". Some lustre developers handle style issues as strictly
as Greg did in staging. It's just a different flavor :-) 

To let you know your dump cache tree walk patch in lustre-wip landed
to OpenSFS tree. I plan to push another set of patches and I can
included it with the reviews.

> > Signed-off-by: James Simmons <uja.ornl@yahoo.com>
> > WC-bug-id: https://jira.whamcloud.com/browse/LU-8066
> > Reviewed-on: https://review.whamcloud.com/33009
> > Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
> > Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
> > Signed-off-by: James Simmons <jsimmons@infradead.org>
> > ---
> >  drivers/staging/lustre/lustre/llite/vvp_dev.c | 54 ++++++++++++++-------------
> >  1 file changed, 28 insertions(+), 26 deletions(-)
> >
> > diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c
> > index 31dc3c0..8cc981b 100644
> > --- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
> > +++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
> > @@ -391,11 +391,11 @@ struct vvp_pgcache_id {
> >  	struct lu_object_header *vpi_obj;
> >  };
> >  
> > -struct seq_private {
> > -	struct ll_sb_info	*sbi;
> > -	struct lu_env		*env;
> > -	u16			refcheck;
> > -	struct cl_object	*clob;
> > +struct vvp_seq_private {
> > +	struct ll_sb_info	*vsp_sbi;
> > +	struct lu_env		*vsp_env;
> > +	u16			vsp_refcheck;
> > +	struct cl_object	*vsp_clob;
> >  };
> >  
> >  static void vvp_pgcache_id_unpack(loff_t pos, struct vvp_pgcache_id *id)
> > @@ -542,52 +542,54 @@ static void vvp_pgcache_page_show(const struct lu_env *env,
> >  
> >  static int vvp_pgcache_show(struct seq_file *f, void *v)
> >  {
> > -	struct seq_private	*priv = f->private;
> > +	struct vvp_seq_private *priv = f->private;
> >  	struct page		*vmpage = v;
> >  	struct cl_page		*page;
> >  
> >  	seq_printf(f, "%8lx@" DFID ": ", vmpage->index,
> > -		   PFID(lu_object_fid(&priv->clob->co_lu)));
> > +		   PFID(lu_object_fid(&priv->vsp_clob->co_lu)));
> >  	lock_page(vmpage);
> > -	page = cl_vmpage_page(vmpage, priv->clob);
> > +	page = cl_vmpage_page(vmpage, priv->vsp_clob);
> >  	unlock_page(vmpage);
> >  	put_page(vmpage);
> >  
> >  	if (page) {
> > -		vvp_pgcache_page_show(priv->env, f, page);
> > -		cl_page_put(priv->env, page);
> > +		vvp_pgcache_page_show(priv->vsp_env, f, page);
> > +		cl_page_put(priv->vsp_env, page);
> >  	} else {
> >  		seq_puts(f, "missing\n");
> >  	}
> > -	lu_object_ref_del(&priv->clob->co_lu, "dump", current);
> > -	cl_object_put(priv->env, priv->clob);
> > +	lu_object_ref_del(&priv->vsp_clob->co_lu, "dump", current);
> > +	cl_object_put(priv->vsp_env, priv->vsp_clob);
> >  
> >  	return 0;
> >  }
> >  
> >  static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos)
> >  {
> > -	struct seq_private	*priv = f->private;
> > +	struct vvp_seq_private *priv = f->private;
> >  	struct page *ret;
> >  
> > -	if (priv->sbi->ll_site->ls_obj_hash->hs_cur_bits >
> > +	if (priv->vsp_sbi->ll_site->ls_obj_hash->hs_cur_bits >
> >  	    64 - PGC_OBJ_SHIFT)
> >  		ret = ERR_PTR(-EFBIG);
> >  	else
> > -		ret = vvp_pgcache_find(priv->env, &priv->sbi->ll_cl->cd_lu_dev,
> > -				       &priv->clob, pos);
> > +		ret = vvp_pgcache_find(priv->vsp_env,
> > +				       &priv->vsp_sbi->ll_cl->cd_lu_dev,
> > +				       &priv->vsp_clob, pos);
> >  
> >  	return ret;
> >  }
> >  
> >  static void *vvp_pgcache_next(struct seq_file *f, void *v, loff_t *pos)
> >  {
> > -	struct seq_private *priv = f->private;
> > +	struct vvp_seq_private *priv = f->private;
> >  	struct page *ret;
> >  
> >  	*pos += 1;
> > -	ret = vvp_pgcache_find(priv->env, &priv->sbi->ll_cl->cd_lu_dev,
> > -			       &priv->clob, pos);
> > +	ret = vvp_pgcache_find(priv->vsp_env,
> > +			       &priv->vsp_sbi->ll_cl->cd_lu_dev,
> > +			       &priv->vsp_clob, pos);
> >  	return ret;
> >  }
> >  
> > @@ -605,16 +607,16 @@ static void vvp_pgcache_stop(struct seq_file *f, void *v)
> >  
> >  static int vvp_dump_pgcache_seq_open(struct inode *inode, struct file *filp)
> >  {
> > -	struct seq_private *priv;
> > +	struct vvp_seq_private *priv;
> >  
> >  	priv = __seq_open_private(filp, &vvp_pgcache_ops, sizeof(*priv));
> >  	if (!priv)
> >  		return -ENOMEM;
> >  
> > -	priv->sbi = inode->i_private;
> > -	priv->env = cl_env_get(&priv->refcheck);
> > -	if (IS_ERR(priv->env)) {
> > -		int err = PTR_ERR(priv->env);
> > +	priv->vsp_sbi = inode->i_private;
> > +	priv->vsp_env = cl_env_get(&priv->vsp_refcheck);
> > +	if (IS_ERR(priv->vsp_env)) {
> > +		int err = PTR_ERR(priv->vsp_env);
> >  
> >  		seq_release_private(inode, filp);
> >  		return err;
> > @@ -625,9 +627,9 @@ static int vvp_dump_pgcache_seq_open(struct inode *inode, struct file *filp)
> >  static int vvp_dump_pgcache_seq_release(struct inode *inode, struct file *file)
> >  {
> >  	struct seq_file *seq = file->private_data;
> > -	struct seq_private *priv = seq->private;
> > +	struct vvp_seq_private *priv = seq->private;
> >  
> > -	cl_env_put(priv->env, &priv->refcheck);
> > +	cl_env_put(priv->vsp_env, &priv->vsp_refcheck);
> >  	return seq_release_private(inode, file);
> >  }
> >  
> > -- 
> > 1.8.3.1
> 

  reply	other threads:[~2018-10-20 18:55 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-14 18:57 [lustre-devel] [PATCH 00/28] lustre: more assorted fixes for lustre 2.10 James Simmons
2018-10-14 18:57 ` [lustre-devel] [PATCH 01/28] lustre: osc: osc_extent_tree_dump0() implementation is suboptimal James Simmons
2018-10-14 18:57 ` [lustre-devel] [PATCH 02/28] lustre: llite: Read ahead should return pages read James Simmons
2018-10-14 18:57 ` [lustre-devel] [PATCH 03/28] lustre: ptlrpc: missing barrier before wake_up James Simmons
2018-10-17 22:43   ` NeilBrown
2018-10-21 22:48     ` James Simmons
2018-10-14 18:57 ` [lustre-devel] [PATCH 04/28] lustre: ptlrpc: Do not assert when bd_nob_transferred != 0 James Simmons
2018-10-17 23:13   ` NeilBrown
2018-10-21 22:44     ` James Simmons
2018-10-22  3:26       ` NeilBrown
2018-11-04 21:29         ` James Simmons
2018-11-04 23:59           ` NeilBrown
2018-10-14 18:57 ` [lustre-devel] [PATCH 05/28] lustre: uapi: add back LUSTRE_MAXFSNAME to lustre_user.h James Simmons
2018-10-14 18:57 ` [lustre-devel] [PATCH 06/28] lustre: ldlm: ELC shouldn't wait on lock flush James Simmons
2018-10-17 23:20   ` NeilBrown
2018-10-20 17:09     ` James Simmons
2018-10-22  3:44       ` NeilBrown
2018-10-14 18:57 ` [lustre-devel] [PATCH 07/28] lustre: llite: pipeline readahead better with large I/O James Simmons
2018-10-14 18:57 ` [lustre-devel] [PATCH 08/28] lustre: hsm: add kkuc before sending registration RPCs James Simmons
2018-10-14 18:57 ` [lustre-devel] [PATCH 09/28] lustre: mdc: improve mdc_enqueue() error message James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 10/28] lustre: llite: Update i_nlink on unlink James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 11/28] lustre: llite: use security context if it's enabled in the kernel James Simmons
2018-10-17 23:34   ` NeilBrown
2018-10-20 17:49     ` James Simmons
2018-10-22  3:47       ` NeilBrown
2018-10-23 23:07         ` James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 12/28] lustre: ptlrpc: do not wakeup every second James Simmons
2018-10-29  0:03   ` NeilBrown
2018-10-29  1:35     ` Patrick Farrell
2018-10-29  2:41       ` NeilBrown
2018-10-29  3:42         ` James Simmons
2018-10-29 14:17           ` Patrick Farrell
2018-11-04 20:53         ` James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 13/28] lustre: ldlm: check lock cancellation in ldlm_cli_cancel() James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 14/28] lustre: ptlrpc: handle case of epp_free_pages <= PTLRPC_MAX_BRW_PAGES James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 15/28] lustre: llite: fix for stat under kthread and X86_X32 James Simmons
2018-10-18  1:48   ` NeilBrown
2018-10-22  3:58     ` NeilBrown
2018-11-04 21:35       ` James Simmons
2018-11-05  0:03         ` NeilBrown
2018-10-14 18:58 ` [lustre-devel] [PATCH 16/28] lustre: statahead: missing barrier before wake_up James Simmons
2018-10-18  2:00   ` NeilBrown
2018-10-21 22:52     ` James Simmons
2018-10-22  4:04       ` NeilBrown
2018-11-04 20:52         ` James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 17/28] lustre: ldlm: Make lru clear always discard read lock pages James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 18/28] lustre: mdc: expose changelog through char devices James Simmons
2018-10-30  6:41   ` NeilBrown
2018-11-04 21:31     ` James Simmons
2018-11-05  0:13       ` NeilBrown
2018-10-14 18:58 ` [lustre-devel] [PATCH 19/28] lustre: uapi: add missing headers in lustre UAPI headers James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 20/28] lustre: obdclass: deprecate OBD_GET_VERSION ioctl James Simmons
2018-10-18  2:12   ` NeilBrown
2018-10-20 18:52     ` James Simmons
2018-10-22  4:08       ` NeilBrown
2018-10-14 18:58 ` [lustre-devel] [PATCH 21/28] lustre: llite: enhance vvp_dev data structure naming James Simmons
2018-10-18  2:15   ` NeilBrown
2018-10-20 18:55     ` James Simmons [this message]
2018-10-14 18:58 ` [lustre-devel] [PATCH 22/28] lustre: clio: update spare bit handling James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 23/28] lustre: llog: fix EOF handling in llog_client_next_block() James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 24/28] lustre: llite: IO accounting of page read James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 25/28] lustre: llite: disable statahead if starting statahead fail James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 26/28] lustre: mdc: set correct body eadatasize for getxattr() James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 27/28] lustre: llite: control concurrent statahead instances James Simmons
2018-10-14 18:58 ` [lustre-devel] [PATCH 28/28] lustre: llite: restore lld_nfs_dentry handling James Simmons
2018-10-22  4:36 ` [lustre-devel] [PATCH 00/28] lustre: more assorted fixes for lustre 2.10 NeilBrown
2018-10-23 22:34   ` [lustre-devel] [PATCH] lustre: lu_object: fix possible hang waiting for LCS_LEAVING NeilBrown
2018-10-29  3:31     ` James Simmons
2018-10-29  4:31       ` NeilBrown

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=alpine.LFD.2.21.1810201952370.16676@casper.infradead.org \
    --to=jsimmons@infradead.org \
    --cc=lustre-devel@lists.lustre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.