mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Javier González" <jg@lightnvm.io>
To: mb@lightnvm.io
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	"Javier González" <javier@cnexlabs.com>
Subject: [PATCH 1/2] lightnvm: free metadata dma on rrpc when needed
Date: Tue, 26 Apr 2016 16:35:18 +0200	[thread overview]
Message-ID: <1461681318-29571-3-git-send-email-javier@javigon.com> (raw)
In-Reply-To: <1461681318-29571-1-git-send-email-javier@javigon.com>

rrpc has assumed that medatada is always sent as a dma buffer to the
device. When this is not true, do not attempt to free a non-allocated
dma region.

Signed-off-by: Javier González <javier@cnexlabs.com>
---
 drivers/lightnvm/rrpc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index a9a5fcc..ba789c3 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -707,10 +707,12 @@ static void rrpc_end_io(struct nvm_rq *rqd)
 
 	rrpc_unlock_rq(rrpc, rqd);
 
-	if (npages > 1)
+	if (npages > 1) {
 		nvm_dev_dma_free(rrpc->dev, rqd->ppa_list, rqd->dma_ppa_list);
-	if (rqd->metadata)
-		nvm_dev_dma_free(rrpc->dev, rqd->metadata, rqd->dma_metadata);
+		if (rqd->meta_list)
+			nvm_dev_dma_free(rrpc->dev, rqd->meta_list,
+							rqd->dma_meta_list);
+	}
 
 	mempool_free(rqd, rrpc->rq_pool);
 }
-- 
2.5.0

      parent reply	other threads:[~2016-04-26 14:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26 14:35 [PATCH] lightnvm: introduce ADDR_PADDED to signal padding Javier González
2016-04-26 14:35 ` [PATCH 2/2] lightnvm: enable metadata to be sent to device Javier González
2016-04-26 14:35 ` Javier González [this message]

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=1461681318-29571-3-git-send-email-javier@javigon.com \
    --to=jg@lightnvm.io \
    --cc=javier@cnexlabs.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mb@lightnvm.io \
    /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

all inboxes | Powered by JetHome®