linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Drokin, Oleg" <oleg.drokin@intel.com>
To: Shivani Bhardwaj <shivanib134@gmail.com>
Cc: "<gregkh@linuxfoundation.org>" <gregkh@linuxfoundation.org>,
	"Dilger, Andreas" <andreas.dilger@intel.com>,
	"<devel@driverdev.osuosl.org>" <devel@driverdev.osuosl.org>,
	"<linux-kernel@vger.kernel.org>" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/9] Staging: lustre: dir: Replace function calls
Date: Mon, 9 Nov 2015 11:07:30 +0000	[thread overview]
Message-ID: <2B48387D-9D06-4FEB-B8A0-53EEC28EC9A4@intel.com> (raw)
In-Reply-To: <504dcfb03fcd3e1f0675efbbe8f1e572a9ce58f7.1446881645.git.shivanib134@gmail.com>


On Nov 7, 2015, at 2:41 AM, Shivani Bhardwaj wrote:

> Replace the calls of the function ll_finish_md_op_data() with the
> standard function kfree().

For functions like this that have meaningflul name and also
might include additional logic (even though they don't now),
does it make sense to do this?

I don't feel this is a case of "lustre_specific_kfree_wrapper()"
elimination.
Same for some other wrappers being eliminated, those looked
at times as a way to improve code readability to me.

> 
> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> ---
> drivers/staging/lustre/lustre/llite/dir.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
> index 5c2ef92..ba3f469 100644
> --- a/drivers/staging/lustre/lustre/llite/dir.c
> +++ b/drivers/staging/lustre/lustre/llite/dir.c
> @@ -182,7 +182,7 @@ static int ll_dir_filler(void *_hash, struct page *page0)
> 	op_data->op_npages = npages;
> 	op_data->op_offset = hash;
> 	rc = md_readpage(exp, op_data, page_pool, &request);
> -	ll_finish_md_op_data(op_data);
> +	kfree(op_data);
> 	if (rc < 0) {
> 		/* page0 is special, which was added into page cache early */
> 		delete_from_page_cache(page0);
> @@ -363,7 +363,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
> 		rc = md_enqueue(ll_i2sbi(dir)->ll_md_exp, &einfo, &it,
> 				op_data, &lockh, NULL, 0, NULL, 0);
> 
> -		ll_finish_md_op_data(op_data);
> +		kfree(op_data);
> 
> 		request = (struct ptlrpc_request *)it.d.lustre.it_data;
> 		if (request)
> @@ -669,7 +669,7 @@ static int ll_dir_setdirstripe(struct inode *dir, struct lmv_user_md *lump,
> 			from_kuid(&init_user_ns, current_fsuid()),
> 			from_kgid(&init_user_ns, current_fsgid()),
> 			cfs_curproc_cap_pack(), 0, &request);
> -	ll_finish_md_op_data(op_data);
> +	kfree(op_data);
> 	if (err)
> 		goto err_exit;
> err_exit:
> @@ -730,7 +730,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
> 	/* swabbing is done in lov_setstripe() on server side */
> 	rc = md_setattr(sbi->ll_md_exp, op_data, lump, lum_size,
> 			NULL, 0, &req, NULL);
> -	ll_finish_md_op_data(op_data);
> +	kfree(op_data);
> 	ptlrpc_req_finished(req);
> 	if (rc) {
> 		if (rc != -EPERM && rc != -EACCES)
> @@ -802,7 +802,7 @@ int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmmp,
> 
> 	op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
> 	rc = md_getattr(sbi->ll_md_exp, op_data, &req);
> -	ll_finish_md_op_data(op_data);
> +	kfree(op_data);
> 	if (rc < 0) {
> 		CDEBUG(D_INFO, "md_getattr failed on inode %lu/%u: rc %d\n",
> 		       inode->i_ino,
> @@ -868,7 +868,7 @@ int ll_get_mdt_idx(struct inode *inode)
> 	op_data->op_flags |= MF_GET_MDT_IDX;
> 	rc = md_getattr(sbi->ll_md_exp, op_data, NULL);
> 	mdtidx = op_data->op_mds;
> -	ll_finish_md_op_data(op_data);
> +	kfree(op_data);
> 	if (rc < 0) {
> 		CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
> 		return rc;
> @@ -1301,7 +1301,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> 
> 		op_data->op_valid = OBD_MD_FLID;
> 		rc = md_getattr_name(sbi->ll_md_exp, op_data, &request);
> -		ll_finish_md_op_data(op_data);
> +		kfree(op_data);
> 		if (rc < 0) {
> 			CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
> 			goto out_free;
> -- 
> 2.1.0
> 


  reply	other threads:[~2015-11-09 11:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07  7:40 [PATCH 0/9] Remove wrapper function and tidy up the code Shivani Bhardwaj
2015-11-07  7:41 ` [PATCH 1/9] Staging: lustre: dir: Replace function calls Shivani Bhardwaj
2015-11-09 11:07   ` Drokin, Oleg [this message]
2015-11-09 12:28     ` Dan Carpenter
2015-11-07  7:42 ` [PATCH 2/9] Staging: lustre: file: Replace function calls with standard function Shivani Bhardwaj
2015-11-07  7:43 ` [PATCH 3/9] Staging: lustre: namei: Replace calls with kfree Shivani Bhardwaj
2015-11-07  7:44 ` [PATCH 4/9] Staging: lustre: xattr_cache: Change function calls Shivani Bhardwaj
2015-11-07  7:44 ` [PATCH 5/9] Staging: lustre: symlink: Substitute standard function Shivani Bhardwaj
2015-11-07  7:45 ` [PATCH 6/9] Staging: lustre: llite_nfs: Replace with " Shivani Bhardwaj
2015-11-07  7:45 ` [PATCH 7/9] Staging: lustre: llite_close: Substitute function calls Shivani Bhardwaj
2015-11-07  7:46 ` [PATCH 8/9] Staging: lustre: llite_lib: Remove wrapper function Shivani Bhardwaj
2015-11-09 13:37   ` Michał Kępień
2015-11-09 16:35     ` Shivani Bhardwaj
2015-11-09 19:18       ` Simmons, James A.
2015-11-10  3:08         ` Shivani Bhardwaj
2015-11-07  7:47 ` [PATCH 9/9] Staging: lustre: llite_internal: Remove function prototype Shivani Bhardwaj
2015-11-07 10:45   ` Dan Carpenter
2015-11-07 15:29     ` Shivani Bhardwaj
2015-11-07 20:47       ` Dan Carpenter
2015-11-08  8:29         ` Shivani Bhardwaj

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=2B48387D-9D06-4FEB-B8A0-53EEC28EC9A4@intel.com \
    --to=oleg.drokin@intel.com \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shivanib134@gmail.com \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).