27 Oct, 2020
1 commit
-
…nux/kernel/git/soc/soc") into android-mainline
Steps on the way to 5.10-rc1
Resolves conflicts in:
Documentation/admin-guide/sysctl/vm.rstSigned-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic58f28718f28dae42948c935dfb0c62122fe86fc
26 Oct, 2020
1 commit
-
…scm/linux/kernel/git/gregkh/char-misc") into android-mainline
Steps on the way to 5.10-rc1
Resolves conflicts in:
drivers/hwtracing/stm/ftrace.c
drivers/misc/MakefileSigned-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8ac53000bf0c61973970f47b383904a2067bd353
24 Oct, 2020
1 commit
-
Pull clone/dedupe/remap code refactoring from Darrick Wong:
"Move the generic file range remap (aka reflink and dedupe) functions
out of mm/filemap.c and fs/read_write.c and into fs/remap_range.c to
reduce clutter in the first two files"* tag 'vfs-5.10-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
vfs: move the generic write and copy checks out of mm
vfs: move the remap range helpers to remap_range.c
vfs: move generic_remap_checks out of mm
23 Oct, 2020
1 commit
-
…/linux/kernel/git/viro/vfs") into android-mainline
Steps on the way to 5.10-rc1
Change-Id: I7dcdfa12eb9c3ff9fe23ae48fb58110538a520a7
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
16 Oct, 2020
1 commit
-
Pull char/misc driver updates from Greg KH:
"Here is the big set of char, misc, and other assorted driver subsystem
patches for 5.10-rc1.There's a lot of different things in here, all over the drivers/
directory. Some summaries:- soundwire driver updates
- habanalabs driver updates
- extcon driver updates
- nitro_enclaves new driver
- fsl-mc driver and core updates
- mhi core and bus updates
- nvmem driver updates
- eeprom driver updates
- binder driver updates and fixes
- vbox minor bugfixes
- fsi driver updates
- w1 driver updates
- coresight driver updates
- interconnect driver updates
- misc driver updates
- other minor driver updates
All of these have been in linux-next for a while with no reported
issues"* tag 'char-misc-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (396 commits)
binder: fix UAF when releasing todo list
docs: w1: w1_therm: Fix broken xref, mistakes, clarify text
misc: Kconfig: fix a HISI_HIKEY_USB dependency
LSM: Fix type of id parameter in kernel_post_load_data prototype
misc: Kconfig: add a new dependency for HISI_HIKEY_USB
firmware_loader: fix a kernel-doc markup
w1: w1_therm: make w1_poll_completion static
binder: simplify the return expression of binder_mmap
test_firmware: Test partial read support
firmware: Add request_partial_firmware_into_buf()
firmware: Store opt_flags in fw_priv
fs/kernel_file_read: Add "offset" arg for partial reads
IMA: Add support for file reads without contents
LSM: Add "contents" flag to kernel_read_file hook
module: Call security_kernel_post_load_data()
firmware_loader: Use security_post_load_data()
LSM: Introduce kernel_post_load_data() hook
fs/kernel_read_file: Add file_size output argument
fs/kernel_read_file: Switch buffer size arg to size_t
fs/kernel_read_file: Remove redundant size argument
...
15 Oct, 2020
1 commit
-
I would like to move all the generic helpers for the vfs remap range
functionality (aka clonerange and dedupe) into a separate file so that
they won't be scattered across the vfs and the mm subsystems. The
eventual goal is to be able to deselect remap_range.c if none of the
filesystems need that code, but the tricky part here is picking a
stable(ish) part of the merge window to rearrange code.Signed-off-by: Darrick J. Wong
05 Oct, 2020
1 commit
-
These routines are used in places outside of exec(2), so in preparation
for refactoring them, move them into a separate source file,
fs/kernel_read_file.c.Signed-off-by: Kees Cook
Reviewed-by: Mimi Zohar
Reviewed-by: Luis Chamberlain
Acked-by: Scott Branden
Link: https://lore.kernel.org/r/20201002173828.2099543-5-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman
23 Sep, 2020
1 commit
-
compat_sys_mount is identical to the regular sys_mount now, so remove it
and use the native version everywhere.Signed-off-by: Christoph Hellwig
Signed-off-by: Al Viro
08 Aug, 2020
1 commit
-
…kernel/git/sre/linux-power-supply") into android-mainline
Merges along the way to 5.9-rc1
resolves conflicts in:
Documentation/ABI/testing/sysfs-class-power
drivers/power/supply/power_supply_sysfs.c
fs/crypto/inline_crypt.cSigned-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia087834f54fb4e5269d68c3c404747ceed240701
31 Jul, 2020
1 commit
-
Like do_mount, but takes a kernel pointer for the destination path.
Switch over the mounts in the init code and devtmpfs to it, which
just happen to work due to the implicit set_fs(KERNEL_DS) during early
init right now.Signed-off-by: Christoph Hellwig
29 May, 2020
1 commit
-
It's no longer needed on Android devices, so remove sdcardfs core code,
and a bunch of exports that were only added so that it could be built as
a module.Bug: 157700134
Cc: Daniel Rosenberg
Signed-off-by: Greg Kroah-Hartman
Change-Id: I700056487562818f57e49d082dc3b93a4d7695da
09 Apr, 2020
1 commit
-
…linux/kernel/git/rafael/linux-pm") into android-mainline
Baby steps for 5.7-rc1
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib1579a254ae38651d8d61541dfc18fb7051b1226
06 Mar, 2020
1 commit
-
This adds the Kconfig and Makefile for exfat.
Signed-off-by: Namjae Jeon
Signed-off-by: Sungjong Seo
Reviewed-by: Pali Rohár
Reviewed-by: Christoph Hellwig
Signed-off-by: Al Viro
11 Feb, 2020
1 commit
-
Linux 5.6-rc1
Signed-off-by: Greg Kroah-Hartman
Change-Id: Ifd1731444572c6f42c2dfb6ddeef8f76cdda8e66
10 Feb, 2020
2 commits
-
Pull new zonefs file system from Damien Le Moal:
"Zonefs is a very simple file system exposing each zone of a zoned
block device as a file.Unlike a regular file system with native zoned block device support
(e.g. f2fs or the on-going btrfs effort), zonefs does not hide the
sequential write constraint of zoned block devices to the user. As a
result, zonefs is not a POSIX compliant file system. Its goal is to
simplify the implementation of zoned block devices support in
applications by replacing raw block device file accesses with a richer
file based API, avoiding relying on direct block device file ioctls
which may be more obscure to developers.One example of this approach is the implementation of LSM
(log-structured merge) tree structures (such as used in RocksDB and
LevelDB) on zoned block devices by allowing SSTables to be stored in a
zone file similarly to a regular file system rather than as a range of
sectors of a zoned device. The introduction of the higher level
construct "one file is one zone" can help reducing the amount of
changes needed in the application while at the same time allowing the
use of zoned block devices with various programming languages other
than C.Zonefs IO management implementation uses the new iomap generic code.
Zonefs has been successfully tested using a functional test suite
(available with zonefs userland format tool on github) and a prototype
implementation of LevelDB on top of zonefs"* tag 'zonefs-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
zonefs: Add documentation
fs: New zonefs file system -
Pull vboxfs from Al Viro:
"This is the VirtualBox guest shared folder support by Hans de Goede,
with fixups for fs_parse folded in to avoid bisection hazards from
those API changes..."* 'work.vboxsf' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fs: Add VirtualBox guest shared folder (vboxsf) support
09 Feb, 2020
1 commit
-
VirtualBox hosts can share folders with guests, this commit adds a
VFS driver implementing the Linux-guest side of this, allowing folders
exported by the host to be mounted under Linux.This driver depends on the guest host IPC functions exported by
the vboxguest driver.Acked-by: Christoph Hellwig
Signed-off-by: Hans de Goede
Signed-off-by: Al Viro
07 Feb, 2020
1 commit
-
zonefs is a very simple file system exposing each zone of a zoned block
device as a file. Unlike a regular file system with zoned block device
support (e.g. f2fs), zonefs does not hide the sequential write
constraint of zoned block devices to the user. Files representing
sequential write zones of the device must be written sequentially
starting from the end of the file (append only writes).As such, zonefs is in essence closer to a raw block device access
interface than to a full featured POSIX file system. The goal of zonefs
is to simplify the implementation of zoned block device support in
applications by replacing raw block device file accesses with a richer
file API, avoiding relying on direct block device file ioctls which may
be more obscure to developers. One example of this approach is the
implementation of LSM (log-structured merge) tree structures (such as
used in RocksDB and LevelDB) on zoned block devices by allowing SSTables
to be stored in a zone file similarly to a regular file system rather
than as a range of sectors of a zoned device. The introduction of the
higher level construct "one file is one zone" can help reducing the
amount of changes needed in the application as well as introducing
support for different application programming languages.Zonefs on-disk metadata is reduced to an immutable super block to
persistently store a magic number and optional feature flags and
values. On mount, zonefs uses blkdev_report_zones() to obtain the device
zone configuration and populates the mount point with a static file tree
solely based on this information. E.g. file sizes come from the device
zone type and write pointer offset managed by the device itself.The zone files created on mount have the following characteristics.
1) Files representing zones of the same type are grouped together
under a common sub-directory:
* For conventional zones, the sub-directory "cnv" is used.
* For sequential write zones, the sub-directory "seq" is used.
These two directories are the only directories that exist in zonefs.
Users cannot create other directories and cannot rename nor delete
the "cnv" and "seq" sub-directories.
2) The name of zone files is the number of the file within the zone
type sub-directory, in order of increasing zone start sector.
3) The size of conventional zone files is fixed to the device zone size.
Conventional zone files cannot be truncated.
4) The size of sequential zone files represent the file's zone write
pointer position relative to the zone start sector. Truncating these
files is allowed only down to 0, in which case, the zone is reset to
rewind the zone write pointer position to the start of the zone, or
up to the zone size, in which case the file's zone is transitioned
to the FULL state (finish zone operation).
5) All read and write operations to files are not allowed beyond the
file zone size. Any access exceeding the zone size is failed with
the -EFBIG error.
6) Creating, deleting, renaming or modifying any attribute of files and
sub-directories is not allowed.
7) There are no restrictions on the type of read and write operations
that can be issued to conventional zone files. Buffered, direct and
mmap read & write operations are accepted. For sequential zone files,
there are no restrictions on read operations, but all write
operations must be direct IO append writes. mmap write of sequential
files is not allowed.Several optional features of zonefs can be enabled at format time.
* Conventional zone aggregation: ranges of contiguous conventional
zones can be aggregated into a single larger file instead of the
default one file per zone.
* File ownership: The owner UID and GID of zone files is by default 0
(root) but can be changed to any valid UID/GID.
* File access permissions: the default 640 access permissions can be
changed.The mkzonefs tool is used to format zoned block devices for use with
zonefs. This tool is available on Github at:git@github.com:damien-lemoal/zonefs-tools.git.
zonefs-tools also includes a test suite which can be run against any
zoned block device, including null_blk block device created with zoned
mode.Example: the following formats a 15TB host-managed SMR HDD with 256 MB
zones with the conventional zones aggregation feature enabled.$ sudo mkzonefs -o aggr_cnv /dev/sdX
$ sudo mount -t zonefs /dev/sdX /mnt
$ ls -l /mnt/
total 0
dr-xr-xr-x 2 root root 1 Nov 25 13:23 cnv
dr-xr-xr-x 2 root root 55356 Nov 25 13:23 seqThe size of the zone files sub-directories indicate the number of files
existing for each type of zones. In this example, there is only one
conventional zone file (all conventional zones are aggregated under a
single file).$ ls -l /mnt/cnv
total 137101312
-rw-r----- 1 root root 140391743488 Nov 25 13:23 0This aggregated conventional zone file can be used as a regular file.
$ sudo mkfs.ext4 /mnt/cnv/0
$ sudo mount -o loop /mnt/cnv/0 /dataThe "seq" sub-directory grouping files for sequential write zones has
in this example 55356 zones.$ ls -lv /mnt/seq
total 14511243264
-rw-r----- 1 root root 0 Nov 25 13:23 0
-rw-r----- 1 root root 0 Nov 25 13:23 1
-rw-r----- 1 root root 0 Nov 25 13:23 2
...
-rw-r----- 1 root root 0 Nov 25 13:23 55354
-rw-r----- 1 root root 0 Nov 25 13:23 55355For sequential write zone files, the file size changes as data is
appended at the end of the file, similarly to any regular file system.$ dd if=/dev/zero of=/mnt/seq/0 bs=4K count=1 conv=notrunc oflag=direct
1+0 records in
1+0 records out
4096 bytes (4.1 kB, 4.0 KiB) copied, 0.000452219 s, 9.1 MB/s$ ls -l /mnt/seq/0
-rw-r----- 1 root root 4096 Nov 25 13:23 /mnt/seq/0The written file can be truncated to the zone size, preventing any
further write operation.$ truncate -s 268435456 /mnt/seq/0
$ ls -l /mnt/seq/0
-rw-r----- 1 root root 268435456 Nov 25 13:49 /mnt/seq/0Truncation to 0 size allows freeing the file zone storage space and
restart append-writes to the file.$ truncate -s 0 /mnt/seq/0
$ ls -l /mnt/seq/0
-rw-r----- 1 root root 0 Nov 25 13:49 /mnt/seq/0Since files are statically mapped to zones on the disk, the number of
blocks of a file as reported by stat() and fstat() indicates the size
of the file zone.$ stat /mnt/seq/0
File: /mnt/seq/0
Size: 0 Blocks: 524288 IO Block: 4096 regular empty file
Device: 870h/2160d Inode: 50431 Links: 1
Access: (0640/-rw-r-----) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2019-11-25 13:23:57.048971997 +0900
Modify: 2019-11-25 13:52:25.553805765 +0900
Change: 2019-11-25 13:52:25.553805765 +0900
Birth: -The number of blocks of the file ("Blocks") in units of 512B blocks
gives the maximum file size of 524288 * 512 B = 256 MB, corresponding
to the device zone size in this example. Of note is that the "IO block"
field always indicates the minimum IO size for writes and corresponds
to the device physical sector size.This code contains contributions from:
* Johannes Thumshirn ,
* Darrick J. Wong ,
* Christoph Hellwig ,
* Chaitanya Kulkarni and
* Ting Yao .Signed-off-by: Damien Le Moal
Reviewed-by: Dave Chinner
04 Feb, 2020
1 commit
-
Fully working incremental fs filesystem
Signed-off-by: Eugene Zemtsov
Signed-off-by: Paul LawrenceBug: 133435829
Change-Id: I14741a61ce7891a0f9054e70f026917712cbef78
03 Feb, 2020
1 commit
-
…/kernel/git/jejb/scsi") into android-mainline
Baby steps in the 5.6-rc1 merge cycle to make things easier to review
and debug.Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I21591d9c9b073f02dde6aae031bd740fe512251b
03 Jan, 2020
1 commit
-
The rest of the fs/compat_ioctl.c file is no longer useful now,
so move the actual syscall as planned.Reviewed-by: Ben Hutchings
Signed-off-by: Arnd Bergmann
09 Dec, 2019
1 commit
-
Linux 5.5-rc1
Signed-off-by: Greg Kroah-Hartman
Change-Id: I6f952ebdd40746115165a2f99bab340482f5c237
30 Oct, 2019
1 commit
-
This adds support for io-wq, a smaller and specialized thread pool
implementation. This is meant to replace workqueues for io_uring. Among
the reasons for this addition are:- We can assign memory context smarter and more persistently if we
manage the life time of threads.- We can drop various work-arounds we have in io_uring, like the
async_list.- We can implement hashed work insertion, to manage concurrency of
buffered writes without needing a) an extra workqueue, or b)
needlessly making the concurrency of said workqueue very low
which hurts performance of multiple buffered file writers.- We can implement cancel through signals, for cancelling
interruptible work like read/write (or send/recv) to/from sockets.- We need the above cancel for being able to assign and use file tables
from a process.- We can implement a more thorough cancel operation in general.
- We need it to move towards a syslet/threadlet model for even faster
async execution. For that we need to take ownership of the used
threads.This list is just off the top of my head. Performance should be the
same, or better, at least that's what I've seen in my testing. io-wq
supports basic NUMA functionality, setting up a pool per node.io-wq hooks up to the scheduler schedule in/out just like workqueue
and uses that to drive the need for more/less workers.Acked-by: Peter Zijlstra (Intel)
Signed-off-by: Jens Axboe
21 Sep, 2019
1 commit
-
This merges Linus's tree as of commit b41dae061bbd ("Merge tag
'xfs-5.4-merge-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux")
into android-mainline.This "early" merge makes it easier to test and handle merge conflicts
instead of having to wait until the "end" of the merge window and handle
all 10000+ commits at once.Signed-off-by: Greg Kroah-Hartman
Change-Id: I6bebf55e5e2353f814e3c87f5033607b1ae5d812
19 Sep, 2019
1 commit
-
Pull fs-verity support from Eric Biggers:
"fs-verity is a filesystem feature that provides Merkle tree based
hashing (similar to dm-verity) for individual readonly files, mainly
for the purpose of efficient authenticity verification.This pull request includes:
(a) The fs/verity/ support layer and documentation.
(b) fs-verity support for ext4 and f2fs.
Compared to the original fs-verity patchset from last year, the UAPI
to enable fs-verity on a file has been greatly simplified. Lots of
other things were cleaned up too.fs-verity is planned to be used by two different projects on Android;
most of the userspace code is in place already. Another userspace tool
("fsverity-utils"), and xfstests, are also available. e2fsprogs and
f2fs-tools already have fs-verity support. Other people have shown
interest in using fs-verity too.I've tested this on ext4 and f2fs with xfstests, both the existing
tests and the new fs-verity tests. This has also been in linux-next
since July 30 with no reported issues except a couple minor ones I
found myself and folded in fixes for.Ted and I will be co-maintaining fs-verity"
* tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt:
f2fs: add fs-verity support
ext4: update on-disk format documentation for fs-verity
ext4: add fs-verity read support
ext4: add basic fs-verity support
fs-verity: support builtin file signatures
fs-verity: add SHA-512 support
fs-verity: implement FS_IOC_MEASURE_VERITY ioctl
fs-verity: implement FS_IOC_ENABLE_VERITY ioctl
fs-verity: add data verification hooks for ->readpages()
fs-verity: add the hook for file ->setattr()
fs-verity: add the hook for file ->open()
fs-verity: add inode and superblock fields
fs-verity: add Kconfig and the helper functions for hashing
fs: uapi: define verity bit for FS_IOC_GETFLAGS
fs-verity: add UAPI header
fs-verity: add MAINTAINERS file entry
fs-verity: add a documentation file
24 Aug, 2019
1 commit
-
EROFS filesystem has been merged into linux-staging for a year.
EROFS is designed to be a better solution of saving extra storage
space with guaranteed end-to-end performance for read-only files
with the help of reduced metadata, fixed-sized output compression
and decompression inplace technologies.In the past year, EROFS was greatly improved by many people as
a staging driver, self-tested, betaed by a large number of our
internal users, successfully applied to almost all in-service
HUAWEI smartphones as the part of EMUI 9.1 and proven to be stable
enough to be moved out of staging.EROFS is a self-contained filesystem driver. Although there are
still some TODOs to be more generic, we have a dedicated team
actively keeping on working on EROFS in order to make it better
with the evolution of Linux kernel as the other in-kernel filesystems.As Pavel suggested, it's better to do as one commit since git
can do moves and all histories will be saved in this way.Let's promote it from staging and enhance it more actively as
a "real" part of kernel for more wider scenarios!Cc: Greg Kroah-Hartman
Cc: Alexander Viro
Cc: Andrew Morton
Cc: Stephen Rothwell
Cc: Theodore Ts'o
Cc: Pavel Machek
Cc: David Sterba
Cc: Amir Goldstein
Cc: Christoph Hellwig
Cc: Darrick J . Wong
Cc: Dave Chinner
Cc: Jaegeuk Kim
Cc: Jan Kara
Cc: Richard Weinberger
Cc: Linus Torvalds
Cc: Chao Yu
Cc: Miao Xie
Cc: Li Guifu
Cc: Fang Wei
Signed-off-by: Gao Xiang
Link: https://lore.kernel.org/r/20190822213659.5501-1-hsiangkao@aol.com
Signed-off-by: Greg Kroah-Hartman
29 Jul, 2019
1 commit
-
Add the beginnings of the fs/verity/ support layer, including the
Kconfig option and various helper functions for hashing. To start, only
SHA-256 is supported, but other hash algorithms can easily be added.Reviewed-by: Theodore Ts'o
Reviewed-by: Jaegeuk Kim
Signed-off-by: Eric Biggers
24 Jul, 2019
1 commit
-
Linus 5.3-rc1 release
Signed-off-by: Greg Kroah-Hartman
Change-Id: Ic171e37d4c21ffa495240c5538852bbb5a9dcce8
20 Jul, 2019
1 commit
-
Bug: 11118565
Bug: 27915347
Bug: 27992761
Bug: 28024488
Bug: 30013843
Bug: 30954918
Bug: 34133558
Bug: 34262585
Bug: 34542611
Bug: 34691169
Bug: 34723223
Bug: 35307857
Bug: 35331000
Bug: 35633782
Bug: 35643557
Bug: 35666680
bug: 35766959
Bug: 35766959
Bug: 35848445
Bug: 36004503
Bug: 36007653
Bug: 36138424
Bug: 36160015
Bug: 37193650
Bug: 37231161
Bug: 37488099
Bug: 37516160
Bug: 38045152
Bug: 38117720
Bug: 38502532
Bug: 62390017
Bug: 63245673
Bug: 63260873
Bug: 63785372
Bug: 64672411
Bug: 70278506
Bug: 72007585
Bug: 73055997
Bug: 73287721
Bug: 75987238
Bug: 77923821
Bug: 78262592
Bug: 111641492
Bug: 111642636
Bug: 111860541
Change-Id: Ic1e01e602ce335d97342be54f3da0c5c65c087cc
Signed-off-by: Daniel Rosenberg
[astrachan: Folded the following changes into this patch:
903cea7ab0b2 ("ANDROID: Included sdcardfs source code for kernel 3.0")
612a725e3d97 ("ANDROID: Port of sdcardfs to 4.4")
e4187c55208b ("ANDROID: Changed type-casting in packagelist management")
cf76072a5cd8 ("ANDROID: sdcardfs: Bring up to date with Android M permissions:")
a43aa502c608 ("ANDROID: sdcardfs: Add support for d_canonical_path")
d8fefbf85af2 ("ANDROID: sdcardfs: remove effectless config option")
416677409336 ("ANDROID: sdcardfs: Remove unused code")
8e49a570d351 ("ANDROID: sdcardfs: remove unneeded __init and __exit")
40ee0e93f1d7 ("ANDROID: sdcardfs: Truncate packages_gid.list on overflow")
b1d9602aa3fe ("ANDROID: sdcardfs: fix itnull.cocci warnings")
60a177f5a167 ("ANDROID: sdcardfs: override umask on mkdir and create")
efb3d2695203 ("ANDROID: sdcardfs: Check for other cases on path lookup")
0da87f63666f ("ANDROID: sdcardfs: Fix locking for permission fix up")
75b93060655e ("ANDROID: sdcardfs: Switch package list to RCU")
657b0a00f497 ("ANDROID: sdcardfs: Added top to sdcardfs_inode_info")
5008d91cba25 ("ANDROID: sdcardfs: fix external storage exporting incorrect uid")
e06c452d0d07 ("ANDROID: sdcardfs: Move directory unlock before touch")
72e5443a2816 ("ANDROID: sdcardfs: User new permission2 functions")
ae8be7da556d ("ANDROID: sdcardfs: Add gid and mask to private mount data")
151a3efe57a6 ("ANDROID: sdcardfs: Use per mount permissions")
cff865a370f3 ("ANDROID: sdcardfs: Switch ->d_inode to d_inode()")
065ac66804bf ("ANDROID: sdcardfs: Fix locking issue with permision fix up")
31ea603eb3c4 ("ANDROID: sdcardfs: use wrappers to access i_mutex")
c25c2f5018a2 ("ANDROID: sdcardfs: add parent pointer into dentry name hash")
58616bb4ec68 ("ANDROID: sdcardfs: get rid of 'parent' argument of ->d_compare()")
1654d7ffdd20 ("ANDROID: sdcardfs: Propagate dentry down to inode_change_ok()")
39335cac1d2f ("ANDROID: sdcardfs: make it use new .rename i_op")
7622bb3fcc79 ("ANDROID: sdcardfs: eliminate the offset argument to ->direct_IO")
843bd7295ee0 ("ANDROID: sdcardfs: Allow non-owners to touch")
e3d74804d174 ("ANDROID: sdcardfs: Refactor configfs interface")
5833eda87a72 ("ANDROID: sdcardfs: add support for user permission isolation")
d83fb1f41dd4 ("ANDROID: sdcardfs: Remove redundant operation")
8767af17c0e5 ("ANDROID: sdcardfs: Add GID Derivation to sdcardfs")
7119d96ad3ee ("ANDROID: sdcardfs: switch to full_name_hash and qstr")
778e02a54859 ("ANDROID: sdcardfs: Switch strcasecmp for internal call")
cd4965d04404 ("ANDROID: sdcardfs: Fix incorrect hash")
40a2ee053505 ("ANDROID: sdcardfs: Add missing path_put")
da5342bac57a ("ANDROID: sdcardfs: Don't bother deleting freelist")
c91857b01e05 ("ANDROID: sdcardfs: implement vm_ops->page_mkwrite")
f62b3906044b ("ANDROID: sdcardfs: support direct-IO (DIO) operations")
c2e216d36d63 ("ANDROID: sdcardfs: Fix case insensitive lookup")
57b92ab6f774 ("ANDROID: sdcardfs: rate limit warning print")
8534cee39a81 ("ANDROID: sdcardfs: Replace get/put with d_lock")
156085b2fccf ("ANDROID: sdcardfs: Use spin_lock_nested")
8a260cabac4e ("ANDROID: sdcardfs: Switch to internal case insensitive compare")
a8d51569573c ("ANDROID: sdcardfs: Use d_invalidate instead of drop_recurisve")
932a6071de63 ("ANDROID: sdcardfs: Get the blocksize from the lower fs")
0ad4c0f87527 ("ANDROID: sdcardfs: declare MODULE_ALIAS_FS")
b97c83b5b683 ("ANDROID: sdcardfs: Use case insensitive hash function")
9920dfb08265 ("ANDROID: sdcardfs: move path_put outside of spinlock")
f9a25348b233 ("ANDROID: sdcardfs: Remove uninformative prints")
720d9030bea1 ("ANDROID: sdcardfs: Fix gid issue")
4cbb7fa6e66c ("ANDROID: sdcardfs: correct order of descriptors")
6cff6cc301ed ("ANDROID: sdcardfs: Fix formatting")
ac2a40412e26 ("ANDROID: sdcardfs: Fix style issues with comments")
2212bb8ec064 ("ANDROID: sdcardfs: remove unneeded null check")
4c1a0add8d21 ("ANDROID: sdcardfs: Use pr_[...] instead of printk")
74535fe211ac ("ANDROID: sdcardfs: Use to kstrout")
e6cf8dffd014 ("ANDROID: sdcardfs: Use seq_puts over seq_printf")
2b1ac93a90b6 ("ANDROID: sdcardfs: Fix style issues in macros")
bab6d117426f ("ANDROID: sdcardfs: remove unnecessary call to do_munmap")
1c0bf09f19b6 ("ANDROID: sdcardfs: copy lower inode attributes in ->ioctl")
42f3db55942b ("ANDROID: sdcardfs: fix ->llseek to update upper and lower offset")
97ad6205055e ("ANDROID: sdcardfs: add read_iter/write_iter opeations")
be9abc81332b ("ANDROID: sdcardfs: use d_splice_alias")
4e90114cb1b4 ("ANDROID: sdcardfs: update module info")
0e1f7ab14924 ("ANDROID: sdcardfs: Directly pass lower file for mmap")
28be4beb43f9 ("ANDROID: sdcardfs: Change cache GID value")
9fc2c452aefe ("ANDROID: sdcardfs: ->iget fixes")
9bb72cf15cbc ("ANDROID: sdcardfs: Don't do d_add for lower fs")
1bc21a04c11b ("ANDROID: sdcardfs: Don't complain in fixup_lower_ownership")
0fb5b10b28a9 ("ANDROID: sdcardfs: Use filesystem specific hash")
30e2f0aadce2 ("ANDROID: sdcardfs: Copy meta-data from lower inode")
f748c7053194 ("ANDROID: sdcardfs: Avoid setting GIDs outside of valid ranges")
3d38f08bacdb ("ANDROID: sdcardfs: Call lower fs's revalidate")
2d1f1c203978 ("ANDROID: sdcardfs: Don't iput if we didn't igrab")
857fc5e717fc ("ANDROID: sdcardfs: fix sdcardfs_destroy_inode for the inode RCU approach")
4fceeccf1d23 ("ANDROID: sdcardfs: Move top to its own struct")
f51470044a15 ("ANDROID: sdcardfs: Check for NULL in revalidate")
8c7f6c97ac81 ("ANDROID: sdcardfs: d_splice_alias can return error values")
17da01b37d61 ("ANDROID: sdcardfs: remove dead function open_flags_to_access_mode()")
16662dd604be ("ANDROID: sdcardfs: use mount_nodev and fix a issue in sdcardfs_kill_sb")
43c0dca6039a ("ANDROID: sdcardfs: Remove unnecessary lock")
48960c25cdc1 ("ANDROID: sdcardfs: override credential for ioctl to lower fs")
5d6410b9a88d ("ANDROID: Sdcardfs: Move gid derivation under flag")
c7dd98431f83 ("ANDROID: sdcardfs: Add default_normal option")
db9bf31a5d86 ("ANDROID: sdcardfs: port to 4.14")
c70c9d1e82d2 ("ANDROID: sdcardfs: Use lower getattr times/size")
04e961477d62 ("ANDROID: sdcardfs: Protect set_top")
1ed04b79d281 ("ANDROID: sdcardfs: Hold i_mutex for i_size_write")
77f52fc10982 ("ANDROID: sdcardfs: Set num in extension_details during make_item")
d71596efa247 ("ANDROID: sdcardfs: fix lock issue on 32 bit/SMP architectures")
ee6b07fced4a ("ANDROID: sdcardfs: Fix sdcardfs to stop creating cases-sensitive duplicate entries.")
ce12807d5b75 ("ANDROID: sdcardfs: Check for private data earlier")
c080450304cd ("ANDROID: sdcardfs: d_make_root calls iput")
900e77796781 ("ANDROID: sdcardfs: Set s_root to NULL after putting")
49092e89ffa4 ("ANDROID: sdcardfs: Don't d_drop in d_revalidate")
e1f978bc9b9c ("ANDROID: sdcardfs: fix potential crash when reserved_mb is not zero")
faa148eaf8ed ("ANDROID: sdcardfs: Check stacked filesystem depth")
6edd721e972c ("ANDROID: sdcardfs: Don't use OVERRIDE_CRED macro")
11ca578b4336 ("ANDROID: sdcardfs: Change current->fs under lock")
83dea6ba6ea7 ("ANDROID: sdcardfs: Use inode iversion helpers")
12064f3a794e ("ANDROID: sdcardfs: Add option to drop unused dentries")
d9fe221bbf84 ("ANDROID: sdcardfs: Add sandbox")
f544ad0b1547 ("ANDROID: sdcardfs: Add option to not link obb")]
Signed-off-by: Alistair Strachan
[drosen: folded in e6e368c99975 ("fs: sdcardfs: Add missing option to show_options")]
17 Jul, 2019
1 commit
-
Move the main iteration code into a separate file so that we can group
related functions in a single file instead of having a single enormous
source file.Signed-off-by: Darrick J. Wong
Reviewed-by: Christoph Hellwig
15 Jul, 2019
1 commit
-
Create the build infrastructure we need to start migrating iomap code to
fs/iomap/ from fs/iomap.c.Signed-off-by: Darrick J. Wong
Reviewed-by: Christoph Hellwig
08 May, 2019
1 commit
-
Pull ext4 updates from Ted Ts'o:
"Add as a feature case-insensitive directories (the casefold feature)
using Unicode 12.1.Also, the usual largish number of cleanups and bug fixes"
* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (25 commits)
ext4: export /sys/fs/ext4/feature/casefold if Unicode support is present
ext4: fix ext4_show_options for file systems w/o journal
unicode: refactor the rule for regenerating utf8data.h
docs: ext4.rst: document case-insensitive directories
ext4: Support case-insensitive file name lookups
ext4: include charset encoding information in the superblock
MAINTAINERS: add Unicode subsystem entry
unicode: update unicode database unicode version 12.1.0
unicode: introduce test module for normalized utf8 implementation
unicode: implement higher level API for string handling
unicode: reduce the size of utf8data[]
unicode: introduce code for UTF-8 normalization
unicode: introduce UTF-8 character database
ext4: actually request zeroing of inode table after grow
ext4: cond_resched in work-heavy group loops
ext4: fix use-after-free race with debug_want_extra_isize
ext4: avoid drop reference to iloc.bh twice
ext4: ignore e_value_offs for xattrs with value-in-ea-inode
ext4: protect journal inode's blocks using block_validity
ext4: use BUG() instead of BUG_ON(1)
...
26 Apr, 2019
1 commit
-
The decomposition and casefolding of UTF-8 characters are described in a
prefix tree in utf8data.h, which is a generate from the Unicode
Character Database (UCD), published by the Unicode Consortium, and
should not be edited by hand. The structures in utf8data.h are meant to
be used for lookup operations by the unicode subsystem, when decoding a
utf-8 string.mkutf8data.c is the source for a program that generates utf8data.h. It
was written by Olaf Weber from SGI and originally proposed to be merged
into Linux in 2014. The original proposal performed the compatibility
decomposition, NFKD, but the current version was modified by me to do
canonical decomposition, NFD, as suggested by the community. The
changes from the original submission are:* Rebase to mainline.
* Fix out-of-tree-build.
* Update makefile to build 11.0.0 ucd files.
* drop references to xfs.
* Convert NFKD to NFD.
* Merge back robustness fixes from original patch. Requested by
Dave Chinner.The original submission is archived at:
The utf8data.h file can be regenerated using the instructions in
fs/unicode/README.utf8data.- Notes on the update from 8.0.0 to 11.0:
The structure of the ucd files and special cases have not experienced
any changes between versions 8.0.0 and 11.0.0. 8.0.0 saw the addition
of Cherokee LC characters, which is an interesting case for
case-folding. The update is accompanied by new tests on the test_ucd
module to catch specific cases. No changes to mkutf8data script were
required for the updates.Signed-off-by: Gabriel Krisman Bertazi
Signed-off-by: Theodore Ts'o
21 Mar, 2019
2 commits
-
Provide an fsopen() system call that starts the process of preparing to
create a superblock that will then be mountable, using an fd as a context
handle. fsopen() is given the name of the filesystem that will be used:int mfd = fsopen(const char *fsname, unsigned int flags);
where flags can be 0 or FSOPEN_CLOEXEC.
For example:
sfd = fsopen("ext4", FSOPEN_CLOEXEC);
fsconfig(sfd, FSCONFIG_SET_PATH, "source", "/dev/sda1", AT_FDCWD);
fsconfig(sfd, FSCONFIG_SET_FLAG, "noatime", NULL, 0);
fsconfig(sfd, FSCONFIG_SET_FLAG, "acl", NULL, 0);
fsconfig(sfd, FSCONFIG_SET_FLAG, "user_xattr", NULL, 0);
fsconfig(sfd, FSCONFIG_SET_STRING, "sb", "1", 0);
fsconfig(sfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0);
fsinfo(sfd, NULL, ...); // query new superblock attributes
mfd = fsmount(sfd, FSMOUNT_CLOEXEC, MS_RELATIME);
move_mount(mfd, "", sfd, AT_FDCWD, "/mnt", MOVE_MOUNT_F_EMPTY_PATH);sfd = fsopen("afs", -1);
fsconfig(fd, FSCONFIG_SET_STRING, "source",
"#grand.central.org:root.cell", 0);
fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0);
mfd = fsmount(sfd, 0, MS_NODEV);
move_mount(mfd, "", sfd, AT_FDCWD, "/mnt", MOVE_MOUNT_F_EMPTY_PATH);If an error is reported at any step, an error message may be available to be
read() back (ENODATA will be reported if there isn't an error available) in
the form:"e :"
"e SELinux:Mount on mountpoint not permitted"Once fsmount() has been called, further fsconfig() calls will incur EBUSY,
even if the fsmount() fails. read() is still possible to retrieve error
information.The fsopen() syscall creates a mount context and hangs it of the fd that it
returns.Netlink is not used because it is optional and would make the core VFS
dependent on the networking layer and also potentially add network
namespace issues.Note that, for the moment, the caller must have SYS_CAP_ADMIN to use
fsopen().Signed-off-by: David Howells
cc: linux-api@vger.kernel.org
Signed-off-by: Al Viro -
Make the anon_inodes facility unconditional so that it can be used by core
VFS code.Signed-off-by: David Howells
Signed-off-by: Al Viro
13 Mar, 2019
1 commit
-
Pull vfs mount infrastructure updates from Al Viro:
"The rest of core infrastructure; no new syscalls in that pile, but the
old parts are switched to new infrastructure. At that point
conversions of individual filesystems can happen independently; some
are done here (afs, cgroup, procfs, etc.), there's also a large series
outside of that pile dealing with NFS (quite a bit of option-parsing
stuff is getting used there - it's one of the most convoluted
filesystems in terms of mount-related logics), but NFS bits are the
next cycle fodder.It got seriously simplified since the last cycle; documentation is
probably the weakest bit at the moment - I considered dropping the
commit introducing Documentation/filesystems/mount_api.txt (cutting
the size increase by quarter ;-), but decided that it would be better
to fix it up after -rc1 instead.That pile allows to do followup work in independent branches, which
should make life much easier for the next cycle. fs/super.c size
increase is unpleasant; there's a followup series that allows to
shrink it considerably, but I decided to leave that until the next
cycle"* 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (41 commits)
afs: Use fs_context to pass parameters over automount
afs: Add fs_context support
vfs: Add some logging to the core users of the fs_context log
vfs: Implement logging through fs_context
vfs: Provide documentation for new mount API
vfs: Remove kern_mount_data()
hugetlbfs: Convert to fs_context
cpuset: Use fs_context
kernfs, sysfs, cgroup, intel_rdt: Support fs_context
cgroup: store a reference to cgroup_ns into cgroup_fs_context
cgroup1_get_tree(): separate "get cgroup_root to use" into a separate helper
cgroup_do_mount(): massage calling conventions
cgroup: stash cgroup_root reference into cgroup_fs_context
cgroup2: switch to option-by-option parsing
cgroup1: switch to option-by-option parsing
cgroup: take options parsing into ->parse_monolithic()
cgroup: fold cgroup1_mount() into cgroup1_get_tree()
cgroup: start switching to fs_context
ipc: Convert mqueue fs to fs_context
proc: Add fs_context support to procfs
...
10 Mar, 2019
1 commit
-
Pull SCSI updates from James Bottomley:
"This is mostly update of the usual drivers: arcmsr, qla2xxx, lpfc,
hisi_sas, target/iscsi and target/core.Additionally Christoph refactored gdth as part of the dma changes. The
major mid-layer change this time is the removal of bidi commands and
with them the whole of the osd/exofs driver and filesystem. This is a
major simplification for block and mq in particular"* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (240 commits)
scsi: cxgb4i: validate tcp sequence number only if chip version pf
scsi: core: replace GFP_ATOMIC with GFP_KERNEL in scsi_scan.c
scsi: mpt3sas: Add missing breaks in switch statements
scsi: aacraid: Fix missing break in switch statement
scsi: kill command serial number
scsi: csiostor: drop serial_number usage
scsi: mvumi: use request tag instead of serial_number
scsi: dpt_i2o: remove serial number usage
scsi: st: osst: Remove negative constant left-shifts
scsi: ufs-bsg: Allow reading descriptors
scsi: ufs: Allow reading descriptor via raw upiu
scsi: ufs-bsg: Change the calling convention for write descriptor
scsi: ufs: Remove unused device quirks
Revert "scsi: ufs: disable vccq if it's not needed by UFS device"
scsi: megaraid_sas: Remove a bunch of set but not used variables
scsi: clean obsolete return values of eh_timed_out
scsi: sd: Optimal I/O size should be a multiple of physical block size
scsi: MAINTAINERS: SCSI initiator and target tweaks
scsi: fcoe: make use of fip_mode enum complete
...
09 Mar, 2019
1 commit
-
Pull io_uring IO interface from Jens Axboe:
"Second attempt at adding the io_uring interface.Since the first one, we've added basic unit testing of the three
system calls, that resides in liburing like the other unit tests that
we have so far. It'll take a while to get full coverage of it, but
we're working towards it. I've also added two basic test programs to
tools/io_uring. One uses the raw interface and has support for all the
various features that io_uring supports outside of standard IO, like
fixed files, fixed IO buffers, and polled IO. The other uses the
liburing API, and is a simplified version of cp(1).This adds support for a new IO interface, io_uring.
io_uring allows an application to communicate with the kernel through
two rings, the submission queue (SQ) and completion queue (CQ) ring.
This allows for very efficient handling of IOs, see the v5 posting for
some basic numbers:https://lore.kernel.org/linux-block/20190116175003.17880-1-axboe@kernel.dk/
Outside of just efficiency, the interface is also flexible and
extendable, and allows for future use cases like the upcoming NVMe
key-value store API, networked IO, and so on. It also supports async
buffered IO, something that we've always failed to support in the
kernel.Outside of basic IO features, it supports async polled IO as well.
This particular feature has already been tested at Facebook months ago
for flash storage boxes, with 25-33% improvements. It makes polled IO
actually useful for real world use cases, where even basic flash sees
a nice win in terms of efficiency, latency, and performance. These
boxes were IOPS bound before, now they are not.This series adds three new system calls. One for setting up an
io_uring instance (io_uring_setup(2)), one for submitting/completing
IO (io_uring_enter(2)), and one for aux functions like registrating
file sets, buffers, etc (io_uring_register(2)). Through the help of
Arnd, I've coordinated the syscall numbers so merge on that front
should be painless.Jon did a writeup of the interface a while back, which (except for
minor details that have been tweaked) is still accurate. Find that
here:https://lwn.net/Articles/776703/
Huge thanks to Al Viro for helping getting the reference cycle code
correct, and to Jann Horn for his extensive reviews focused on both
security and bugs in general.There's a userspace library that provides basic functionality for
applications that don't need or want to care about how to fiddle with
the rings directly. It has helpers to allow applications to easily set
up an io_uring instance, and submit/complete IO through it without
knowing about the intricacies of the rings. It also includes man pages
(thanks to Jeff Moyer), and will continue to grow support helper
functions and features as time progresses. Find it here:git://git.kernel.dk/liburing
Fio has full support for the raw interface, both in the form of an IO
engine (io_uring), but also with a small test application (t/io_uring)
that can exercise and benchmark the interface"* tag 'io_uring-2019-03-06' of git://git.kernel.dk/linux-block:
io_uring: add a few test tools
io_uring: allow workqueue item to handle multiple buffered requests
io_uring: add support for IORING_OP_POLL
io_uring: add io_kiocb ref count
io_uring: add submission polling
io_uring: add file set registration
net: split out functions related to registering inflight socket files
io_uring: add support for pre-mapped user IO buffers
block: implement bio helper to add iter bvec pages to bio
io_uring: batch io_kiocb allocation
io_uring: use fget/fput_many() for file references
fs: add fget_many() and fput_many()
io_uring: support for IO polling
io_uring: add fsync support
Add io_uring IO interface
28 Feb, 2019
2 commits
-
The submission queue (SQ) and completion queue (CQ) rings are shared
between the application and the kernel. This eliminates the need to
copy data back and forth to submit and complete IO.IO submissions use the io_uring_sqe data structure, and completions
are generated in the form of io_uring_cqe data structures. The SQ
ring is an index into the io_uring_sqe array, which makes it possible
to submit a batch of IOs without them being contiguous in the ring.
The CQ ring is always contiguous, as completion events are inherently
unordered, and hence any io_uring_cqe entry can point back to an
arbitrary submission.Two new system calls are added for this:
io_uring_setup(entries, params)
Sets up an io_uring instance for doing async IO. On success,
returns a file descriptor that the application can mmap to
gain access to the SQ ring, CQ ring, and io_uring_sqes.io_uring_enter(fd, to_submit, min_complete, flags, sigset, sigsetsize)
Initiates IO against the rings mapped to this fd, or waits for
them to complete, or both. The behavior is controlled by the
parameters passed in. If 'to_submit' is non-zero, then we'll
try and submit new IO. If IORING_ENTER_GETEVENTS is set, the
kernel will wait for 'min_complete' events, if they aren't
already available. It's valid to set IORING_ENTER_GETEVENTS
and 'min_complete' == 0 at the same time, this allows the
kernel to return already completed events without waiting
for them. This is useful only for polling, as for IRQ
driven IO, the application can just check the CQ ring
without entering the kernel.With this setup, it's possible to do async IO with a single system
call. Future developments will enable polled IO with this interface,
and polled submission as well. The latter will enable an application
to do IO without doing ANY system calls at all.For IRQ driven IO, an application only needs to enter the kernel for
completions if it wants to wait for them to occur.Each io_uring is backed by a workqueue, to support buffered async IO
as well. We will only punt to an async context if the command would
need to wait for IO on the device side. Any data that can be accessed
directly in the page cache is done inline. This avoids the slowness
issue of usual threadpools, since cached data is accessed as quickly
as a sync interface.Sample application: http://git.kernel.dk/cgit/fio/plain/t/io_uring.c
Reviewed-by: Hannes Reinecke
Signed-off-by: Jens Axboe -
Because the new API passes in key,value parameters, match_token() cannot be
used with it. Instead, provide three new helpers to aid with parsing:(1) fs_parse(). This takes a parameter and a simple static description of
all the parameters and maps the key name to an ID. It returns 1 on a
match, 0 on no match if unknowns should be ignored and some other
negative error code on a parse error.The parameter description includes a list of key names to IDs, desired
parameter types and a list of enumeration name -> ID mappings.[!] Note that for the moment I've required that the key->ID mapping
array is expected to be sorted and unterminated. The size of the
array is noted in the fsconfig_parser struct. This allows me to use
bsearch(), but I'm not sure any performance gain is worth the hassle
of requiring people to keep the array sorted.The parameter type array is sized according to the number of parameter
IDs and is indexed directly. The optional enum mapping array is an
unterminated, unsorted list and the size goes into the fsconfig_parser
struct.The function can do some additional things:
(a) If it's not ambiguous and no value is given, the prefix "no" on
a key name is permitted to indicate that the parameter should
be considered negatory.(b) If the desired type is a single simple integer, it will perform
an appropriate conversion and store the result in a union in
the parse result.(c) If the desired type is an enumeration, {key ID, name} will be
looked up in the enumeration list and the matching value will
be stored in the parse result union.(d) Optionally generate an error if the key is unrecognised.
This is called something like:
enum rdt_param {
Opt_cdp,
Opt_cdpl2,
Opt_mba_mpbs,
nr__rdt_params
};const struct fs_parameter_spec rdt_param_specs[nr__rdt_params] = {
[Opt_cdp] = { fs_param_is_bool },
[Opt_cdpl2] = { fs_param_is_bool },
[Opt_mba_mpbs] = { fs_param_is_bool },
};const const char *const rdt_param_keys[nr__rdt_params] = {
[Opt_cdp] = "cdp",
[Opt_cdpl2] = "cdpl2",
[Opt_mba_mpbs] = "mba_mbps",
};const struct fs_parameter_description rdt_parser = {
.name = "rdt",
.nr_params = nr__rdt_params,
.keys = rdt_param_keys,
.specs = rdt_param_specs,
.no_source = true,
};int rdt_parse_param(struct fs_context *fc,
struct fs_parameter *param)
{
struct fs_parse_result parse;
struct rdt_fs_context *ctx = rdt_fc2context(fc);
int ret;ret = fs_parse(fc, &rdt_parser, param, &parse);
if (ret < 0)
return ret;switch (parse.key) {
case Opt_cdp:
ctx->enable_cdpl3 = true;
return 0;
case Opt_cdpl2:
ctx->enable_cdpl2 = true;
return 0;
case Opt_mba_mpbs:
ctx->enable_mba_mbps = true;
return 0;
}return -EINVAL;
}(2) fs_lookup_param(). This takes a { dirfd, path, LOOKUP_EMPTY? } or
string value and performs an appropriate path lookup to convert it
into a path object, which it will then return.If the desired type was a blockdev, the type of the looked up inode
will be checked to make sure it is one.This can be used like:
enum foo_param {
Opt_source,
nr__foo_params
};const struct fs_parameter_spec foo_param_specs[nr__foo_params] = {
[Opt_source] = { fs_param_is_blockdev },
};const char *char foo_param_keys[nr__foo_params] = {
[Opt_source] = "source",
};const struct constant_table foo_param_alt_keys[] = {
{ "device", Opt_source },
};const struct fs_parameter_description foo_parser = {
.name = "foo",
.nr_params = nr__foo_params,
.nr_alt_keys = ARRAY_SIZE(foo_param_alt_keys),
.keys = foo_param_keys,
.alt_keys = foo_param_alt_keys,
.specs = foo_param_specs,
};int foo_parse_param(struct fs_context *fc,
struct fs_parameter *param)
{
struct fs_parse_result parse;
struct foo_fs_context *ctx = foo_fc2context(fc);
int ret;ret = fs_parse(fc, &foo_parser, param, &parse);
if (ret < 0)
return ret;switch (parse.key) {
case Opt_source:
return fs_lookup_param(fc, &foo_parser, param,
&parse, &ctx->source);
default:
return -EINVAL;
}
}(3) lookup_constant(). This takes a table of named constants and looks up
the given name within it. The table is expected to be sorted such
that bsearch() be used upon it.Possibly I should require the table be terminated and just use a
for-loop to scan it instead of using bsearch() to reduce hassle.Tables look something like:
static const struct constant_table bool_names[] = {
{ "0", false },
{ "1", true },
{ "false", false },
{ "no", false },
{ "true", true },
{ "yes", true },
};and a lookup is done with something like:
b = lookup_constant(bool_names, param->string, -1);
Additionally, optional validation routines for the parameter description
are provided that can be enabled at compile time. A later patch will
invoke these when a filesystem is registered.Signed-off-by: David Howells
Signed-off-by: Al Viro