bool aio_write_behind : 1;
bool initial_delete_on_close : 1;
bool delete_on_close : 1;
+ bool is_sparse : 1;
} fsp_flags;
struct tevent_timer *update_write_time_event;
int current_lock_count; /* Count the number of outstanding locks and pending locks. */
uint64_t posix_flags;
- bool is_sparse;
bool backup_intent; /* Handle was successfully opened with backup intent
and opener has privilege to do so. */
bool use_ofd_locks; /* Are we using open file description locks ? */
START_PROFILE(syscall_ftruncate);
- if (lp_strict_allocate(SNUM(fsp->conn)) && !fsp->is_sparse) {
+ if (lp_strict_allocate(SNUM(fsp->conn)) && !fsp->fsp_flags.is_sparse) {
result = strict_allocate_ftruncate(handle, fsp, len);
END_PROFILE(syscall_ftruncate);
return result;
off_t offset, off_t len)
{
if (mode == (VFS_FALLOCATE_FL_PUNCH_HOLE|VFS_FALLOCATE_FL_KEEP_SIZE) &&
- !fsp->is_sparse &&
+ !fsp->fsp_flags.is_sparse &&
lp_strict_allocate(SNUM(fsp->conn))) {
/*
* This is from a ZERO_DATA request on a non-sparse
FILE_NOTIFY_CHANGE_ATTRIBUTES,
fsp->fsp_name->base_name);
- fsp->is_sparse = sparse;
+ fsp->fsp_flags.is_sparse = sparse;
return NT_STATUS_OK;
}
fsp->fh->pos = pos;
if (pos &&
lp_strict_allocate(SNUM(fsp->conn)) &&
- !fsp->is_sparse)
+ !fsp->fsp_flags.is_sparse)
{
if (vfs_fill_sparse(fsp, pos) == -1) {
return -1;
/* Determine sparse flag. */
if (posix_open) {
/* POSIX opens are sparse by default. */
- fsp->is_sparse = true;
+ fsp->fsp_flags.is_sparse = true;
} else {
- fsp->is_sparse =
+ fsp->fsp_flags.is_sparse =
(existing_dos_attributes & FILE_ATTRIBUTE_SPARSE);
}
* is non-sparse, then FSCTL_DUPLICATE_EXTENTS_TO_FILE completes
* successfully.
*/
- if ((src_fsp->is_sparse) && (!dst_fsp->is_sparse)) {
+ if (src_fsp->fsp_flags.is_sparse && !dst_fsp->fsp_flags.is_sparse) {
return NT_STATUS_NOT_SUPPORTED;
}
return status;
}
- if (!fsp->is_sparse && lp_strict_allocate(SNUM(fsp->conn))) {
+ if (!fsp->fsp_flags.is_sparse && lp_strict_allocate(SNUM(fsp->conn))) {
/*
* File marked non-sparse and "strict allocate" is enabled -
* allocate the range that we just punched out.
max_off = MIN(sbuf.st_ex_size,
qar_req.buf.file_off + qar_req.buf.len) - 1;
- if (!fsp->is_sparse) {
+ if (!fsp->fsp_flags.is_sparse) {
struct file_alloced_range_buf qar_buf;
/* file is non-sparse, claim file_off->max_off is allocated */