snapuserd: Refactor code to a seperate directory
Move all the code relevant to snapuserd to a seperate directory. Add OWNERS file. No other code changes apart from moving files around and fixing couple location of header paths at few places. Bug: 194642092 Test: Compile, Full OTA Signed-off-by: Akilesh Kailash <akailash@google.com> Change-Id: Ib1d852bfeda4eca5c996d6cd7b057f141cb5ddad
This commit is contained in:
parent
7d11ce854c
commit
36aeeb3f56
18 changed files with 143 additions and 122 deletions
|
|
@ -182,38 +182,6 @@ cc_library_static {
|
|||
vendor_ramdisk_available: true,
|
||||
}
|
||||
|
||||
cc_defaults {
|
||||
name: "libsnapshot_snapuserd_defaults",
|
||||
defaults: [
|
||||
"fs_mgr_defaults",
|
||||
],
|
||||
cflags: [
|
||||
"-D_FILE_OFFSET_BITS=64",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
export_include_dirs: ["include"],
|
||||
srcs: [
|
||||
"snapuserd_client.cpp",
|
||||
],
|
||||
}
|
||||
|
||||
cc_library_static {
|
||||
name: "libsnapshot_snapuserd",
|
||||
defaults: [
|
||||
"libsnapshot_snapuserd_defaults",
|
||||
],
|
||||
recovery_available: true,
|
||||
static_libs: [
|
||||
"libcutils_sockets",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"liblog",
|
||||
],
|
||||
ramdisk_available: true,
|
||||
}
|
||||
|
||||
cc_library_static {
|
||||
name: "libsnapshot_test_helpers",
|
||||
defaults: ["libsnapshot_defaults"],
|
||||
|
|
@ -412,49 +380,6 @@ cc_test {
|
|||
require_root: true,
|
||||
}
|
||||
|
||||
cc_defaults {
|
||||
name: "snapuserd_defaults",
|
||||
defaults: [
|
||||
"fs_mgr_defaults",
|
||||
],
|
||||
srcs: [
|
||||
"snapuserd_server.cpp",
|
||||
"snapuserd.cpp",
|
||||
"snapuserd_daemon.cpp",
|
||||
"snapuserd_worker.cpp",
|
||||
"snapuserd_readahead.cpp",
|
||||
],
|
||||
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror"
|
||||
],
|
||||
|
||||
static_libs: [
|
||||
"libbase",
|
||||
"libbrotli",
|
||||
"libcutils_sockets",
|
||||
"libdm",
|
||||
"libgflags",
|
||||
"liblog",
|
||||
"libsnapshot_cow",
|
||||
"libz",
|
||||
],
|
||||
}
|
||||
|
||||
cc_binary {
|
||||
name: "snapuserd",
|
||||
defaults: ["snapuserd_defaults"],
|
||||
init_rc: [
|
||||
"snapuserd.rc",
|
||||
],
|
||||
static_executable: true,
|
||||
system_shared_libs: [],
|
||||
ramdisk_available: true,
|
||||
vendor_ramdisk_available: true,
|
||||
recovery_available: true,
|
||||
}
|
||||
|
||||
cc_test {
|
||||
name: "cow_api_test",
|
||||
defaults: [
|
||||
|
|
@ -556,43 +481,6 @@ cc_binary {
|
|||
},
|
||||
}
|
||||
|
||||
cc_test {
|
||||
name: "cow_snapuserd_test",
|
||||
defaults: [
|
||||
"fs_mgr_defaults",
|
||||
],
|
||||
srcs: [
|
||||
"cow_snapuserd_test.cpp",
|
||||
"snapuserd.cpp",
|
||||
"snapuserd_worker.cpp",
|
||||
],
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"liblog",
|
||||
],
|
||||
static_libs: [
|
||||
"libbrotli",
|
||||
"libgtest",
|
||||
"libsnapshot_cow",
|
||||
"libsnapshot_snapuserd",
|
||||
"libcutils_sockets",
|
||||
"libz",
|
||||
"libfs_mgr",
|
||||
"libdm",
|
||||
],
|
||||
header_libs: [
|
||||
"libstorage_literals_headers",
|
||||
"libfiemap_headers",
|
||||
],
|
||||
test_min_api_level: 30,
|
||||
auto_gen_config: true,
|
||||
require_root: false,
|
||||
}
|
||||
|
||||
cc_binary {
|
||||
name: "inspect_cow",
|
||||
host_supported: true,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
#include <libsnapshot/auto_device.h>
|
||||
#include <libsnapshot/return.h>
|
||||
#include <libsnapshot/snapshot_writer.h>
|
||||
#include <libsnapshot/snapuserd_client.h>
|
||||
#include <snapuserd/snapuserd_client.h>
|
||||
|
||||
#ifndef FRIEND_TEST
|
||||
#define FRIEND_TEST(test_set_name, individual_test) \
|
||||
|
|
|
|||
131
fs_mgr/libsnapshot/snapuserd/Android.bp
Normal file
131
fs_mgr/libsnapshot/snapuserd/Android.bp
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
//
|
||||
// Copyright (C) 2018 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
cc_defaults {
|
||||
name: "libsnapshot_snapuserd_defaults",
|
||||
defaults: [
|
||||
"fs_mgr_defaults",
|
||||
],
|
||||
cflags: [
|
||||
"-D_FILE_OFFSET_BITS=64",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
export_include_dirs: ["include"],
|
||||
srcs: [
|
||||
"snapuserd_client.cpp",
|
||||
],
|
||||
}
|
||||
|
||||
cc_library_static {
|
||||
name: "libsnapshot_snapuserd",
|
||||
defaults: [
|
||||
"libsnapshot_snapuserd_defaults",
|
||||
],
|
||||
recovery_available: true,
|
||||
static_libs: [
|
||||
"libcutils_sockets",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"liblog",
|
||||
],
|
||||
ramdisk_available: true,
|
||||
}
|
||||
|
||||
cc_defaults {
|
||||
name: "snapuserd_defaults",
|
||||
defaults: [
|
||||
"fs_mgr_defaults",
|
||||
],
|
||||
srcs: [
|
||||
"snapuserd_server.cpp",
|
||||
"snapuserd.cpp",
|
||||
"snapuserd_daemon.cpp",
|
||||
"snapuserd_worker.cpp",
|
||||
"snapuserd_readahead.cpp",
|
||||
],
|
||||
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror"
|
||||
],
|
||||
|
||||
static_libs: [
|
||||
"libbase",
|
||||
"libbrotli",
|
||||
"libcutils_sockets",
|
||||
"libdm",
|
||||
"libgflags",
|
||||
"liblog",
|
||||
"libsnapshot_cow",
|
||||
"libz",
|
||||
],
|
||||
}
|
||||
|
||||
cc_binary {
|
||||
name: "snapuserd",
|
||||
defaults: ["snapuserd_defaults"],
|
||||
init_rc: [
|
||||
"snapuserd.rc",
|
||||
],
|
||||
static_executable: true,
|
||||
system_shared_libs: [],
|
||||
ramdisk_available: true,
|
||||
vendor_ramdisk_available: true,
|
||||
recovery_available: true,
|
||||
}
|
||||
|
||||
cc_test {
|
||||
name: "cow_snapuserd_test",
|
||||
defaults: [
|
||||
"fs_mgr_defaults",
|
||||
],
|
||||
srcs: [
|
||||
"cow_snapuserd_test.cpp",
|
||||
"snapuserd.cpp",
|
||||
"snapuserd_worker.cpp",
|
||||
],
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"liblog",
|
||||
],
|
||||
static_libs: [
|
||||
"libbrotli",
|
||||
"libgtest",
|
||||
"libsnapshot_cow",
|
||||
"libsnapshot_snapuserd",
|
||||
"libcutils_sockets",
|
||||
"libz",
|
||||
"libfs_mgr",
|
||||
"libdm",
|
||||
],
|
||||
header_libs: [
|
||||
"libstorage_literals_headers",
|
||||
"libfiemap_headers",
|
||||
],
|
||||
test_min_api_level: 30,
|
||||
auto_gen_config: true,
|
||||
require_root: false,
|
||||
}
|
||||
3
fs_mgr/libsnapshot/snapuserd/OWNERS
Normal file
3
fs_mgr/libsnapshot/snapuserd/OWNERS
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
akailash@google.com
|
||||
dvander@google.com
|
||||
drosen@google.com
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
#include <libdm/dm.h>
|
||||
#include <libdm/loop_control.h>
|
||||
#include <libsnapshot/cow_writer.h>
|
||||
#include <libsnapshot/snapuserd_client.h>
|
||||
#include <snapuserd/snapuserd_client.h>
|
||||
#include <storage_literals/storage_literals.h>
|
||||
|
||||
#include "snapuserd.h"
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
#include <optional>
|
||||
#include <set>
|
||||
|
||||
#include <libsnapshot/snapuserd_client.h>
|
||||
#include <snapuserd/snapuserd_client.h>
|
||||
|
||||
namespace android {
|
||||
namespace snapshot {
|
||||
|
|
@ -405,7 +405,6 @@ bool Snapuserd::ReadMetadata() {
|
|||
de->old_chunk = cow_op->new_block;
|
||||
de->new_chunk = data_chunk_id;
|
||||
|
||||
|
||||
// Store operation pointer.
|
||||
chunk_vec_.push_back(std::make_pair(ChunkToSector(data_chunk_id), cow_op));
|
||||
num_ops += 1;
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
#include <libdm/dm.h>
|
||||
#include <libsnapshot/cow_reader.h>
|
||||
#include <libsnapshot/cow_writer.h>
|
||||
#include <libsnapshot/snapuserd_kernel.h>
|
||||
#include <snapuserd/snapuserd_kernel.h>
|
||||
|
||||
namespace android {
|
||||
namespace snapshot {
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
#include <android-base/parseint.h>
|
||||
#include <android-base/properties.h>
|
||||
#include <android-base/strings.h>
|
||||
#include <libsnapshot/snapuserd_client.h>
|
||||
#include <snapuserd/snapuserd_client.h>
|
||||
|
||||
namespace android {
|
||||
namespace snapshot {
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
#include <android-base/logging.h>
|
||||
#include <android-base/strings.h>
|
||||
#include <gflags/gflags.h>
|
||||
#include <libsnapshot/snapuserd_client.h>
|
||||
#include <snapuserd/snapuserd_client.h>
|
||||
|
||||
#include "snapuserd_server.h"
|
||||
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
#include <optional>
|
||||
#include <set>
|
||||
|
||||
#include <libsnapshot/snapuserd_client.h>
|
||||
#include <snapuserd/snapuserd_client.h>
|
||||
|
||||
namespace android {
|
||||
namespace snapshot {
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
#include <optional>
|
||||
#include <set>
|
||||
|
||||
#include <libsnapshot/snapuserd_client.h>
|
||||
#include <snapuserd/snapuserd_client.h>
|
||||
|
||||
namespace android {
|
||||
namespace snapshot {
|
||||
|
|
@ -33,10 +33,10 @@
|
|||
#include <android-base/unique_fd.h>
|
||||
#include <cutils/sockets.h>
|
||||
#include <libsnapshot/snapshot.h>
|
||||
#include <libsnapshot/snapuserd_client.h>
|
||||
#include <private/android_filesystem_config.h>
|
||||
#include <procinfo/process_map.h>
|
||||
#include <selinux/android.h>
|
||||
#include <snapuserd/snapuserd_client.h>
|
||||
|
||||
#include "block_dev_initializer.h"
|
||||
#include "service_utils.h"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue