Skip to content

Commit

Permalink
[LibOS] chroot fs: Remove redundant arg in chroot_temp_open()
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com>
  • Loading branch information
Dmitrii Kuvaiskii authored and mkow committed Apr 12, 2024
1 parent fa241d4 commit 1d9d9b3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions libos/src/fs/chroot/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ static int chroot_lookup(struct libos_dentry* dent) {
}

/* Open a temporary read-only PAL handle for a file (used by `unlink` etc.) */
static int chroot_temp_open(struct libos_dentry* dent, mode_t type, PAL_HANDLE* out_palhdl) {
static int chroot_temp_open(struct libos_dentry* dent, PAL_HANDLE* out_palhdl) {
char* uri;
int ret = chroot_dentry_uri(dent, type, &uri);
int ret = chroot_dentry_uri(dent, dent->inode->type, &uri);
if (ret < 0)
return ret;

Expand Down Expand Up @@ -348,7 +348,8 @@ int chroot_readdir(struct libos_dentry* dent, readdir_callback_t callback, void*
char* buf = NULL;
size_t buf_size = READDIR_BUF_SIZE;

ret = chroot_temp_open(dent, S_IFDIR, &palhdl);
assert(dent->inode->type == S_IFDIR);
ret = chroot_temp_open(dent, &palhdl);
if (ret < 0)
return ret;

Expand Down Expand Up @@ -409,7 +410,7 @@ int chroot_unlink(struct libos_dentry* dent) {
int ret;

PAL_HANDLE palhdl;
ret = chroot_temp_open(dent, dent->inode->type, &palhdl);
ret = chroot_temp_open(dent, &palhdl);
if (ret < 0)
return ret;

Expand All @@ -433,7 +434,7 @@ static int chroot_rename(struct libos_dentry* old, struct libos_dentry* new) {
goto out;

PAL_HANDLE palhdl;
ret = chroot_temp_open(old, old->inode->type, &palhdl);
ret = chroot_temp_open(old, &palhdl);
if (ret < 0)
goto out;

Expand All @@ -457,7 +458,7 @@ static int chroot_chmod(struct libos_dentry* dent, mode_t perm) {
int ret;

PAL_HANDLE palhdl;
ret = chroot_temp_open(dent, dent->inode->type, &palhdl);
ret = chroot_temp_open(dent, &palhdl);
if (ret < 0)
return ret;

Expand Down

0 comments on commit 1d9d9b3

Please sign in to comment.