Commit 55d7baa3 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

nvme-fc: don't support the appid attribute without CONFIG_BLK_CGROUP_FC_APPID

nvme-fc appid support needs CONFIG_BLK_CGROUP_FC_APPID to work, so disable
the whole code if the option is not set.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20220420042723.1010598-3-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2524a578
...@@ -3831,6 +3831,9 @@ static ssize_t nvme_fc_nvme_discovery_store(struct device *dev, ...@@ -3831,6 +3831,9 @@ static ssize_t nvme_fc_nvme_discovery_store(struct device *dev,
return count; return count;
} }
static DEVICE_ATTR(nvme_discovery, 0200, NULL, nvme_fc_nvme_discovery_store);
#ifdef CONFIG_BLK_CGROUP_FC_APPID
/* Parse the cgroup id from a buf and return the length of cgrpid */ /* Parse the cgroup id from a buf and return the length of cgrpid */
static int fc_parse_cgrpid(const char *buf, u64 *id) static int fc_parse_cgrpid(const char *buf, u64 *id)
{ {
...@@ -3898,12 +3901,14 @@ static ssize_t fc_appid_store(struct device *dev, ...@@ -3898,12 +3901,14 @@ static ssize_t fc_appid_store(struct device *dev,
return -EINVAL; return -EINVAL;
return count; return count;
} }
static DEVICE_ATTR(nvme_discovery, 0200, NULL, nvme_fc_nvme_discovery_store);
static DEVICE_ATTR(appid_store, 0200, NULL, fc_appid_store); static DEVICE_ATTR(appid_store, 0200, NULL, fc_appid_store);
#endif /* CONFIG_BLK_CGROUP_FC_APPID */
static struct attribute *nvme_fc_attrs[] = { static struct attribute *nvme_fc_attrs[] = {
&dev_attr_nvme_discovery.attr, &dev_attr_nvme_discovery.attr,
#ifdef CONFIG_BLK_CGROUP_FC_APPID
&dev_attr_appid_store.attr, &dev_attr_appid_store.attr,
#endif
NULL NULL
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment