Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd22e8c2 authored by Akilesh Kailash's avatar Akilesh Kailash Committed by Automerger Merge Worker
Browse files

Merge "snapuserd: pass arguments by reference" am: b5043697 am: 3e69e171...

Merge "snapuserd: pass arguments by reference" am: b5043697 am: 3e69e171 am: b3e7c0e3 am: 03ee001e am: 0b4e7b1b

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1801248

Change-Id: I18b9598106d4000fde4bcf0c968a0b35e155e669
parents 80ebb34f 0b4e7b1b
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -691,7 +691,7 @@ bool Snapuserd::InitCowDevice() {
}
}


void Snapuserd::ReadBlocksToCache(const std::string& dm_block_device,
void Snapuserd::ReadBlocksToCache(const std::string& dm_block_device,
                                  const std::string partition_name, off_t offset, size_t size) {
                                  const std::string& partition_name, off_t offset, size_t size) {
    android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(dm_block_device.c_str(), O_RDONLY)));
    android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(dm_block_device.c_str(), O_RDONLY)));
    if (fd.get() == -1) {
    if (fd.get() == -1) {
        SNAP_PLOG(ERROR) << "Error reading " << dm_block_device
        SNAP_PLOG(ERROR) << "Error reading " << dm_block_device
@@ -726,7 +726,7 @@ void Snapuserd::ReadBlocksToCache(const std::string& dm_block_device,
                   << " offset: " << offset;
                   << " offset: " << offset;
}
}


void Snapuserd::ReadBlocks(const std::string partition_name, const std::string& dm_block_device) {
void Snapuserd::ReadBlocks(const std::string& partition_name, const std::string& dm_block_device) {
    SNAP_LOG(DEBUG) << "Reading partition: " << partition_name
    SNAP_LOG(DEBUG) << "Reading partition: " << partition_name
                    << " Block-Device: " << dm_block_device;
                    << " Block-Device: " << dm_block_device;


+2 −2
Original line number Original line Diff line number Diff line
@@ -316,8 +316,8 @@ class Snapuserd : public std::enable_shared_from_this<Snapuserd> {
    bool IsBlockAligned(int read_size) { return ((read_size & (BLOCK_SZ - 1)) == 0); }
    bool IsBlockAligned(int read_size) { return ((read_size & (BLOCK_SZ - 1)) == 0); }
    struct BufferState* GetBufferState();
    struct BufferState* GetBufferState();


    void ReadBlocks(const std::string partition_name, const std::string& dm_block_device);
    void ReadBlocks(const std::string& partition_name, const std::string& dm_block_device);
    void ReadBlocksToCache(const std::string& dm_block_device, const std::string partition_name,
    void ReadBlocksToCache(const std::string& dm_block_device, const std::string& partition_name,
                           off_t offset, size_t size);
                           off_t offset, size_t size);


    std::string cow_device_;
    std::string cow_device_;