OSDN Git Service

Configure read ahead for fuse mounts
authorNikita Ioffe <ioffe@google.com>
Fri, 12 Jun 2020 11:59:45 +0000 (12:59 +0100)
committerNikita Ioffe <ioffe@google.com>
Wed, 17 Jun 2020 14:58:25 +0000 (15:58 +0100)
commitdcee5c1d213c3f034126ec806966f4e029b81140
tree6a420bb5959128a3d269261c0024973c1ed99c09
parentcbb69e548a927b4ec2933e1033f955d88004db25
Configure read ahead for fuse mounts

For fuse read ahead can be configured by writing a value to the
/sys/class/bdi/{MAJOR}:{MINOR}/read_ahead_kb file.

There are several different ways of getting {MAJOR}:{MINOR} values of
the filesystem:

* Look at st_dev of stat("/mnt/user/0/emulated").
* Parse /proc/self/mountinfo.

Stat'ing approach is used since it's easier to implement.

Bug: 157982297
Test: atest vold_tests
Test: adb shell cat /proc/self/mountinfo to get MAJOR:MINOR
Test: adb shell cat /sys/class/bdi/{MAJOR}:{MINOR}/read_ahead_kb
Test: created public volume, checked it's read_ahead_kb is also 256
Change-Id: Id0c149c4af1ceabf3afc33b4100563a512b38316
Utils.cpp
Utils.h
model/EmulatedVolume.cpp
model/PublicVolume.cpp