mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-30 07:34:12 +08:00
0b61f8a407
Remove the verbose license text from XFS files and replace them with SPDX tags. This does not change the license of any of the code, merely refers to the common, up-to-date license files in LICENSES/ This change was mostly scripted. fs/xfs/Makefile and fs/xfs/libxfs/xfs_fs.h were modified by hand, the rest were detected and modified by the following command: for f in `git grep -l "GNU General" fs/xfs/` ; do echo $f cat $f | awk -f hdr.awk > $f.new mv -f $f.new $f done And the hdr.awk script that did the modification (including detecting the difference between GPL-2.0 and GPL-2.0+ licenses) is as follows: $ cat hdr.awk BEGIN { hdr = 1.0 tag = "GPL-2.0" str = "" } /^ \* This program is free software/ { hdr = 2.0; next } /any later version./ { tag = "GPL-2.0+" next } /^ \*\// { if (hdr > 0.0) { print "// SPDX-License-Identifier: " tag print str print $0 str="" hdr = 0.0 next } print $0 next } /^ \* / { if (hdr > 1.0) next if (hdr > 0.0) { if (str != "") str = str "\n" str = str $0 next } print $0 next } /^ \*/ { if (hdr > 0.0) next print $0 next } // { if (hdr > 0.0) { if (str != "") str = str "\n" str = str $0 next } print $0 } END { } $ Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
58 lines
1.8 KiB
C
58 lines
1.8 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Copyright (c) 2014 Red Hat, Inc.
|
|
* All Rights Reserved.
|
|
*/
|
|
#ifndef __XFS_RMAP_BTREE_H__
|
|
#define __XFS_RMAP_BTREE_H__
|
|
|
|
struct xfs_buf;
|
|
struct xfs_btree_cur;
|
|
struct xfs_mount;
|
|
|
|
/* rmaps only exist on crc enabled filesystems */
|
|
#define XFS_RMAP_BLOCK_LEN XFS_BTREE_SBLOCK_CRC_LEN
|
|
|
|
/*
|
|
* Record, key, and pointer address macros for btree blocks.
|
|
*
|
|
* (note that some of these may appear unused, but they are used in userspace)
|
|
*/
|
|
#define XFS_RMAP_REC_ADDR(block, index) \
|
|
((struct xfs_rmap_rec *) \
|
|
((char *)(block) + XFS_RMAP_BLOCK_LEN + \
|
|
(((index) - 1) * sizeof(struct xfs_rmap_rec))))
|
|
|
|
#define XFS_RMAP_KEY_ADDR(block, index) \
|
|
((struct xfs_rmap_key *) \
|
|
((char *)(block) + XFS_RMAP_BLOCK_LEN + \
|
|
((index) - 1) * 2 * sizeof(struct xfs_rmap_key)))
|
|
|
|
#define XFS_RMAP_HIGH_KEY_ADDR(block, index) \
|
|
((struct xfs_rmap_key *) \
|
|
((char *)(block) + XFS_RMAP_BLOCK_LEN + \
|
|
sizeof(struct xfs_rmap_key) + \
|
|
((index) - 1) * 2 * sizeof(struct xfs_rmap_key)))
|
|
|
|
#define XFS_RMAP_PTR_ADDR(block, index, maxrecs) \
|
|
((xfs_rmap_ptr_t *) \
|
|
((char *)(block) + XFS_RMAP_BLOCK_LEN + \
|
|
(maxrecs) * 2 * sizeof(struct xfs_rmap_key) + \
|
|
((index) - 1) * sizeof(xfs_rmap_ptr_t)))
|
|
|
|
struct xfs_btree_cur *xfs_rmapbt_init_cursor(struct xfs_mount *mp,
|
|
struct xfs_trans *tp, struct xfs_buf *bp,
|
|
xfs_agnumber_t agno);
|
|
int xfs_rmapbt_maxrecs(int blocklen, int leaf);
|
|
extern void xfs_rmapbt_compute_maxlevels(struct xfs_mount *mp);
|
|
|
|
extern xfs_extlen_t xfs_rmapbt_calc_size(struct xfs_mount *mp,
|
|
unsigned long long len);
|
|
extern xfs_extlen_t xfs_rmapbt_max_size(struct xfs_mount *mp,
|
|
xfs_agblock_t agblocks);
|
|
|
|
extern int xfs_rmapbt_calc_reserves(struct xfs_mount *mp,
|
|
xfs_agnumber_t agno, xfs_extlen_t *ask, xfs_extlen_t *used);
|
|
|
|
#endif /* __XFS_RMAP_BTREE_H__ */
|