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 */
|
2014-12-12 06:02:04 +08:00
|
|
|
/*
|
|
|
|
* NFSv4 flexfile layout driver data structures.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2014, Primary Data, Inc. All rights reserved.
|
|
|
|
*
|
|
|
|
* Tao Peng <bergwolf@primarydata.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FS_NFS_NFS4FLEXFILELAYOUT_H
|
|
|
|
#define FS_NFS_NFS4FLEXFILELAYOUT_H
|
|
|
|
|
2015-06-27 02:51:32 +08:00
|
|
|
#define FF_FLAGS_NO_LAYOUTCOMMIT 1
|
2016-05-25 22:31:12 +08:00
|
|
|
#define FF_FLAGS_NO_IO_THRU_MDS 2
|
|
|
|
#define FF_FLAGS_NO_READ_IO 4
|
2015-06-27 02:51:32 +08:00
|
|
|
|
2017-10-20 17:53:34 +08:00
|
|
|
#include <linux/refcount.h>
|
2014-12-12 06:02:04 +08:00
|
|
|
#include "../pnfs.h"
|
|
|
|
|
|
|
|
/* XXX: Let's filter out insanely large mirror count for now to avoid oom
|
|
|
|
* due to network error etc. */
|
|
|
|
#define NFS4_FLEXFILE_LAYOUT_MAX_MIRROR_CNT 4096
|
|
|
|
|
2015-06-23 19:52:04 +08:00
|
|
|
/* LAYOUTSTATS report interval in ms */
|
|
|
|
#define FF_LAYOUTSTATS_REPORT_INTERVAL (60000L)
|
2016-10-20 03:59:28 +08:00
|
|
|
#define FF_LAYOUTSTATS_MAXDEV 4
|
2015-06-23 19:52:04 +08:00
|
|
|
|
2014-12-12 06:02:04 +08:00
|
|
|
struct nfs4_ff_ds_version {
|
|
|
|
u32 version;
|
|
|
|
u32 minor_version;
|
|
|
|
u32 rsize;
|
|
|
|
u32 wsize;
|
|
|
|
bool tightly_coupled;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* chained in global deviceid hlist */
|
|
|
|
struct nfs4_ff_layout_ds {
|
|
|
|
struct nfs4_deviceid_node id_node;
|
|
|
|
u32 ds_versions_cnt;
|
|
|
|
struct nfs4_ff_ds_version *ds_versions;
|
|
|
|
struct nfs4_pnfs_ds *ds;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nfs4_ff_layout_ds_err {
|
|
|
|
struct list_head list; /* linked in mirror error_list */
|
|
|
|
u64 offset;
|
|
|
|
u64 length;
|
|
|
|
int status;
|
|
|
|
enum nfs_opnum4 opnum;
|
|
|
|
nfs4_stateid stateid;
|
|
|
|
struct nfs4_deviceid deviceid;
|
|
|
|
};
|
|
|
|
|
2015-06-23 19:51:59 +08:00
|
|
|
struct nfs4_ff_io_stat {
|
|
|
|
__u64 ops_requested;
|
|
|
|
__u64 bytes_requested;
|
|
|
|
__u64 ops_completed;
|
|
|
|
__u64 bytes_completed;
|
|
|
|
__u64 bytes_not_delivered;
|
|
|
|
ktime_t total_busy_time;
|
|
|
|
ktime_t aggregate_completion_time;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nfs4_ff_busy_timer {
|
|
|
|
ktime_t start_time;
|
|
|
|
atomic_t n_ops;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nfs4_ff_layoutstat {
|
|
|
|
struct nfs4_ff_io_stat io_stat;
|
|
|
|
struct nfs4_ff_busy_timer busy_timer;
|
|
|
|
};
|
|
|
|
|
2014-12-12 06:02:04 +08:00
|
|
|
struct nfs4_ff_layout_mirror {
|
2015-08-25 08:03:17 +08:00
|
|
|
struct pnfs_layout_hdr *layout;
|
|
|
|
struct list_head mirrors;
|
2014-12-12 06:02:04 +08:00
|
|
|
u32 ds_count;
|
|
|
|
u32 efficiency;
|
2016-10-01 02:37:41 +08:00
|
|
|
struct nfs4_deviceid devid;
|
2014-12-12 06:02:04 +08:00
|
|
|
struct nfs4_ff_layout_ds *mirror_ds;
|
|
|
|
u32 fh_versions_cnt;
|
|
|
|
struct nfs_fh *fh_versions;
|
|
|
|
nfs4_stateid stateid;
|
2018-12-03 08:30:31 +08:00
|
|
|
const struct cred __rcu *ro_cred;
|
|
|
|
const struct cred __rcu *rw_cred;
|
2017-10-20 17:53:34 +08:00
|
|
|
refcount_t ref;
|
2014-12-12 06:02:04 +08:00
|
|
|
spinlock_t lock;
|
2016-11-26 02:17:15 +08:00
|
|
|
unsigned long flags;
|
2015-06-23 19:51:59 +08:00
|
|
|
struct nfs4_ff_layoutstat read_stat;
|
|
|
|
struct nfs4_ff_layoutstat write_stat;
|
2015-06-23 19:52:00 +08:00
|
|
|
ktime_t start_time;
|
2015-11-17 00:26:07 +08:00
|
|
|
u32 report_interval;
|
2014-12-12 06:02:04 +08:00
|
|
|
};
|
|
|
|
|
2016-11-26 02:17:15 +08:00
|
|
|
#define NFS4_FF_MIRROR_STAT_AVAIL (0)
|
|
|
|
|
2014-12-12 06:02:04 +08:00
|
|
|
struct nfs4_ff_layout_segment {
|
|
|
|
struct pnfs_layout_segment generic_hdr;
|
|
|
|
u64 stripe_unit;
|
2015-06-27 02:51:32 +08:00
|
|
|
u32 flags;
|
2014-12-12 06:02:04 +08:00
|
|
|
u32 mirror_array_cnt;
|
2020-03-19 22:13:05 +08:00
|
|
|
struct nfs4_ff_layout_mirror *mirror_array[];
|
2014-12-12 06:02:04 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct nfs4_flexfile_layout {
|
|
|
|
struct pnfs_layout_hdr generic_hdr;
|
|
|
|
struct pnfs_ds_commit_info commit_info;
|
2015-08-25 08:03:17 +08:00
|
|
|
struct list_head mirrors;
|
2014-12-12 06:02:04 +08:00
|
|
|
struct list_head error_list; /* nfs4_ff_layout_ds_err */
|
2016-08-15 00:47:49 +08:00
|
|
|
ktime_t last_report_time; /* Layoutstat report times */
|
2014-12-12 06:02:04 +08:00
|
|
|
};
|
|
|
|
|
2016-12-03 05:15:05 +08:00
|
|
|
struct nfs4_flexfile_layoutreturn_args {
|
|
|
|
struct list_head errors;
|
2016-10-20 03:59:28 +08:00
|
|
|
struct nfs42_layoutstat_devinfo devinfo[FF_LAYOUTSTATS_MAXDEV];
|
2016-12-03 05:15:05 +08:00
|
|
|
unsigned int num_errors;
|
2016-10-20 03:59:28 +08:00
|
|
|
unsigned int num_dev;
|
2016-12-10 07:07:51 +08:00
|
|
|
struct page *pages[1];
|
2016-12-03 05:15:05 +08:00
|
|
|
};
|
|
|
|
|
2014-12-12 06:02:04 +08:00
|
|
|
static inline struct nfs4_flexfile_layout *
|
|
|
|
FF_LAYOUT_FROM_HDR(struct pnfs_layout_hdr *lo)
|
|
|
|
{
|
|
|
|
return container_of(lo, struct nfs4_flexfile_layout, generic_hdr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct nfs4_ff_layout_segment *
|
|
|
|
FF_LAYOUT_LSEG(struct pnfs_layout_segment *lseg)
|
|
|
|
{
|
|
|
|
return container_of(lseg,
|
|
|
|
struct nfs4_ff_layout_segment,
|
|
|
|
generic_hdr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct nfs4_ff_layout_ds *
|
|
|
|
FF_LAYOUT_MIRROR_DS(struct nfs4_deviceid_node *node)
|
|
|
|
{
|
|
|
|
return container_of(node, struct nfs4_ff_layout_ds, id_node);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct nfs4_ff_layout_mirror *
|
|
|
|
FF_LAYOUT_COMP(struct pnfs_layout_segment *lseg, u32 idx)
|
|
|
|
{
|
2019-02-27 00:19:46 +08:00
|
|
|
struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg);
|
|
|
|
|
|
|
|
if (idx < fls->mirror_array_cnt)
|
|
|
|
return fls->mirror_array[idx];
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct nfs4_deviceid_node *
|
|
|
|
FF_LAYOUT_DEVID_NODE(struct pnfs_layout_segment *lseg, u32 idx)
|
|
|
|
{
|
|
|
|
struct nfs4_ff_layout_mirror *mirror = FF_LAYOUT_COMP(lseg, idx);
|
|
|
|
|
|
|
|
if (mirror != NULL) {
|
|
|
|
struct nfs4_ff_layout_ds *mirror_ds = mirror->mirror_ds;
|
|
|
|
|
|
|
|
if (!IS_ERR_OR_NULL(mirror_ds))
|
|
|
|
return &mirror_ds->id_node;
|
|
|
|
}
|
|
|
|
return NULL;
|
2014-12-12 06:02:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline u32
|
|
|
|
FF_LAYOUT_MIRROR_COUNT(struct pnfs_layout_segment *lseg)
|
|
|
|
{
|
|
|
|
return FF_LAYOUT_LSEG(lseg)->mirror_array_cnt;
|
|
|
|
}
|
|
|
|
|
2015-11-02 22:59:00 +08:00
|
|
|
static inline bool
|
|
|
|
ff_layout_no_fallback_to_mds(struct pnfs_layout_segment *lseg)
|
|
|
|
{
|
|
|
|
return FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_IO_THRU_MDS;
|
|
|
|
}
|
|
|
|
|
2016-05-25 22:31:12 +08:00
|
|
|
static inline bool
|
|
|
|
ff_layout_no_read_on_rw(struct pnfs_layout_segment *lseg)
|
|
|
|
{
|
|
|
|
return FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_READ_IO;
|
|
|
|
}
|
|
|
|
|
2014-12-12 06:02:04 +08:00
|
|
|
static inline int
|
2019-02-28 23:44:15 +08:00
|
|
|
nfs4_ff_layout_ds_version(const struct nfs4_ff_layout_mirror *mirror)
|
2014-12-12 06:02:04 +08:00
|
|
|
{
|
2019-02-28 23:44:15 +08:00
|
|
|
return mirror->mirror_ds->ds_versions[0].version;
|
2014-12-12 06:02:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
struct nfs4_ff_layout_ds *
|
|
|
|
nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
|
|
|
|
gfp_t gfp_flags);
|
|
|
|
void nfs4_ff_layout_put_deviceid(struct nfs4_ff_layout_ds *mirror_ds);
|
|
|
|
void nfs4_ff_layout_free_deviceid(struct nfs4_ff_layout_ds *mirror_ds);
|
|
|
|
int ff_layout_track_ds_error(struct nfs4_flexfile_layout *flo,
|
|
|
|
struct nfs4_ff_layout_mirror *mirror, u64 offset,
|
|
|
|
u64 length, int status, enum nfs_opnum4 opnum,
|
|
|
|
gfp_t gfp_flags);
|
2019-02-11 11:38:43 +08:00
|
|
|
void ff_layout_send_layouterror(struct pnfs_layout_segment *lseg);
|
2016-12-03 05:15:05 +08:00
|
|
|
int ff_layout_encode_ds_ioerr(struct xdr_stream *xdr, const struct list_head *head);
|
|
|
|
void ff_layout_free_ds_ioerr(struct list_head *head);
|
|
|
|
unsigned int ff_layout_fetch_ds_ioerr(struct pnfs_layout_hdr *lo,
|
|
|
|
const struct pnfs_layout_range *range,
|
|
|
|
struct list_head *head,
|
|
|
|
unsigned int maxnum);
|
2014-12-12 06:02:04 +08:00
|
|
|
struct nfs_fh *
|
2019-02-28 23:34:13 +08:00
|
|
|
nfs4_ff_layout_select_ds_fh(struct nfs4_ff_layout_mirror *mirror);
|
2019-02-28 23:49:11 +08:00
|
|
|
void
|
|
|
|
nfs4_ff_layout_select_ds_stateid(const struct nfs4_ff_layout_mirror *mirror,
|
|
|
|
nfs4_stateid *stateid);
|
2014-12-12 06:02:04 +08:00
|
|
|
|
|
|
|
struct nfs4_pnfs_ds *
|
2019-02-15 02:45:45 +08:00
|
|
|
nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg,
|
|
|
|
struct nfs4_ff_layout_mirror *mirror,
|
2014-12-12 06:02:04 +08:00
|
|
|
bool fail_return);
|
|
|
|
|
|
|
|
struct rpc_clnt *
|
2019-02-28 23:38:41 +08:00
|
|
|
nfs4_ff_find_or_create_ds_client(struct nfs4_ff_layout_mirror *mirror,
|
2014-12-12 06:02:04 +08:00
|
|
|
struct nfs_client *ds_clp,
|
|
|
|
struct inode *inode);
|
2019-02-28 23:41:57 +08:00
|
|
|
const struct cred *ff_layout_get_ds_cred(struct nfs4_ff_layout_mirror *mirror,
|
|
|
|
const struct pnfs_layout_range *range,
|
|
|
|
const struct cred *mdscred);
|
2016-05-18 00:28:37 +08:00
|
|
|
bool ff_layout_avoid_mds_available_ds(struct pnfs_layout_segment *lseg);
|
2016-05-25 22:31:12 +08:00
|
|
|
bool ff_layout_avoid_read_on_rw(struct pnfs_layout_segment *lseg);
|
|
|
|
|
2014-12-12 06:02:04 +08:00
|
|
|
#endif /* FS_NFS_NFS4FLEXFILELAYOUT_H */
|