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-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* linux/fs/minix/bitmap.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 1991, 1992 Linus Torvalds
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified for 680x0 by Hamish Macdonald
|
|
|
|
* Fixed for 680x0 by Andreas Schwab
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* bitmap.c contains the code that handles the inode and block bitmaps */
|
|
|
|
|
|
|
|
#include "minix.h"
|
|
|
|
#include <linux/buffer_head.h>
|
|
|
|
#include <linux/bitops.h>
|
Detach sched.h from mm.h
First thing mm.h does is including sched.h solely for can_do_mlock() inline
function which has "current" dereference inside. By dealing with can_do_mlock()
mm.h can be detached from sched.h which is good. See below, why.
This patch
a) removes unconditional inclusion of sched.h from mm.h
b) makes can_do_mlock() normal function in mm/mlock.c
c) exports can_do_mlock() to not break compilation
d) adds sched.h inclusions back to files that were getting it indirectly.
e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were
getting them indirectly
Net result is:
a) mm.h users would get less code to open, read, preprocess, parse, ... if
they don't need sched.h
b) sched.h stops being dependency for significant number of files:
on x86_64 allmodconfig touching sched.h results in recompile of 4083 files,
after patch it's only 3744 (-8.3%).
Cross-compile tested on
all arm defconfigs, all mips defconfigs, all powerpc defconfigs,
alpha alpha-up
arm
i386 i386-up i386-defconfig i386-allnoconfig
ia64 ia64-up
m68k
mips
parisc parisc-up
powerpc powerpc-up
s390 s390-up
sparc sparc-up
sparc64 sparc64-up
um-x86_64
x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig
as well as my two usual configs.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-21 05:22:52 +08:00
|
|
|
#include <linux/sched.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2009-06-17 11:47:45 +08:00
|
|
|
static DEFINE_SPINLOCK(bitmap_lock);
|
|
|
|
|
2011-08-27 10:38:50 +08:00
|
|
|
/*
|
|
|
|
* bitmap consists of blocks filled with 16bit words
|
|
|
|
* bit set == busy, bit clear == free
|
|
|
|
* endianness is a mess, but for counting zero bits it really doesn't matter...
|
|
|
|
*/
|
|
|
|
static __u32 count_free(struct buffer_head *map[], unsigned blocksize, __u32 numbits)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2011-08-27 10:38:50 +08:00
|
|
|
__u32 sum = 0;
|
|
|
|
unsigned blocks = DIV_ROUND_UP(numbits, blocksize * 8);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2011-08-27 10:38:50 +08:00
|
|
|
while (blocks--) {
|
|
|
|
unsigned words = blocksize / 2;
|
|
|
|
__u16 *p = (__u16 *)(*map++)->b_data;
|
|
|
|
while (words--)
|
|
|
|
sum += 16 - hweight16(*p++);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2011-08-27 10:38:50 +08:00
|
|
|
return sum;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2007-02-12 16:52:49 +08:00
|
|
|
void minix_free_block(struct inode *inode, unsigned long block)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2007-02-12 16:52:49 +08:00
|
|
|
struct super_block *sb = inode->i_sb;
|
|
|
|
struct minix_sb_info *sbi = minix_sb(sb);
|
|
|
|
struct buffer_head *bh;
|
|
|
|
int k = sb->s_blocksize_bits + 3;
|
|
|
|
unsigned long bit, zone;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
if (block < sbi->s_firstdatazone || block >= sbi->s_nzones) {
|
2006-03-25 19:07:42 +08:00
|
|
|
printk("Trying to free block not in datazone\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
zone = block - sbi->s_firstdatazone + 1;
|
2007-02-12 16:52:49 +08:00
|
|
|
bit = zone & ((1<<k) - 1);
|
|
|
|
zone >>= k;
|
2005-04-17 06:20:36 +08:00
|
|
|
if (zone >= sbi->s_zmap_blocks) {
|
|
|
|
printk("minix_free_block: nonexistent bitmap buffer\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
bh = sbi->s_zmap[zone];
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_lock(&bitmap_lock);
|
2007-02-12 16:52:49 +08:00
|
|
|
if (!minix_test_and_clear_bit(bit, bh->b_data))
|
|
|
|
printk("minix_free_block (%s:%lu): bit already cleared\n",
|
2005-04-17 06:20:36 +08:00
|
|
|
sb->s_id, block);
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_unlock(&bitmap_lock);
|
2005-04-17 06:20:36 +08:00
|
|
|
mark_buffer_dirty(bh);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
int minix_new_block(struct inode * inode)
|
|
|
|
{
|
|
|
|
struct minix_sb_info *sbi = minix_sb(inode->i_sb);
|
2007-02-12 16:52:49 +08:00
|
|
|
int bits_per_zone = 8 * inode->i_sb->s_blocksize;
|
2005-04-17 06:20:36 +08:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < sbi->s_zmap_blocks; i++) {
|
|
|
|
struct buffer_head *bh = sbi->s_zmap[i];
|
|
|
|
int j;
|
|
|
|
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_lock(&bitmap_lock);
|
2007-02-12 16:52:49 +08:00
|
|
|
j = minix_find_first_zero_bit(bh->b_data, bits_per_zone);
|
|
|
|
if (j < bits_per_zone) {
|
|
|
|
minix_set_bit(j, bh->b_data);
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_unlock(&bitmap_lock);
|
2005-04-17 06:20:36 +08:00
|
|
|
mark_buffer_dirty(bh);
|
2007-02-12 16:52:49 +08:00
|
|
|
j += i * bits_per_zone + sbi->s_firstdatazone-1;
|
2005-04-17 06:20:36 +08:00
|
|
|
if (j < sbi->s_firstdatazone || j >= sbi->s_nzones)
|
|
|
|
break;
|
|
|
|
return j;
|
|
|
|
}
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_unlock(&bitmap_lock);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-08-20 02:50:26 +08:00
|
|
|
unsigned long minix_count_free_blocks(struct super_block *sb)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2011-08-20 02:50:26 +08:00
|
|
|
struct minix_sb_info *sbi = minix_sb(sb);
|
2014-08-09 05:20:29 +08:00
|
|
|
u32 bits = sbi->s_nzones - sbi->s_firstdatazone + 1;
|
2011-08-20 02:50:26 +08:00
|
|
|
|
|
|
|
return (count_free(sbi->s_zmap, sb->s_blocksize, bits)
|
2005-04-17 06:20:36 +08:00
|
|
|
<< sbi->s_log_zone_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct minix_inode *
|
|
|
|
minix_V1_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh)
|
|
|
|
{
|
|
|
|
int block;
|
|
|
|
struct minix_sb_info *sbi = minix_sb(sb);
|
|
|
|
struct minix_inode *p;
|
|
|
|
|
|
|
|
if (!ino || ino > sbi->s_ninodes) {
|
|
|
|
printk("Bad inode number on dev %s: %ld is out of range\n",
|
|
|
|
sb->s_id, (long)ino);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
ino--;
|
|
|
|
block = 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks +
|
|
|
|
ino / MINIX_INODES_PER_BLOCK;
|
|
|
|
*bh = sb_bread(sb, block);
|
|
|
|
if (!*bh) {
|
2006-03-25 19:07:42 +08:00
|
|
|
printk("Unable to read inode block\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
p = (void *)(*bh)->b_data;
|
|
|
|
return p + ino % MINIX_INODES_PER_BLOCK;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct minix2_inode *
|
|
|
|
minix_V2_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh)
|
|
|
|
{
|
|
|
|
int block;
|
|
|
|
struct minix_sb_info *sbi = minix_sb(sb);
|
|
|
|
struct minix2_inode *p;
|
2007-02-12 16:52:49 +08:00
|
|
|
int minix2_inodes_per_block = sb->s_blocksize / sizeof(struct minix2_inode);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
*bh = NULL;
|
|
|
|
if (!ino || ino > sbi->s_ninodes) {
|
|
|
|
printk("Bad inode number on dev %s: %ld is out of range\n",
|
|
|
|
sb->s_id, (long)ino);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
ino--;
|
|
|
|
block = 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks +
|
2007-02-12 16:52:49 +08:00
|
|
|
ino / minix2_inodes_per_block;
|
2005-04-17 06:20:36 +08:00
|
|
|
*bh = sb_bread(sb, block);
|
|
|
|
if (!*bh) {
|
2006-03-25 19:07:42 +08:00
|
|
|
printk("Unable to read inode block\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
p = (void *)(*bh)->b_data;
|
2007-02-12 16:52:49 +08:00
|
|
|
return p + ino % minix2_inodes_per_block;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Clear the link count and mode of a deleted inode on disk. */
|
|
|
|
|
|
|
|
static void minix_clear_inode(struct inode *inode)
|
|
|
|
{
|
|
|
|
struct buffer_head *bh = NULL;
|
|
|
|
|
|
|
|
if (INODE_VERSION(inode) == MINIX_V1) {
|
|
|
|
struct minix_inode *raw_inode;
|
|
|
|
raw_inode = minix_V1_raw_inode(inode->i_sb, inode->i_ino, &bh);
|
|
|
|
if (raw_inode) {
|
|
|
|
raw_inode->i_nlinks = 0;
|
|
|
|
raw_inode->i_mode = 0;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
struct minix2_inode *raw_inode;
|
|
|
|
raw_inode = minix_V2_raw_inode(inode->i_sb, inode->i_ino, &bh);
|
|
|
|
if (raw_inode) {
|
|
|
|
raw_inode->i_nlinks = 0;
|
|
|
|
raw_inode->i_mode = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (bh) {
|
|
|
|
mark_buffer_dirty(bh);
|
|
|
|
brelse (bh);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void minix_free_inode(struct inode * inode)
|
|
|
|
{
|
2007-02-12 16:52:49 +08:00
|
|
|
struct super_block *sb = inode->i_sb;
|
2005-04-17 06:20:36 +08:00
|
|
|
struct minix_sb_info *sbi = minix_sb(inode->i_sb);
|
2007-02-12 16:52:49 +08:00
|
|
|
struct buffer_head *bh;
|
|
|
|
int k = sb->s_blocksize_bits + 3;
|
|
|
|
unsigned long ino, bit;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
ino = inode->i_ino;
|
|
|
|
if (ino < 1 || ino > sbi->s_ninodes) {
|
|
|
|
printk("minix_free_inode: inode 0 or nonexistent inode\n");
|
2010-06-05 10:27:38 +08:00
|
|
|
return;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
2007-02-12 16:52:49 +08:00
|
|
|
bit = ino & ((1<<k) - 1);
|
|
|
|
ino >>= k;
|
|
|
|
if (ino >= sbi->s_imap_blocks) {
|
2005-04-17 06:20:36 +08:00
|
|
|
printk("minix_free_inode: nonexistent imap in superblock\n");
|
2010-06-05 10:27:38 +08:00
|
|
|
return;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
minix_clear_inode(inode); /* clear on-disk copy */
|
|
|
|
|
2007-02-12 16:52:49 +08:00
|
|
|
bh = sbi->s_imap[ino];
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_lock(&bitmap_lock);
|
2007-02-12 16:52:49 +08:00
|
|
|
if (!minix_test_and_clear_bit(bit, bh->b_data))
|
|
|
|
printk("minix_free_inode: bit %lu already cleared\n", bit);
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_unlock(&bitmap_lock);
|
2005-04-17 06:20:36 +08:00
|
|
|
mark_buffer_dirty(bh);
|
|
|
|
}
|
|
|
|
|
2011-07-26 14:48:39 +08:00
|
|
|
struct inode *minix_new_inode(const struct inode *dir, umode_t mode, int *error)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
struct super_block *sb = dir->i_sb;
|
|
|
|
struct minix_sb_info *sbi = minix_sb(sb);
|
|
|
|
struct inode *inode = new_inode(sb);
|
|
|
|
struct buffer_head * bh;
|
2007-02-12 16:52:49 +08:00
|
|
|
int bits_per_zone = 8 * sb->s_blocksize;
|
|
|
|
unsigned long j;
|
|
|
|
int i;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
if (!inode) {
|
|
|
|
*error = -ENOMEM;
|
|
|
|
return NULL;
|
|
|
|
}
|
2007-02-12 16:52:49 +08:00
|
|
|
j = bits_per_zone;
|
2005-04-17 06:20:36 +08:00
|
|
|
bh = NULL;
|
|
|
|
*error = -ENOSPC;
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_lock(&bitmap_lock);
|
2005-04-17 06:20:36 +08:00
|
|
|
for (i = 0; i < sbi->s_imap_blocks; i++) {
|
|
|
|
bh = sbi->s_imap[i];
|
2007-02-12 16:52:49 +08:00
|
|
|
j = minix_find_first_zero_bit(bh->b_data, bits_per_zone);
|
|
|
|
if (j < bits_per_zone)
|
2005-04-17 06:20:36 +08:00
|
|
|
break;
|
|
|
|
}
|
2007-02-12 16:52:49 +08:00
|
|
|
if (!bh || j >= bits_per_zone) {
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_unlock(&bitmap_lock);
|
2005-04-17 06:20:36 +08:00
|
|
|
iput(inode);
|
|
|
|
return NULL;
|
|
|
|
}
|
2007-02-12 16:52:49 +08:00
|
|
|
if (minix_test_and_set_bit(j, bh->b_data)) { /* shouldn't happen */
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_unlock(&bitmap_lock);
|
2007-02-12 16:52:49 +08:00
|
|
|
printk("minix_new_inode: bit already set\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
iput(inode);
|
|
|
|
return NULL;
|
|
|
|
}
|
2009-06-17 11:47:45 +08:00
|
|
|
spin_unlock(&bitmap_lock);
|
2005-04-17 06:20:36 +08:00
|
|
|
mark_buffer_dirty(bh);
|
2007-02-12 16:52:49 +08:00
|
|
|
j += i * bits_per_zone;
|
2005-04-17 06:20:36 +08:00
|
|
|
if (!j || j > sbi->s_ninodes) {
|
|
|
|
iput(inode);
|
|
|
|
return NULL;
|
|
|
|
}
|
2010-03-04 22:32:14 +08:00
|
|
|
inode_init_owner(inode, dir, mode);
|
2005-04-17 06:20:36 +08:00
|
|
|
inode->i_ino = j;
|
2016-09-14 22:48:05 +08:00
|
|
|
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
2006-09-27 16:50:49 +08:00
|
|
|
inode->i_blocks = 0;
|
2005-04-17 06:20:36 +08:00
|
|
|
memset(&minix_i(inode)->u, 0, sizeof(minix_i(inode)->u));
|
|
|
|
insert_inode_hash(inode);
|
|
|
|
mark_inode_dirty(inode);
|
|
|
|
|
|
|
|
*error = 0;
|
|
|
|
return inode;
|
|
|
|
}
|
|
|
|
|
2011-08-20 02:50:26 +08:00
|
|
|
unsigned long minix_count_free_inodes(struct super_block *sb)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2011-08-20 02:50:26 +08:00
|
|
|
struct minix_sb_info *sbi = minix_sb(sb);
|
|
|
|
u32 bits = sbi->s_ninodes + 1;
|
|
|
|
|
|
|
|
return count_free(sbi->s_imap, sb->s_blocksize, bits);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|