Skip to content

Commit

Permalink
Removing all dependant code based on XFS check (#10)
Browse files Browse the repository at this point in the history
Commit bc6d8e2 removed the check for XFS as well came to a consensus it
could  be removed during migrating to CMake for the build system. With
the check no longer there, there is no reason to keep around dead code
related to XFS anymore.

This removes all code that would have been enabled through the XFS
check. The main thing it did was allow for the -preallocate flag to be
used. However, this was never used for anything other than XFS. If we
decide to revisit this for thing it is work adding back we can update
the build system again to check and add it back in. For now though, it
is just dead code.

Signed-off-by: Brian Atkinson <batkinson@lanl.gov>
  • Loading branch information
bwatkinson authored Jun 26, 2023
1 parent d01cf76 commit b8e01f0
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 358 deletions.
3 changes: 0 additions & 3 deletions src/base/target_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ xint_target_init(target_data_t *tdp) {
if (status)
return(-1);

/* Perform preallocation if needed */
xint_target_preallocate(tdp);

/* Perform pretruncation if needed */
xint_target_pretruncate(tdp);

Expand Down
2 changes: 0 additions & 2 deletions src/client/info_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,6 @@ xdd_target_info(FILE *out, target_data_t *tdp) {
fprintf(out," enabled for %s verification.\n", (tdp->td_target_options & TO_VERIFY_LOCATION)?"Location":"Content");
else fprintf(out," disabled.\n");
fprintf(out,"\t\tDirect I/O, %s", (tdp->td_target_options & TO_DIO)?"enabled\n":"disabled\n");
fprintf(out, "\t\tPreallocation, %lld, %d-byte blocks, %lld, bytes\n", (long long int)tdp->td_preallocate, tdp->td_block_size,
(long long int)(tdp->td_preallocate * tdp->td_block_size));
fprintf(out, "\t\tPretruncation, %lld, %d-byte blocks, %lld bytes\n", (long long int)tdp->td_pretruncate, tdp->td_block_size,
(long long int)(tdp->td_pretruncate * tdp->td_block_size));
fprintf(out, "\t\tQueue Depth, %d\n",tdp->td_queue_depth);
Expand Down
43 changes: 0 additions & 43 deletions src/client/parse_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -2808,49 +2808,6 @@ xddfunc_percentcpu(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags
}
}
/*----------------------------------------------------------------------------*/
// Specify the number of bytes to preallocate for a target file that is
// being created. This option is only valid when used on operating systems
// and file systems that support the Reserve Space file operation.
int
xddfunc_preallocate(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags)
{
int args, i;
int target_number;
target_data_t *tdp;
int64_t preallocate;

args = xdd_parse_target_number(planp, argc, &argv[0], flags, &target_number);
if (args < 0) return(-1);

if (xdd_parse_arg_count_check(args,argc, argv[0]) == 0)
return(0);

preallocate = (int64_t)atoll(argv[args+1]);
if (preallocate <= 0) {
fprintf(stderr,"%s: Error: Preallocate value of '%lld' is not valid - it must be greater than or equal to zero\n", xgp->progname, (long long int)preallocate);
return(-1);
}

if (target_number >= 0) { /* Set this option value for a specific target */
tdp = xdd_get_target_datap(planp, target_number, argv[0]);
if (tdp == NULL) return(-1);

tdp->td_preallocate = preallocate;
return(args+2);
} else { // Put this option into all Targets
if (flags & XDD_PARSE_PHASE2) {
tdp = planp->target_datap[0];
i = 0;
while (tdp) {
tdp->td_preallocate = preallocate;
i++;
tdp = planp->target_datap[i];
}
}
return(2);
}
}
/*----------------------------------------------------------------------------*/
// Specify the number of bytes to truncate the file size to target file that is
// being created. This option may zero-fill for some file systems.
int
Expand Down
7 changes: 0 additions & 7 deletions src/client/parse_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,6 @@ xdd_func_t xdd_func[] = {
" Default is 'abosolute'\n",
0},
XDD_FUNC_INVISIBLE},
{"preallocate", "pa",
xddfunc_preallocate,
1,
" -preallocate [target <target#>] <#blocks>\n",
{" Will preallocate # blocksized-blocks before writing a file.\n",
0,0,0,0},
0},
{"pretruncate", "pt",
xddfunc_pretruncate,
1,
Expand Down
1 change: 0 additions & 1 deletion src/common/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ xdd_show_target_data(target_data_t *tdp) {
fprintf(stderr,"xdd_show_target_data: char td_random_init_state[256]\n"); // Random number generator state initalizer array
fprintf(stderr,"xdd_show_target_data: int32_t td_block_size=%d\n",tdp->td_block_size); // Size of a block in bytes for this target
fprintf(stderr,"xdd_show_target_data: int32_t td_queue_depth=%d\n",tdp->td_queue_depth); // Command queue depth for each target
fprintf(stderr,"xdd_show_target_data: int64_t td_preallocate=%lld\n",(long long int)tdp->td_preallocate); // File preallocation value
fprintf(stderr,"xdd_show_target_data: int32_t td_mem_align=%d\n",tdp->td_mem_align); // Memory read/write buffer alignment value in bytes
fprintf(stderr,"xdd_show_target_data: struct heartbeat td_hb=%p\n",(void *)tdp->td_planp); // Heartbeat data
fprintf(stderr,"xdd_show_target_data: uint64_t td_target_bytes_to_xfer_per_pass=%lld\n",(long long int)tdp->td_target_bytes_to_xfer_per_pass); // Number of bytes to xfer per pass for the entire target (all qthreads)
Expand Down
1 change: 0 additions & 1 deletion src/common/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ int xddfunc_passdelay(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t fl
int xddfunc_passes(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags);
int xddfunc_passoffset(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags);
int xddfunc_percentcpu(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags);
int xddfunc_preallocate(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags);
int xddfunc_pretruncate(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags);
int xddfunc_processlock(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags);
int xddfunc_processor(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags);
Expand Down
1 change: 0 additions & 1 deletion src/common/target_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ xdd_init_new_target_data(target_data_t *tdp, int32_t n) {
#endif
tdp->td_start_offset = DEFAULT_STARTOFFSET;
tdp->td_pass_offset = DEFAULT_PASSOFFSET;
tdp->td_preallocate = DEFAULT_PREALLOCATE;
tdp->td_pretruncate= DEFAULT_PRETRUNCATE;
tdp->td_queue_depth = DEFAULT_QUEUEDEPTH;
tdp->td_dpp->data_pattern_filename = (char *)DEFAULT_DATA_PATTERN_FILENAME;
Expand Down
1 change: 0 additions & 1 deletion src/common/xint_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
#define DEFAULT_DATA_PATTERN_LENGTH 1
#define DEFAULT_DATA_PATTERN_PREFIX "\0"
#define DEFAULT_DATA_PATTERN_PREFIX_LENGTH 1
#define DEFAULT_PREALLOCATE 0
#define DEFAULT_PRETRUNCATE 0
#define DEFAULT_TIME_LIMIT 0
#define DEFAULT_REPORT_THRESHOLD 0
Expand Down
4 changes: 0 additions & 4 deletions src/common/xint_global_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
*/
#include "xint.h"

#if HAVE_ENABLE_XFS
int xgp_xfs_enabled;
#endif

xdd_global_data_t *xgp;

/*----------------------------------------------------------------------------*/
Expand Down
5 changes: 0 additions & 5 deletions src/common/xint_global_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ struct xdd_global_data {
#define XDD_RETURN_VALUE_CANCELED 5 // Run was canceled
#define XDD_RETURN_VALUE_IOERROR 6 // Run ended due to an I/O error

// Inject a symbol into the namespace if xfs support is configured
#if HAVE_ENABLE_XFS
extern int xgp_xfs_enabled;
#endif

typedef struct xdd_global_data xdd_global_data_t;

extern xdd_global_data_t *xgp; // pointer to the xdd global data that all routines use
Expand Down
6 changes: 0 additions & 6 deletions src/common/xint_prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,6 @@ void nclk_shutdown(void);
void nclk_now(nclk_t *nclkp);
int64_t pclk_now(void);

// xint_preallocate.c
int32_t xint_target_preallocate_for_os(target_data_t *p);
int32_t xint_target_preallocate_for_os(target_data_t *p);
int32_t xint_target_preallocate_for_os(target_data_t *p);
int32_t xint_target_preallocate(target_data_t *p);

// xint_pretruncate.c
int32_t xint_target_pretruncate(target_data_t *p);

Expand Down
13 changes: 1 addition & 12 deletions src/compat/xint_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,8 @@
#endif

/* Platform headers */
#if HAVE_ENABLE_XFS && HAVE_XFS_XFS_H
#include <xfs/xfs.h>
#endif
#if HAVE_ENABLE_XFS && HAVE_XFS_LIBXFS_H
#include <xfs/libxfs.h>
#endif
#if XFS_ENABLED && !HAVE_ENABLE_XFS
#error "ERROR: XFS Support is enabled, but the header support is not valid."
#endif
#if HAVE_LINUX_MAGIC_H && HAVE_DECL_XFS_SUPER_MAGIC
#if HAVE_LINUX_MAGIC_H
#include <linux/magic.h>
#else
#define XFS_SUPER_MAGIC 0x58465342
#endif
#ifdef HAVE_UTMPX_H
#include <utmpx.h>
Expand Down
1 change: 0 additions & 1 deletion src/fs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
set(FS_SRC
sg.c
xint_preallocate.c
xint_pretruncate.c
)

Expand Down
200 changes: 0 additions & 200 deletions src/fs/xint_preallocate.c

This file was deleted.

4 changes: 1 addition & 3 deletions src/fs/xint_pretruncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ xint_target_pretruncate(target_data_t *tdp){
if (tdp->td_pretruncate <= 0)
return(0);

/* A regression in XFS means that preallocate fixes the extents, but
performance is still bad during file extend sequences. Truncate
the file to length to improve performance */
/* Truncate the file to length to improve performance */
status = ftruncate(tdp->td_file_desc, tdp->td_pretruncate * tdp->td_block_size);

// Status should be 0 if everything worked otherwise there was a problem
Expand Down
Loading

0 comments on commit b8e01f0

Please sign in to comment.