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 22:07:57 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2005-11-04 15:43:35 +08:00
|
|
|
#
|
|
|
|
# Makefile for the kernel block layer
|
|
|
|
#
|
|
|
|
|
2018-10-24 17:39:36 +08:00
|
|
|
obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-sysfs.o \
|
2010-09-03 17:56:16 +08:00
|
|
|
blk-flush.o blk-settings.o blk-ioc.o blk-map.o \
|
2020-06-11 14:44:41 +08:00
|
|
|
blk-exec.o blk-merge.o blk-timeout.o \
|
2016-11-08 12:32:37 +08:00
|
|
|
blk-lib.o blk-mq.o blk-mq-tag.o blk-stat.o \
|
2017-01-17 21:03:22 +08:00
|
|
|
blk-mq-sysfs.o blk-mq-cpumap.o blk-mq-sched.o ioctl.o \
|
2020-03-24 15:25:30 +08:00
|
|
|
genhd.o ioprio.o badblocks.o partitions/ blk-rq-qos.o
|
2005-11-04 15:43:35 +08:00
|
|
|
|
2017-01-28 16:32:51 +08:00
|
|
|
obj-$(CONFIG_BOUNCE) += bounce.o
|
|
|
|
obj-$(CONFIG_BLK_SCSI_REQUEST) += scsi_ioctl.o
|
2007-07-09 18:38:05 +08:00
|
|
|
obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
|
2011-08-01 04:05:09 +08:00
|
|
|
obj-$(CONFIG_BLK_DEV_BSGLIB) += bsg-lib.o
|
2009-12-04 01:59:42 +08:00
|
|
|
obj-$(CONFIG_BLK_CGROUP) += blk-cgroup.o
|
2019-11-08 03:18:04 +08:00
|
|
|
obj-$(CONFIG_BLK_CGROUP_RWSTAT) += blk-cgroup-rwstat.o
|
2010-09-16 05:06:35 +08:00
|
|
|
obj-$(CONFIG_BLK_DEV_THROTTLING) += blk-throttle.o
|
2018-07-03 23:15:01 +08:00
|
|
|
obj-$(CONFIG_BLK_CGROUP_IOLATENCY) += blk-iolatency.o
|
2019-08-29 06:05:58 +08:00
|
|
|
obj-$(CONFIG_BLK_CGROUP_IOCOST) += blk-iocost.o
|
2017-01-15 08:11:11 +08:00
|
|
|
obj-$(CONFIG_MQ_IOSCHED_DEADLINE) += mq-deadline.o
|
2017-04-14 16:00:02 +08:00
|
|
|
obj-$(CONFIG_MQ_IOSCHED_KYBER) += kyber-iosched.o
|
2017-04-19 22:48:24 +08:00
|
|
|
bfq-y := bfq-iosched.o bfq-wf2q.o bfq-cgroup.o
|
|
|
|
obj-$(CONFIG_IOSCHED_BFQ) += bfq.o
|
2006-03-24 03:00:26 +08:00
|
|
|
|
2013-10-01 04:45:19 +08:00
|
|
|
obj-$(CONFIG_BLK_CMDLINE_PARSER) += cmdline-parser.o
|
2019-12-23 16:13:51 +08:00
|
|
|
obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o
|
|
|
|
obj-$(CONFIG_BLK_DEV_INTEGRITY_T10) += t10-pi.o
|
2016-09-19 13:50:16 +08:00
|
|
|
obj-$(CONFIG_BLK_MQ_PCI) += blk-mq-pci.o
|
2017-02-06 01:15:24 +08:00
|
|
|
obj-$(CONFIG_BLK_MQ_VIRTIO) += blk-mq-virtio.o
|
2017-07-13 16:09:43 +08:00
|
|
|
obj-$(CONFIG_BLK_MQ_RDMA) += blk-mq-rdma.o
|
2016-10-18 14:40:33 +08: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-10 03:36:15 +08:00
|
|
|
obj-$(CONFIG_BLK_WBT) += blk-wbt.o
|
2017-01-28 06:03:01 +08:00
|
|
|
obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o
|
2018-06-16 05:55:21 +08:00
|
|
|
obj-$(CONFIG_BLK_DEBUG_FS_ZONED)+= blk-mq-debugfs-zoned.o
|
2017-02-04 03:50:31 +08:00
|
|
|
obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o
|
2018-09-27 05:01:03 +08: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 08:37:18 +08:00
|
|
|
obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += keyslot-manager.o blk-crypto.o
|
2020-05-14 08:37:20 +08:00
|
|
|
obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
|