Skip to content

Commit

Permalink
corrected formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
divineaugustine committed Mar 25, 2024
1 parent c79e986 commit ce77d89
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 165 deletions.
8 changes: 4 additions & 4 deletions libcomposefs/lcfs-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ struct lcfs_node_s {


// used for multi threaded digest calculation
bool delayedDigestCalculation;
bool delayedInline;
bool delayedPayload;
bool delayedResetDigest;
bool delayed_digest_calculation;
bool delayed_inline;
bool delayed_payload;
bool delayed_reset_digest;
};

struct lcfs_ctx_s {
Expand Down
48 changes: 26 additions & 22 deletions libcomposefs/lcfs-writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,16 +471,16 @@ struct lcfs_node_s *lcfs_node_new(void)
errno = ENOMEM;
return NULL;
}
memset( node, 0, sizeof(struct lcfs_node_s));

memset(node, 0, sizeof(struct lcfs_node_s));
node->payload = NULL;
node->content = NULL;
node->ref_count = 1;
node->inode.st_nlink = 1;
node->delayedDigestCalculation = false;
node->delayedInline = false;
node->delayedPayload = false;
node->delayedResetDigest = false;
node->delayed_digest_calculation = false;
node->delayed_inline = false;
node->delayed_payload = false;
node->delayed_reset_digest = false;
return node;
}

Expand Down Expand Up @@ -573,40 +573,40 @@ int lcfs_node_set_fsverity_from_fd(struct lcfs_node_s *node, int fd)

void lcfs_set_delayed_digest_calculation(struct lcfs_node_s *node)
{
node->delayedDigestCalculation = true;
node->delayed_digest_calculation = true;
}
void lcfs_set_delayed_payload(struct lcfs_node_s *node)
{
node->delayedPayload = true;
node->delayed_payload = true;
}
void lcfs_set_delayed_inline(struct lcfs_node_s *node)
{
node->delayedInline = true;
node->delayed_inline = true;
}

void lcfs_set_reset_digest(struct lcfs_node_s *node)
{
node->delayedResetDigest = true;
node->delayed_reset_digest = true;
}

bool lcfs_get_delayed_digest_calculation(struct lcfs_node_s *node)
{
return node->delayedDigestCalculation;
return node->delayed_digest_calculation;
}

bool lcfs_get_delayed_payload(struct lcfs_node_s *node)
{
return node->delayedPayload;
return node->delayed_payload;
}

bool lcfs_get_delayed_inline(struct lcfs_node_s *node)
{
return node->delayedInline;
return node->delayed_inline;
}

bool lcfs_get_reset_digest(struct lcfs_node_s *node)
{
return node->delayedResetDigest;
return node->delayed_reset_digest;
}

int lcfs_read_content(int fd, size_t size, uint8_t *buf)
Expand Down Expand Up @@ -697,13 +697,17 @@ struct lcfs_node_s *lcfs_load_node_from_file(int dirfd, const char *fname,

// For multi threaded digest calculation, first build the file sytem tree
// and later calculate the digest
if( ( buildflags & LCFS_BUILD_DELAYED_DIGEST) && (do_digest || do_inline)){
if (do_digest) lcfs_set_delayed_digest_calculation(ret);
if (do_digest && by_digest) lcfs_set_delayed_payload(ret);
if (do_inline) lcfs_set_delayed_inline(ret);
if (!compute_digest) lcfs_set_reset_digest(ret);
}
else if (do_digest || do_inline) {
if ((buildflags & LCFS_BUILD_DELAYED_DIGEST) &&
(do_digest || do_inline)) {
if (do_digest)
lcfs_set_delayed_digest_calculation(ret);
if (do_digest && by_digest)
lcfs_set_delayed_payload(ret);
if (do_inline)
lcfs_set_delayed_inline(ret);
if (!compute_digest)
lcfs_set_reset_digest(ret);
} else if (do_digest || do_inline) {
cleanup_fd int fd =
openat(dirfd, fname, O_RDONLY | O_CLOEXEC);
if (fd < 0)
Expand Down Expand Up @@ -1398,7 +1402,7 @@ struct lcfs_node_s *lcfs_build(int dirfd, const char *fname, int buildflags,

n = lcfs_load_node_from_file(dfd, de->d_name, buildflags);
if (n == NULL) {
errsv = errno;
errsv = errno;
failed_subpath = de->d_name;
goto fail;
}
Expand Down
Loading

0 comments on commit ce77d89

Please sign in to comment.