linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Duncan <lduncan@suse.com>
To: <linux-scsi@vger.kernel.org>, <nab@linux-iscsi.org>,
	<target-devel@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <hch@infradead.org>,
	<hare@suse.de>, <agrover@redhat.com>, <jxm@netiant.com>,
	Lee Duncan <lduncan@suse.com>
Subject: [PATCH 2/2] target: use new "dbroot" target attribute
Date: Wed, 13 Apr 2016 13:25:56 -0700	[thread overview]
Message-ID: <4deb4b5219c4b30e18569380b82359f242f2a25b.1460577841.git.lduncan@suse.com> (raw)
In-Reply-To: <cover.1460577841.git.lduncan@suse.com>
In-Reply-To: <cover.1460577841.git.lduncan@suse.com>

This commit updates the target core ALUA and PR
modules to use the new "dbroot" attribute instead
of assuming the target database is in "/var/target".

Signed-off-by: Lee Duncan <lduncan@suse.com>
---
 drivers/target/target_core_alua.c | 6 +++---
 drivers/target/target_core_pr.c   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
index 49aba4a31747..4c82bbe19003 100644
--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -932,7 +932,7 @@ static int core_alua_update_tpg_primary_metadata(
 			tg_pt_gp->tg_pt_gp_alua_access_status);
 
 	snprintf(path, ALUA_METADATA_PATH_LEN,
-		"/var/target/alua/tpgs_%s/%s", &wwn->unit_serial[0],
+		"%s/alua/tpgs_%s/%s", db_root, &wwn->unit_serial[0],
 		config_item_name(&tg_pt_gp->tg_pt_gp_group.cg_item));
 
 	rc = core_alua_write_tpg_metadata(path, md_buf, len);
@@ -1275,8 +1275,8 @@ static int core_alua_update_tpg_secondary_metadata(struct se_lun *lun)
 			atomic_read(&lun->lun_tg_pt_secondary_offline),
 			lun->lun_tg_pt_secondary_stat);
 
-	snprintf(path, ALUA_METADATA_PATH_LEN, "/var/target/alua/%s/%s/lun_%llu",
-			se_tpg->se_tpg_tfo->get_fabric_name(), wwn,
+	snprintf(path, ALUA_METADATA_PATH_LEN, "%s/alua/%s/%s/lun_%llu",
+			db_root, se_tpg->se_tpg_tfo->get_fabric_name(), wwn,
 			lun->unpacked_lun);
 
 	rc = core_alua_write_tpg_metadata(path, md_buf, len);
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index b1795735eafc..47463c99c318 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -1985,7 +1985,7 @@ static int __core_scsi3_write_aptpl_to_file(
 		return -EMSGSIZE;
 	}
 
-	snprintf(path, 512, "/var/target/pr/aptpl_%s", &wwn->unit_serial[0]);
+	snprintf(path, 512, "%s/pr/aptpl_%s", db_root, &wwn->unit_serial[0]);
 	file = filp_open(path, flags, 0600);
 	if (IS_ERR(file)) {
 		pr_err("filp_open(%s) for APTPL metadata"
-- 
2.1.4

  parent reply	other threads:[~2016-04-13 20:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 20:25 [PATCHv2 0/2] target: make location of /var/targets configurable Lee Duncan
2016-04-13 20:25 ` [PATCHv2 1/2] target: make target db location configurable Lee Duncan
2016-04-14  6:10   ` Hannes Reinecke
2016-04-15  0:04     ` Lee Duncan
2016-04-13 20:25 ` Lee Duncan [this message]
2016-04-14  6:10   ` [PATCH 2/2] target: use new "dbroot" target attribute Hannes Reinecke

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=4deb4b5219c4b30e18569380b82359f242f2a25b.1460577841.git.lduncan@suse.com \
    --to=lduncan@suse.com \
    --cc=agrover@redhat.com \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=jxm@netiant.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.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 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).