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

Commit ca245d32 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8909196 from 6e48a1e5 to tm-qpr1-release

Change-Id: I75048cca993434e08832e99d25d0d7dd93444898
parents 861873b9 6e48a1e5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -70,6 +70,9 @@ enum storage_cmd {
 * @STORAGE_ERR_TRANSACT        returned by various operations to indicate that current transaction
 *                              is in error state. Such state could be only cleared by sending
 *                              STORAGE_END_TRANSACTION message.
 * @STORAGE_ERR_SYNC_FAILURE    indicates that the current operation failed to sync
 *                              to disk. Only returned if STORAGE_MSG_FLAG_PRE_COMMIT or
 *                              STORAGE_MSG_FLAG_POST_COMMIT was set for the request.
 */
enum storage_err {
	STORAGE_NO_ERROR          = 0,
@@ -80,6 +83,7 @@ enum storage_err {
	STORAGE_ERR_NOT_FOUND     = 5,
	STORAGE_ERR_EXIST         = 6,
	STORAGE_ERR_TRANSACT      = 7,
	STORAGE_ERR_SYNC_FAILURE  = 8,
};

/**
+5 −4
Original line number Diff line number Diff line
@@ -116,10 +116,11 @@ static int drop_privs(void) {
static int handle_req(struct storage_msg* msg, const void* req, size_t req_len) {
    int rc;

    if ((msg->flags & STORAGE_MSG_FLAG_POST_COMMIT) && (msg->cmd != STORAGE_RPMB_SEND)) {
    if ((msg->flags & STORAGE_MSG_FLAG_POST_COMMIT) && msg->cmd != STORAGE_RPMB_SEND &&
        msg->cmd != STORAGE_FILE_WRITE) {
        /*
         * handling post commit messages on non rpmb commands are not
         * implemented as there is no use case for this yet.
         * handling post commit messages on commands other than rpmb and write
         * operations are not implemented as there is no use case for this yet.
         */
        ALOGE("cmd 0x%x: post commit option is not implemented\n", msg->cmd);
        msg->result = STORAGE_ERR_UNIMPLEMENTED;
@@ -129,7 +130,7 @@ static int handle_req(struct storage_msg* msg, const void* req, size_t req_len)
    if (msg->flags & STORAGE_MSG_FLAG_PRE_COMMIT) {
        rc = storage_sync_checkpoint();
        if (rc < 0) {
            msg->result = STORAGE_ERR_GENERIC;
            msg->result = STORAGE_ERR_SYNC_FAILURE;
            return ipc_respond(msg, NULL, 0);
        }
    }
+8 −0
Original line number Diff line number Diff line
@@ -407,6 +407,14 @@ int storage_file_write(struct storage_msg *msg,
        goto err_response;
    }

    if (msg->flags & STORAGE_MSG_FLAG_POST_COMMIT) {
        rc = storage_sync_checkpoint();
        if (rc < 0) {
            msg->result = STORAGE_ERR_SYNC_FAILURE;
            goto err_response;
        }
    }

    msg->result = STORAGE_NO_ERROR;

err_response: