]> www.infradead.org Git - users/hch/block.git/commitdiff
nvme-fc: don't support the appid attribute without CONFIG_BLK_CGROUP_FC_APPID
authorChristoph Hellwig <hch@lst.de>
Tue, 19 Apr 2022 05:11:42 +0000 (07:11 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 19 Apr 2022 14:41:56 +0000 (16:41 +0200)
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: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fc.c

index 080f85f4105f3dc7a1d9215175727414ef9ed8f5..caa0fff7bf1f567ff33985d3a52d957a2c9720f2 100644 (file)
@@ -3831,6 +3831,9 @@ process_local_list:
        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 */
 static int fc_parse_cgrpid(const char *buf, u64 *id)
 {
@@ -3898,12 +3901,14 @@ static ssize_t fc_appid_store(struct device *dev,
                return -EINVAL;
        return count;
 }
-static DEVICE_ATTR(nvme_discovery, 0200, NULL, nvme_fc_nvme_discovery_store);
 static DEVICE_ATTR(appid_store, 0200, NULL, fc_appid_store);
+#endif /* CONFIG_BLK_CGROUP_FC_APPID */
 
 static struct attribute *nvme_fc_attrs[] = {
        &dev_attr_nvme_discovery.attr,
+#ifdef CONFIG_BLK_CGROUP_FC_APPID
        &dev_attr_appid_store.attr,
+#endif
        NULL
 };