static void find_oplock_types(files_struct *fsp,
int oplock_request,
- struct share_mode_lock *lck,
+ const struct share_mode_lock *lck,
struct share_mode_entry **pp_batch,
struct share_mode_entry **pp_ex_or_batch,
bool *got_level2,
bool posix_open = False;
bool new_file_created = False;
bool clear_ads = false;
- struct file_id id;
NTSTATUS fsp_open = NT_STATUS_ACCESS_DENIED;
mode_t new_unx_mode = (mode_t)0;
mode_t unx_mode = (mode_t)0;
NTSTATUS status;
char *parent_dir;
- ZERO_STRUCT(id);
-
if (conn->printer) {
/*
* Printers are handled completely differently.
struct share_mode_entry *exclusive_entry = NULL;
bool got_level2_oplock = false;
bool got_a_none_oplock = false;
+ struct file_id id;
struct timespec old_write_time = smb_fname->st.st_ex_mtime;
id = vfs_file_id_from_sbuf(conn, &smb_fname->st);
bool got_level2_oplock = false;
bool got_a_none_oplock = false;
struct timespec old_write_time = smb_fname->st.st_ex_mtime;
+ struct file_id id;
/*
* Deal with the race condition where two smbd's detect the
* file doesn't exist and do the create at the same time. One
fsp->oplock_type = NO_OPLOCK;
}
- if (info == FILE_WAS_OVERWRITTEN || info == FILE_WAS_CREATED || info == FILE_WAS_SUPERSEDED) {
- new_file_created = True;
- }
-
set_share_mode(lck, fsp, get_current_uid(conn),
req ? req->mid : 0,
fsp->oplock_type);
fsp->initial_delete_on_close = True;
}
+ if (info == FILE_WAS_OVERWRITTEN
+ || info == FILE_WAS_CREATED
+ || info == FILE_WAS_SUPERSEDED) {
+ new_file_created = True;
+ }
+
if (new_file_created) {
/* Files should be initially set as archive */
if (lp_map_archive(SNUM(conn)) ||