Rename two local variables

Improve code readability by renaming 'device' into 'loop_device' and
'device_fd' into 'loop_fd'.

Bug: 194894000
Test: Built Android images and installed these on an Android device.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Change-Id: Ia9c2d7a525e727f8706e66631b97fc4678c6a4d9
This commit is contained in:
Bart Van Assche 2021-07-29 13:53:53 -07:00 committed by Bart Van Assche
parent 381c0fc07c
commit 06b95de973

View file

@ -2071,22 +2071,22 @@ static bool PrepareZramBackingDevice(off64_t size) {
// Allocate loop device and attach it to file_path.
LoopControl loop_control;
std::string device;
if (!loop_control.Attach(target_fd.get(), 5s, &device)) {
std::string loop_device;
if (!loop_control.Attach(target_fd.get(), 5s, &loop_device)) {
return false;
}
// set block size & direct IO
unique_fd device_fd(TEMP_FAILURE_RETRY(open(device.c_str(), O_RDWR | O_CLOEXEC)));
if (device_fd.get() == -1) {
PERROR << "Cannot open " << device;
unique_fd loop_fd(TEMP_FAILURE_RETRY(open(loop_device.c_str(), O_RDWR | O_CLOEXEC)));
if (loop_fd.get() == -1) {
PERROR << "Cannot open " << loop_device;
return false;
}
if (!LoopControl::EnableDirectIo(device_fd.get())) {
if (!LoopControl::EnableDirectIo(loop_fd.get())) {
return false;
}
return InstallZramDevice(device);
return InstallZramDevice(loop_device);
}
bool fs_mgr_swapon_all(const Fstab& fstab) {