diff options
author | Jin Qian <jinqian@google.com> | 2017-12-12 18:38:25 -0800 |
---|---|---|
committer | Jin Qian <jinqian@google.com> | 2017-12-13 15:54:55 -0800 |
commit | 4c23c4576b809757ef1c48f59032a4aada276602 (patch) | |
tree | 6a36e0f5ea049c3412df65f80ce3662ffd85ffbc /storaged/include | |
parent | 9c6587ad1fde2f0b820634b5af5007897ef328c0 (diff) | |
download | system_core-4c23c4576b809757ef1c48f59032a4aada276602.tar.gz system_core-4c23c4576b809757ef1c48f59032a4aada276602.tar.bz2 system_core-4c23c4576b809757ef1c48f59032a4aada276602.zip |
storaged: align buffer address and size for direct_io
O_DIRECT requires buffer address and size to be aligned
Bug: 63629306
Change-Id: I268abb1c0ba32af4fd2e92210192c47a1f173238
Diffstat (limited to 'storaged/include')
-rw-r--r-- | storaged/include/storaged.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/storaged/include/storaged.h b/storaged/include/storaged.h index e5dd70d2c..6bf6c9c1a 100644 --- a/storaged/include/storaged.h +++ b/storaged/include/storaged.h @@ -36,6 +36,9 @@ friend class test_case_name##_##test_name##_Test #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#define IS_ALIGNED(x, align) (!((x) & ((align) - 1))) +#define ROUND_UP(x, align) (((x) + ((align) - 1)) & ~((align) - 1)) + #define SECTOR_SIZE ( 512 ) #define SEC_TO_MSEC ( 1000 ) #define MSEC_TO_USEC ( 1000 ) @@ -83,12 +86,12 @@ class storaged_t : public android::hardware::health::V2_0::IHealthInfoCallback, time_t mStarttime; sp<android::hardware::health::V2_0::IHealth> health; unique_ptr<storage_info_t> storage_info; - static const uint32_t crc_init; + static const uint32_t current_version; unordered_map<userid_t, bool> proto_loaded; void load_proto(userid_t user_id); - void prepare_proto(userid_t user_id, StoragedProto* proto); + char* prepare_proto(userid_t user_id, StoragedProto* proto); void flush_proto(userid_t user_id, StoragedProto* proto); - void flush_proto_user_system(StoragedProto* proto); + void flush_proto_data(userid_t user_id, const char* data, ssize_t size); string proto_path(userid_t user_id) { return string("/data/misc_ce/") + to_string(user_id) + "/storaged/storaged.proto"; |