Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
dthain committed Sep 30, 2024
1 parent 7262aa8 commit 1f2999c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion taskvine/src/manager/vine_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ struct vine_file *vine_file_local(const char *source, vine_cache_level_t cache,
return vine_file_create(source, 0, 0, 0, VINE_FILE, 0, cache, flags);
}

struct vine_file *vine_file_sharedfs(const char *source, vine_file_flags_t flags )
struct vine_file *vine_file_sharedfs(const char *source, vine_file_flags_t flags)
{
return vine_file_create(source, 0, 0, 0, VINE_SHAREDFS, 0, VINE_CACHE_LEVEL_TASK, flags);
}
Expand Down
4 changes: 2 additions & 2 deletions taskvine/src/manager/vine_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -6119,9 +6119,9 @@ struct vine_file *vine_declare_file(struct vine_manager *m, const char *source,
{
struct vine_file *f;

if(m->shared_filesystem_link_mode) {
if (m->shared_filesystem_link_mode) {
/* XXX need to get absolute path here. */
f = vine_file_sharedfs(source,flags);
f = vine_file_sharedfs(source, flags);
} else if (m->shared_filesystem_cache_mode) {
char *file_url = vine_file_make_file_url(source);
f = vine_file_url(file_url, cache, flags);
Expand Down
17 changes: 10 additions & 7 deletions taskvine/src/worker/vine_sandbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ vine_cache_status_t vine_sandbox_ensure(struct vine_process *p, struct vine_cach
LIST_ITERATE(p->task->input_mounts, m)
{
// no need to check files stored in the shared filesystem
if(m->file->type==VINE_SHAREDFS) continue;

if (m->file->type == VINE_SHAREDFS)
continue;

vine_cache_status_t cache_status = vine_cache_ensure(cache, m->file->cached_name);

switch (cache_status) {
Expand Down Expand Up @@ -133,7 +134,7 @@ static int vine_sandbox_symlink_to_sharedfs(struct vine_process *p, struct vine_
{
char *sandbox_path = vine_sandbox_full_path(p, m->remote_name);

int result = symlink(m->file->source,sandbox_path);
int result = symlink(m->file->source, sandbox_path);
if (result != 0) {
debug(D_VINE, "sandbox: couldn't symlink %s -> %s : %s", sandbox_path, m->file->source, strerror(errno));
}
Expand All @@ -158,26 +159,28 @@ int vine_sandbox_stagein(struct vine_process *p, struct vine_cache *cache)

LIST_ITERATE(t->input_mounts, m)
{
if(m->file->type==VINE_SHAREDFS) {
if (m->file->type == VINE_SHAREDFS) {
result = vine_sandbox_symlink_to_sharedfs(p, m);
} else {
result = stage_input_file(p, m, m->file, cache);
}
if (!result) break;
if (!result)
break;
}

/* Certain output file types must also be created in the sandbox */

LIST_ITERATE(t->output_mounts, m)
{
if(m->file->type==VINE_SHAREDFS) {
if (m->file->type == VINE_SHAREDFS) {
result = vine_sandbox_symlink_to_sharedfs(p, m);
} else if (m->flags & VINE_MOUNT_MKDIR) {
result = vine_sandbox_create_empty_output_dir(p, m);
} else {
result = 1;
}
if (!result) break;
if (!result)
break;
}

return result;
Expand Down

0 comments on commit 1f2999c

Please sign in to comment.