Skip to content

Commit aabfeda

Browse files
committed
Fix indentation and variable names
1 parent f4eed48 commit aabfeda

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

splitfs/fileops_hub.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ RETT_OPENAT _hub_OPENAT(INTF_OPENAT)
813813

814814
RETT_EXECVE _hub_EXECVE(INTF_EXECVE) {
815815
int pid = getpid();
816-
char buf[BUF_SIZE];
816+
char exec_hub_filename[BUF_SIZE];
817817

818818
HUB_CHECK_RESOLVE_FILEOPS(_hub_, EXECVE);
819819

@@ -831,8 +831,8 @@ RETT_EXECVE _hub_EXECVE(INTF_EXECVE) {
831831
hub_ops[i] = 2;
832832
}
833833

834-
sprintf(buf, "exec-hub-%d", pid);
835-
exec_hub_fd = shm_open(buf, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
834+
sprintf(exec_hub_filename, "exec-hub-%d", pid);
835+
exec_hub_fd = shm_open(exec_hub_filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
836836
if (exec_hub_fd == -1) {
837837
printf("%s: %s\n", __func__, strerror(errno));
838838
assert(0);
@@ -865,7 +865,7 @@ RETT_EXECVE _hub_EXECVE(INTF_EXECVE) {
865865

866866
RETT_EXECVP _hub_EXECVP(INTF_EXECVP) {
867867
int pid = getpid();
868-
char buf[BUF_SIZE];
868+
char exec_hub_filename[BUF_SIZE];
869869

870870
HUB_CHECK_RESOLVE_FILEOPS(_hub_, EXECVP);
871871

@@ -883,8 +883,8 @@ RETT_EXECVP _hub_EXECVP(INTF_EXECVP) {
883883
hub_ops[i] = 2;
884884
}
885885

886-
sprintf(buf, "exec-hub-%d", pid);
887-
exec_hub_fd = shm_open(buf, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
886+
sprintf(exec_hub_filename, "exec-hub-%d", pid);
887+
exec_hub_fd = shm_open(exec_hub_filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
888888
if (exec_hub_fd == -1) {
889889
printf("%s: %s\n", __func__, strerror(errno));
890890
assert(0);
@@ -922,10 +922,10 @@ RETT_SHM_COPY _hub_SHM_COPY() {
922922
int hub_ops[1024];
923923
unsigned long offset_in_map = 0;
924924
int pid = getpid();
925-
char buf[BUF_SIZE];
925+
char exec_hub_filename[BUF_SIZE];
926926

927-
sprintf(buf, "exec-hub-%d", pid);
928-
exec_hub_fd = shm_open(buf, O_RDONLY, 0666);
927+
sprintf(exec_hub_filename, "exec-hub-%d", pid);
928+
exec_hub_fd = shm_open(exec_hub_filename, O_RDONLY, 0666);
929929
if (exec_hub_fd == -1) {
930930
MSG("%s: %s\n", __func__, strerror(errno));
931931
assert(0);
@@ -952,7 +952,7 @@ RETT_SHM_COPY _hub_SHM_COPY() {
952952
}
953953

954954
munmap(shm_area, 1024*1024);
955-
shm_unlink(buf);
955+
shm_unlink(exec_hub_filename);
956956

957957
return _hub_managed_fileops->SHM_COPY();
958958
}
@@ -1108,8 +1108,8 @@ RETT_CLOSE _hub_CLOSE(INTF_CLOSE)
11081108

11091109
struct Fileops_p* temp = _hub_fd_lookup[file];
11101110

1111-
// Restore it to the state similar to the initialised state.
1112-
_hub_fd_lookup[file] = _hub_fileops;
1111+
// Restore it to the state similar to the initialised state.
1112+
_hub_fd_lookup[file] = _hub_fileops;
11131113
int result = temp->CLOSE(CALL_CLOSE);
11141114

11151115
if(result) {

splitfs/fileops_nvp.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,10 +1022,10 @@ void _nvp_SHM_COPY() {
10221022
int i,j;
10231023
unsigned long offset_in_map = 0;
10241024
int pid = getpid();
1025-
char buf[BUF_SIZE];
1025+
char exec_nvp_filename[BUF_SIZE];
10261026

1027-
sprintf(buf, "exec-ledger-%d", pid);
1028-
exec_ledger_fd = shm_open(buf, O_RDONLY, 0666);
1027+
sprintf(exec_nvp_filename, "exec-ledger-%d", pid);
1028+
exec_ledger_fd = shm_open(exec_nvp_filename, O_RDONLY, 0666);
10291029

10301030
if (exec_ledger_fd == -1) {
10311031
printf("%s: shm_open failed. Err = %s\n", __func__, strerror(errno));
@@ -1099,7 +1099,7 @@ void _nvp_SHM_COPY() {
10991099
}
11001100

11011101
munmap(shm_area, 10*1024*1024);
1102-
shm_unlink(buf);
1102+
shm_unlink(exec_nvp_filename);
11031103
}
11041104

11051105
void _mm_cache_flush(void const* p) {
@@ -1555,10 +1555,10 @@ void _nvp_init2(void)
15551555
atexit(nvp_exit_handler);
15561556

15571557
int pid = getpid();
1558-
char buf[BUF_SIZE];
1558+
char exec_nvp_filename[BUF_SIZE];
15591559

1560-
sprintf(buf, "/dev/shm/exec-ledger-%d", pid);
1561-
if (access(buf, F_OK ) != -1)
1560+
sprintf(exec_nvp_filename, "/dev/shm/exec-ledger-%d", pid);
1561+
if (access(exec_nvp_filename, F_OK ) != -1)
15621562
execv_done = 1;
15631563
else
15641564
execv_done = 0;
@@ -4744,7 +4744,7 @@ RETT_EXECVE _nvp_EXECVE(INTF_EXECVE) {
47444744
int exec_ledger_fd = -1, i = 0;
47454745
unsigned long offset_in_map = 0;
47464746
int pid = getpid();
4747-
char buf[BUF_SIZE];
4747+
char exec_nvp_filename[BUF_SIZE];
47484748

47494749
for (i = 0; i < 1024; i++) {
47504750
if (_nvp_fd_lookup[i].offset != NULL)
@@ -4753,8 +4753,8 @@ RETT_EXECVE _nvp_EXECVE(INTF_EXECVE) {
47534753
execve_fd_passing[i] = 0;
47544754
}
47554755

4756-
sprintf(buf, "exec-ledger-%d", pid);
4757-
exec_ledger_fd = shm_open(buf, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
4756+
sprintf(exec_nvp_filename, "exec-ledger-%d", pid);
4757+
exec_ledger_fd = shm_open(exec_nvp_filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
47584758
if (exec_ledger_fd == -1) {
47594759
printf("%s: %s\n", __func__, strerror(errno));
47604760
assert(0);
@@ -4816,7 +4816,7 @@ RETT_EXECVP _nvp_EXECVP(INTF_EXECVP) {
48164816
int exec_ledger_fd = -1, i = 0;
48174817
unsigned long offset_in_map = 0;
48184818
int pid = getpid();
4819-
char buf[BUF_SIZE];
4819+
char exec_nvp_filename[BUF_SIZE];
48204820

48214821
for (i = 0; i < 1024; i++) {
48224822
if (_nvp_fd_lookup[i].offset != NULL)
@@ -4830,8 +4830,8 @@ RETT_EXECVP _nvp_EXECVP(INTF_EXECVP) {
48304830
_nvp_FSYNC(_nvp_fd_lookup[i].fd);
48314831
}
48324832

4833-
sprintf(buf, "exec-ledger-%d", pid);
4834-
exec_ledger_fd = shm_open(buf, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
4833+
sprintf(exec_nvp_filename, "exec-ledger-%d", pid);
4834+
exec_ledger_fd = shm_open(exec_nvp_filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
48354835
if (exec_ledger_fd == -1) {
48364836
printf("%s: %s\n", __func__, strerror(errno));
48374837
assert(0);
@@ -5916,9 +5916,9 @@ RETT_DUP2 _nvp_DUP2(INTF_DUP2)
59165916
nvf2->node = nvf->node;
59175917
nvf2->valid = nvf->valid;
59185918
nvf2->posix = nvf->posix;
5919-
// Increment the refernce count as this file
5920-
// descriptor is pointing to the same NVFNode
5921-
nvf2->node->reference++;
5919+
// Increment the refernce count as this file
5920+
// descriptor is pointing to the same NVFNode
5921+
nvf2->node->reference++;
59225922

59235923
SANITYCHECK(nvf2->node != NULL);
59245924
SANITYCHECK(nvf2->valid);

0 commit comments

Comments
 (0)