Skip to content

Commit

Permalink
file: move stat_data definition to file-types.hh
Browse files Browse the repository at this point in the history
Signed-off-by: Benny Halevy <[email protected]>
  • Loading branch information
bhalevy committed Nov 7, 2024
1 parent f2c0668 commit 3db2d8e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
22 changes: 22 additions & 0 deletions include/seastar/core/file-types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <type_traits>
#include <cstdint>
#include <chrono>

#include <seastar/util/modules.hh>
#endif

Expand Down Expand Up @@ -158,6 +161,25 @@ inline constexpr file_permissions operator&(file_permissions a, file_permissions
return file_permissions(std::underlying_type_t<file_permissions>(a) & std::underlying_type_t<file_permissions>(b));
}

/// Filesystem object stat information
struct stat_data {
uint64_t device_id; // ID of device containing file
uint64_t inode_number; // Inode number
uint64_t mode; // File type and mode
directory_entry_type type;
uint64_t number_of_links;// Number of hard links
uint64_t uid; // User ID of owner
uint64_t gid; // Group ID of owner
uint64_t rdev; // Device ID (if special file)
uint64_t size; // Total size, in bytes
uint64_t block_size; // Block size for filesystem I/O
uint64_t allocated_size; // Total size of allocated storage, in bytes

std::chrono::system_clock::time_point time_accessed; // Time of last content access
std::chrono::system_clock::time_point time_modified; // Time of last content modification
std::chrono::system_clock::time_point time_changed; // Time of last status change (either content or attributes)
};

/// @}

SEASTAR_MODULE_EXPORT_END
Expand Down
19 changes: 0 additions & 19 deletions include/seastar/core/file.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,6 @@ struct group_details {
std::vector<sstring> group_members;
};

/// Filesystem object stat information
struct stat_data {
uint64_t device_id; // ID of device containing file
uint64_t inode_number; // Inode number
uint64_t mode; // File type and mode
directory_entry_type type;
uint64_t number_of_links;// Number of hard links
uint64_t uid; // User ID of owner
uint64_t gid; // Group ID of owner
uint64_t rdev; // Device ID (if special file)
uint64_t size; // Total size, in bytes
uint64_t block_size; // Block size for filesystem I/O
uint64_t allocated_size; // Total size of allocated storage, in bytes

std::chrono::system_clock::time_point time_accessed; // Time of last content access
std::chrono::system_clock::time_point time_modified; // Time of last content modification
std::chrono::system_clock::time_point time_changed; // Time of last status change (either content or attributes)
};

/// File open options
///
/// Options used to configure an open file.
Expand Down

0 comments on commit 3db2d8e

Please sign in to comment.