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 21:07:57 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* linux/fs/nfs/callback.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004 Trond Myklebust
|
|
|
|
*
|
|
|
|
* NFSv4 callback definitions
|
|
|
|
*/
|
|
|
|
#ifndef __LINUX_FS_NFS_CALLBACK_H
|
|
|
|
#define __LINUX_FS_NFS_CALLBACK_H
|
2011-01-25 22:38:01 +07:00
|
|
|
#include <linux/sunrpc/svc.h>
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
#define NFS4_CALLBACK 0x40000000
|
|
|
|
#define NFS4_CALLBACK_XDRSIZE 2048
|
|
|
|
#define NFS4_CALLBACK_BUFSIZE (1024 + NFS4_CALLBACK_XDRSIZE)
|
|
|
|
|
|
|
|
enum nfs4_callback_procnum {
|
|
|
|
CB_NULL = 0,
|
|
|
|
CB_COMPOUND = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum nfs4_callback_opnum {
|
|
|
|
OP_CB_GETATTR = 3,
|
|
|
|
OP_CB_RECALL = 4,
|
2009-04-01 20:23:21 +07:00
|
|
|
/* Callback operations new to NFSv4.1 */
|
|
|
|
OP_CB_LAYOUTRECALL = 5,
|
|
|
|
OP_CB_NOTIFY = 6,
|
|
|
|
OP_CB_PUSH_DELEG = 7,
|
|
|
|
OP_CB_RECALL_ANY = 8,
|
|
|
|
OP_CB_RECALLABLE_OBJ_AVAIL = 9,
|
|
|
|
OP_CB_RECALL_SLOT = 10,
|
|
|
|
OP_CB_SEQUENCE = 11,
|
|
|
|
OP_CB_WANTS_CANCELLED = 12,
|
|
|
|
OP_CB_NOTIFY_LOCK = 13,
|
2009-04-01 20:23:22 +07:00
|
|
|
OP_CB_NOTIFY_DEVICEID = 14,
|
2013-06-05 22:15:02 +07:00
|
|
|
/* Callback operations new to NFSv4.2 */
|
|
|
|
OP_CB_OFFLOAD = 15,
|
2005-04-17 05:20:36 +07:00
|
|
|
OP_CB_ILLEGAL = 10044,
|
|
|
|
};
|
|
|
|
|
2016-01-24 03:18:18 +07:00
|
|
|
struct nfs4_slot;
|
2011-01-06 09:04:32 +07:00
|
|
|
struct cb_process_state {
|
|
|
|
__be32 drc_status;
|
|
|
|
struct nfs_client *clp;
|
2016-01-24 03:18:18 +07:00
|
|
|
struct nfs4_slot *slot;
|
2013-06-05 22:15:01 +07:00
|
|
|
u32 minorversion;
|
2012-01-26 18:11:49 +07:00
|
|
|
struct net *net;
|
2011-01-06 09:04:32 +07:00
|
|
|
};
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
struct cb_compound_hdr_arg {
|
2007-05-15 04:20:41 +07:00
|
|
|
unsigned int taglen;
|
2005-04-17 05:20:36 +07:00
|
|
|
const char *tag;
|
2009-04-01 20:23:19 +07:00
|
|
|
unsigned int minorversion;
|
2011-01-06 09:04:32 +07:00
|
|
|
unsigned int cb_ident; /* v4.0 callback identifier */
|
2005-04-17 05:20:36 +07:00
|
|
|
unsigned nops;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct cb_compound_hdr_res {
|
2006-10-20 13:28:51 +07:00
|
|
|
__be32 *status;
|
2007-05-15 04:20:41 +07:00
|
|
|
unsigned int taglen;
|
2005-04-17 05:20:36 +07:00
|
|
|
const char *tag;
|
2006-10-20 13:28:51 +07:00
|
|
|
__be32 *nops;
|
2005-04-17 05:20:36 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct cb_getattrargs {
|
|
|
|
struct nfs_fh fh;
|
|
|
|
uint32_t bitmap[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct cb_getattrres {
|
2006-10-20 13:28:50 +07:00
|
|
|
__be32 status;
|
2005-04-17 05:20:36 +07:00
|
|
|
uint32_t bitmap[2];
|
|
|
|
uint64_t size;
|
|
|
|
uint64_t change_attr;
|
2019-10-05 03:46:53 +07:00
|
|
|
struct timespec64 ctime;
|
|
|
|
struct timespec64 mtime;
|
2005-04-17 05:20:36 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct cb_recallargs {
|
|
|
|
struct nfs_fh fh;
|
|
|
|
nfs4_stateid stateid;
|
|
|
|
uint32_t truncate;
|
|
|
|
};
|
|
|
|
|
2009-04-01 20:23:24 +07:00
|
|
|
#if defined(CONFIG_NFS_V4_1)
|
|
|
|
|
|
|
|
struct referring_call {
|
|
|
|
uint32_t rc_sequenceid;
|
|
|
|
uint32_t rc_slotid;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct referring_call_list {
|
|
|
|
struct nfs4_sessionid rcl_sessionid;
|
|
|
|
uint32_t rcl_nrefcalls;
|
|
|
|
struct referring_call *rcl_refcalls;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct cb_sequenceargs {
|
2009-04-01 20:23:30 +07:00
|
|
|
struct sockaddr *csa_addr;
|
2009-04-01 20:23:24 +07:00
|
|
|
struct nfs4_sessionid csa_sessionid;
|
|
|
|
uint32_t csa_sequenceid;
|
|
|
|
uint32_t csa_slotid;
|
|
|
|
uint32_t csa_highestslotid;
|
|
|
|
uint32_t csa_cachethis;
|
|
|
|
uint32_t csa_nrclists;
|
|
|
|
struct referring_call_list *csa_rclists;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct cb_sequenceres {
|
2009-04-01 20:23:30 +07:00
|
|
|
__be32 csr_status;
|
2009-04-01 20:23:24 +07:00
|
|
|
struct nfs4_sessionid csr_sessionid;
|
|
|
|
uint32_t csr_sequenceid;
|
|
|
|
uint32_t csr_slotid;
|
|
|
|
uint32_t csr_highestslotid;
|
|
|
|
uint32_t csr_target_highestslotid;
|
|
|
|
};
|
|
|
|
|
2017-05-11 14:22:18 +07:00
|
|
|
extern __be32 nfs4_callback_sequence(void *argp, void *resp,
|
2011-01-06 09:04:32 +07:00
|
|
|
struct cb_process_state *cps);
|
2009-04-01 20:23:25 +07:00
|
|
|
|
2009-12-06 01:27:02 +07:00
|
|
|
#define RCA4_TYPE_MASK_RDATA_DLG 0
|
|
|
|
#define RCA4_TYPE_MASK_WDATA_DLG 1
|
2011-01-06 18:36:31 +07:00
|
|
|
#define RCA4_TYPE_MASK_DIR_DLG 2
|
|
|
|
#define RCA4_TYPE_MASK_FILE_LAYOUT 3
|
|
|
|
#define RCA4_TYPE_MASK_BLK_LAYOUT 4
|
|
|
|
#define RCA4_TYPE_MASK_OBJ_LAYOUT_MIN 8
|
|
|
|
#define RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9
|
|
|
|
#define RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12
|
|
|
|
#define RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15
|
2020-02-19 03:58:31 +07:00
|
|
|
#define PNFS_FF_RCA4_TYPE_MASK_READ 16
|
|
|
|
#define PNFS_FF_RCA4_TYPE_MASK_RW 17
|
|
|
|
#define RCA4_TYPE_MASK_ALL 0x3f31f
|
2009-12-06 01:27:02 +07:00
|
|
|
|
|
|
|
struct cb_recallanyargs {
|
|
|
|
uint32_t craa_objs_to_keep;
|
|
|
|
uint32_t craa_type_mask;
|
|
|
|
};
|
|
|
|
|
2017-05-11 14:22:18 +07:00
|
|
|
extern __be32 nfs4_callback_recallany(void *argp, void *resp,
|
2011-01-06 09:04:32 +07:00
|
|
|
struct cb_process_state *cps);
|
2010-01-21 04:06:27 +07:00
|
|
|
|
|
|
|
struct cb_recallslotargs {
|
2012-11-21 08:24:02 +07:00
|
|
|
uint32_t crsa_target_highest_slotid;
|
2010-01-21 04:06:27 +07:00
|
|
|
};
|
2017-05-11 14:22:18 +07:00
|
|
|
extern __be32 nfs4_callback_recallslot(void *argp, void *resp,
|
2011-01-06 09:04:32 +07:00
|
|
|
struct cb_process_state *cps);
|
2010-01-21 04:06:27 +07:00
|
|
|
|
2011-01-06 18:36:29 +07:00
|
|
|
struct cb_layoutrecallargs {
|
|
|
|
uint32_t cbl_recall_type;
|
|
|
|
uint32_t cbl_layout_type;
|
|
|
|
uint32_t cbl_layoutchanged;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
struct nfs_fh cbl_fh;
|
|
|
|
struct pnfs_layout_range cbl_range;
|
|
|
|
nfs4_stateid cbl_stateid;
|
|
|
|
};
|
|
|
|
struct nfs_fsid cbl_fsid;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2017-05-11 14:22:18 +07:00
|
|
|
extern __be32 nfs4_callback_layoutrecall(void *argp, void *resp,
|
|
|
|
struct cb_process_state *cps);
|
2011-01-06 18:36:29 +07:00
|
|
|
|
2011-05-22 23:47:09 +07:00
|
|
|
struct cb_devicenotifyitem {
|
|
|
|
uint32_t cbd_notify_type;
|
|
|
|
uint32_t cbd_layout_type;
|
|
|
|
struct nfs4_deviceid cbd_dev_id;
|
|
|
|
uint32_t cbd_immediate;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct cb_devicenotifyargs {
|
|
|
|
int ndevs;
|
|
|
|
struct cb_devicenotifyitem *devs;
|
|
|
|
};
|
|
|
|
|
2017-05-11 14:22:18 +07:00
|
|
|
extern __be32 nfs4_callback_devicenotify(void *argp, void *resp,
|
|
|
|
struct cb_process_state *cps);
|
2011-05-22 23:47:09 +07:00
|
|
|
|
2016-09-18 05:17:36 +07:00
|
|
|
struct cb_notify_lock_args {
|
|
|
|
struct nfs_fh cbnl_fh;
|
|
|
|
struct nfs_lowner cbnl_owner;
|
|
|
|
bool cbnl_valid;
|
|
|
|
};
|
|
|
|
|
2017-05-11 14:22:18 +07:00
|
|
|
extern __be32 nfs4_callback_notify_lock(void *argp, void *resp,
|
2016-09-18 05:17:36 +07:00
|
|
|
struct cb_process_state *cps);
|
2009-04-01 20:23:24 +07:00
|
|
|
#endif /* CONFIG_NFS_V4_1 */
|
2018-07-10 02:13:28 +07:00
|
|
|
#ifdef CONFIG_NFS_V4_2
|
|
|
|
struct cb_offloadargs {
|
|
|
|
struct nfs_fh coa_fh;
|
|
|
|
nfs4_stateid coa_stateid;
|
|
|
|
uint32_t error;
|
|
|
|
uint64_t wr_count;
|
|
|
|
struct nfs_writeverf wr_writeverf;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern __be32 nfs4_callback_offload(void *args, void *dummy,
|
|
|
|
struct cb_process_state *cps);
|
|
|
|
#endif /* CONFIG_NFS_V4_2 */
|
2011-01-25 22:38:01 +07:00
|
|
|
extern int check_gss_callback_principal(struct nfs_client *, struct svc_rqst *);
|
2017-05-11 14:22:18 +07:00
|
|
|
extern __be32 nfs4_callback_getattr(void *argp, void *resp,
|
2011-01-06 09:04:32 +07:00
|
|
|
struct cb_process_state *cps);
|
2017-05-11 14:22:18 +07:00
|
|
|
extern __be32 nfs4_callback_recall(void *argp, void *resp,
|
2011-01-06 09:04:32 +07:00
|
|
|
struct cb_process_state *cps);
|
2012-07-31 03:05:25 +07:00
|
|
|
#if IS_ENABLED(CONFIG_NFS_V4)
|
2009-04-01 20:22:56 +07:00
|
|
|
extern int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt);
|
2012-08-20 21:00:06 +07:00
|
|
|
extern void nfs_callback_down(int minorversion, struct net *net);
|
2009-04-01 20:23:14 +07:00
|
|
|
#endif /* CONFIG_NFS_V4 */
|
2009-04-01 20:23:08 +07:00
|
|
|
/*
|
|
|
|
* nfs41: Callbacks are expected to not cause substantial latency,
|
|
|
|
* so we limit their concurrency to 1 by setting up the maximum number
|
|
|
|
* of slots for the backchannel.
|
|
|
|
*/
|
|
|
|
#define NFS41_BC_MIN_CALLBACKS 1
|
2009-04-01 20:23:25 +07:00
|
|
|
#define NFS41_BC_MAX_CALLBACKS 1
|
2009-04-01 20:23:08 +07:00
|
|
|
|
2016-08-30 07:03:52 +07:00
|
|
|
#define NFS4_MIN_NR_CALLBACK_THREADS 1
|
2016-08-30 07:03:51 +07:00
|
|
|
|
2006-01-03 15:55:41 +07:00
|
|
|
extern unsigned int nfs_callback_set_tcpport;
|
2016-08-30 07:03:52 +07:00
|
|
|
extern unsigned short nfs_callback_nr_threads;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
#endif /* __LINUX_FS_NFS_CALLBACK_H */
|