Skip to content

Commit

Permalink
daos: enhance use of lookup hash
Browse files Browse the repository at this point in the history
lookup_insert_dir and associated functions have been
refactored and expanded.

*mfu_param_path.h*
- Added dfs_hash to mfu_file.
- Removed only_daos from mfu_file, since it is no longer needed

*Naming convention*
- Changed mfu_* to daos_* since they are only used by DAOS.
- Changed lookup_insert_dir to daos_lookup_hash.

*daos_lookup_hash and associated functions*
- Gets the hash from mfu_file instead of a global.
- Uses a pointer to the name instead of static allocation,
  which saves space.
- Updated error messages to use MFU_LOG instead of stderr directly.
- Added a _new and _delete function for the object handle struct.
- Properly deallocate and free each entry.

*daos_ IO functions*
With the excpetion of daos_opendir and daos_closedir,
all daos_ IO functions now use daos_hash_lookup to
get directory entries.

*mfu_util*
- Added daos_mount as a wrapper for dfs_mount.
- Added daos_umount as a wrapper for dfs_umount.
  This also destroys the hash.

*dcp.c*
Now uses the new daos_mount and daos_umount functions.

Signed-off-by: Dalton Bohning <daltonx.bohning@intel.com>
  • Loading branch information
Dalton Bohning authored and daltonbohning committed Sep 29, 2020
1 parent 66c5273 commit fb5b43c
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 145 deletions.
2 changes: 1 addition & 1 deletion src/common/mfu_flist_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3171,10 +3171,10 @@ mfu_file_t* mfu_file_new(void)
mfu_file_t* mfile = (mfu_file_t*) MFU_MALLOC(sizeof(mfu_file_t));
mfile->type = POSIX;
mfile->fd = -1;
mfile->only_daos = false;
#ifdef DAOS_SUPPORT
mfile->obj = NULL;
mfile->dfs = NULL;
mfile->dfs_hash = NULL;
#endif
return mfile;
}
Expand Down

0 comments on commit fb5b43c

Please sign in to comment.