License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2005-11-04 07:43:35 +00:00
|
|
|
#
|
|
|
|
# Makefile for the kernel block layer
|
|
|
|
#
|
|
|
|
|
2018-10-24 09:39:36 +00:00
|
|
|
obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-sysfs.o \
|
2010-09-03 09:56:16 +00:00
|
|
|
blk-flush.o blk-settings.o blk-ioc.o blk-map.o \
|
2020-06-11 06:44:41 +00:00
|
|
|
blk-exec.o blk-merge.o blk-timeout.o \
|
2016-11-08 04:32:37 +00:00
|
|
|
blk-lib.o blk-mq.o blk-mq-tag.o blk-stat.o \
|
2017-01-17 13:03:22 +00:00
|
|
|
blk-mq-sysfs.o blk-mq-cpumap.o blk-mq-sched.o ioctl.o \
|
2020-03-24 07:25:30 +00:00
|
|
|
genhd.o ioprio.o badblocks.o partitions/ blk-rq-qos.o
|
2005-11-04 07:43:35 +00:00
|
|
|
|
2017-01-28 08:32:51 +00:00
|
|
|
obj-$(CONFIG_BOUNCE) += bounce.o
|
|
|
|
obj-$(CONFIG_BLK_SCSI_REQUEST) += scsi_ioctl.o
|
2007-07-09 10:38:05 +00:00
|
|
|
obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
|
2011-07-31 20:05:09 +00:00
|
|
|
obj-$(CONFIG_BLK_DEV_BSGLIB) += bsg-lib.o
|
2009-12-03 17:59:42 +00:00
|
|
|
obj-$(CONFIG_BLK_CGROUP) += blk-cgroup.o
|
2019-11-07 19:18:04 +00:00
|
|
|
obj-$(CONFIG_BLK_CGROUP_RWSTAT) += blk-cgroup-rwstat.o
|
2010-09-15 21:06:35 +00:00
|
|
|
obj-$(CONFIG_BLK_DEV_THROTTLING) += blk-throttle.o
|
2021-06-18 00:44:44 +00:00
|
|
|
obj-$(CONFIG_BLK_CGROUP_IOPRIO) += blk-ioprio.o
|
2018-07-03 15:15:01 +00:00
|
|
|
obj-$(CONFIG_BLK_CGROUP_IOLATENCY) += blk-iolatency.o
|
2019-08-28 22:05:58 +00:00
|
|
|
obj-$(CONFIG_BLK_CGROUP_IOCOST) += blk-iocost.o
|
2017-01-15 00:11:11 +00:00
|
|
|
obj-$(CONFIG_MQ_IOSCHED_DEADLINE) += mq-deadline.o
|
2021-06-18 00:44:55 +00:00
|
|
|
mq-deadline-y += mq-deadline-main.o
|
|
|
|
mq-deadline-$(CONFIG_MQ_IOSCHED_DEADLINE_CGROUP)+= mq-deadline-cgroup.o
|
2017-04-14 08:00:02 +00:00
|
|
|
obj-$(CONFIG_MQ_IOSCHED_KYBER) += kyber-iosched.o
|
2017-04-19 14:48:24 +00:00
|
|
|
bfq-y := bfq-iosched.o bfq-wf2q.o bfq-cgroup.o
|
|
|
|
obj-$(CONFIG_IOSCHED_BFQ) += bfq.o
|
2006-03-23 19:00:26 +00:00
|
|
|
|
2013-09-30 20:45:19 +00:00
|
|
|
obj-$(CONFIG_BLK_CMDLINE_PARSER) += cmdline-parser.o
|
2019-12-23 08:13:51 +00:00
|
|
|
obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o
|
|
|
|
obj-$(CONFIG_BLK_DEV_INTEGRITY_T10) += t10-pi.o
|
2016-09-19 05:50:16 +00:00
|
|
|
obj-$(CONFIG_BLK_MQ_PCI) += blk-mq-pci.o
|
2017-02-05 17:15:24 +00:00
|
|
|
obj-$(CONFIG_BLK_MQ_VIRTIO) += blk-mq-virtio.o
|
2017-07-13 08:09:43 +00:00
|
|
|
obj-$(CONFIG_BLK_MQ_RDMA) += blk-mq-rdma.o
|
2016-10-18 06:40:33 +00:00
|
|
|
obj-$(CONFIG_BLK_DEV_ZONED) += blk-zoned.o
|
blk-wbt: add general throttling mechanism
We can hook this up to the block layer, to help throttle buffered
writes.
wbt registers a few trace points that can be used to track what is
happening in the system:
wbt_lat: 259:0: latency 2446318
wbt_stat: 259:0: rmean=2446318, rmin=2446318, rmax=2446318, rsamples=1,
wmean=518866, wmin=15522, wmax=5330353, wsamples=57
wbt_step: 259:0: step down: step=1, window=72727272, background=8, normal=16, max=32
This shows a sync issue event (wbt_lat) that exceeded it's time. wbt_stat
dumps the current read/write stats for that window, and wbt_step shows a
step down event where we now scale back writes. Each trace includes the
device, 259:0 in this case.
Signed-off-by: Jens Axboe <axboe@fb.com>
2016-11-09 19:36:15 +00:00
|
|
|
obj-$(CONFIG_BLK_WBT) += blk-wbt.o
|
2017-01-27 22:03:01 +00:00
|
|
|
obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o
|
2018-06-15 21:55:21 +00:00
|
|
|
obj-$(CONFIG_BLK_DEBUG_FS_ZONED)+= blk-mq-debugfs-zoned.o
|
2017-02-03 19:50:31 +00:00
|
|
|
obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o
|
2018-09-26 21:01:03 +00:00
|
|
|
obj-$(CONFIG_BLK_PM) += blk-pm.o
|
block: Inline encryption support for blk-mq
We must have some way of letting a storage device driver know what
encryption context it should use for en/decrypting a request. However,
it's the upper layers (like the filesystem/fscrypt) that know about and
manages encryption contexts. As such, when the upper layer submits a bio
to the block layer, and this bio eventually reaches a device driver with
support for inline encryption, the device driver will need to have been
told the encryption context for that bio.
We want to communicate the encryption context from the upper layer to the
storage device along with the bio, when the bio is submitted to the block
layer. To do this, we add a struct bio_crypt_ctx to struct bio, which can
represent an encryption context (note that we can't use the bi_private
field in struct bio to do this because that field does not function to pass
information across layers in the storage stack). We also introduce various
functions to manipulate the bio_crypt_ctx and make the bio/request merging
logic aware of the bio_crypt_ctx.
We also make changes to blk-mq to make it handle bios with encryption
contexts. blk-mq can merge many bios into the same request. These bios need
to have contiguous data unit numbers (the necessary changes to blk-merge
are also made to ensure this) - as such, it suffices to keep the data unit
number of just the first bio, since that's all a storage driver needs to
infer the data unit number to use for each data block in each bio in a
request. blk-mq keeps track of the encryption context to be used for all
the bios in a request with the request's rq_crypt_ctx. When the first bio
is added to an empty request, blk-mq will program the encryption context
of that bio into the request_queue's keyslot manager, and store the
returned keyslot in the request's rq_crypt_ctx. All the functions to
operate on encryption contexts are in blk-crypto.c.
Upper layers only need to call bio_crypt_set_ctx with the encryption key,
algorithm and data_unit_num; they don't have to worry about getting a
keyslot for each encryption context, as blk-mq/blk-crypto handles that.
Blk-crypto also makes it possible for request-based layered devices like
dm-rq to make use of inline encryption hardware by cloning the
rq_crypt_ctx and programming a keyslot in the new request_queue when
necessary.
Note that any user of the block layer can submit bios with an
encryption context, such as filesystems, device-mapper targets, etc.
Signed-off-by: Satya Tangirala <satyat@google.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-14 00:37:18 +00:00
|
|
|
obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += keyslot-manager.o blk-crypto.o
|
2020-05-14 00:37:20 +00:00
|
|
|
obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
|