files_struct *file_find_fd(int fd);
files_struct *file_find_dif(struct smbd_server_connection *sconn,
struct file_id id, unsigned long gen_id);
-files_struct *file_find_di_first(struct file_id id);
+files_struct *file_find_di_first(struct smbd_server_connection *sconn,
+ struct file_id id);
files_struct *file_find_di_next(files_struct *start_fsp);
bool file_find_subpath(files_struct *dir_fsp);
void file_sync_all(connection_struct *conn);
/* Ensure we have this file open with DELETE access. */
id = vfs_file_id_from_sbuf(conn, &local_fname.st);
- for (fsp = file_find_di_first(id); fsp; file_find_di_next(fsp)) {
+ for (fsp = file_find_di_first(conn->sconn, id); fsp;
+ file_find_di_next(fsp)) {
if (fsp->access_mask & DELETE_ACCESS &&
fsp->delete_on_close) {
/* We did open this for delete,
calls.
****************************************************************************/
-files_struct *file_find_di_first(struct file_id id)
+files_struct *file_find_di_first(struct smbd_server_connection *sconn,
+ struct file_id id)
{
files_struct *fsp;
fsp_fi_cache.id = id;
- for (fsp=smbd_server_conn->files;fsp;fsp=fsp->next) {
+ for (fsp=sconn->files;fsp;fsp=fsp->next) {
if (file_id_equal(&fsp->file_id, &id)) {
/* Setup positive cache. */
fsp_fi_cache.fsp = fsp;
DEBUG(5,("fcb_or_dos_open: attempting old open semantics for "
"file %s.\n", smb_fname_str_dbg(smb_fname)));
- for(fsp = file_find_di_first(id); fsp;
+ for(fsp = file_find_di_first(conn->sconn, id); fsp;
fsp = file_find_di_next(fsp)) {
DEBUG(10,("fcb_or_dos_open: checking file %s, fd = %d, "
sharepath, smb_fname_str_dbg(smb_fname),
file_id_string_tos(&id)));
- for(fsp = file_find_di_first(id); fsp; fsp = file_find_di_next(fsp)) {
+ for(fsp = file_find_di_first(smbd_server_conn, id); fsp;
+ fsp = file_find_di_next(fsp)) {
if (memcmp(fsp->conn->connectpath, sharepath, sp_len) == 0) {
DEBUG(10,("msg_file_was_renamed: renaming file fnum %d from %s -> %s\n",
bool did_rename = False;
NTSTATUS status;
- for(fsp = file_find_di_first(lck->id); fsp;
+ for(fsp = file_find_di_first(conn->sconn, lck->id); fsp;
fsp = file_find_di_next(fsp)) {
/* fsp_name is a relative path under the fsp. To change this for other
sharepaths we need to manipulate relative paths. */
if (dst_exists) {
struct file_id fileid = vfs_file_id_from_sbuf(conn,
&smb_fname_dst->st);
- files_struct *dst_fsp = file_find_di_first(fileid);
+ files_struct *dst_fsp = file_find_di_first(conn->sconn,
+ fileid);
/* The file can be open when renaming a stream */
if (dst_fsp && !new_is_stream) {
DEBUG(3, ("rename_internals_fsp: Target file open\n"));
/* Do we have this path open ? */
files_struct *fsp1;
struct file_id fileid = vfs_file_id_from_sbuf(conn, psbuf);
- fsp1 = file_find_di_first(fileid);
+ fsp1 = file_find_di_first(conn->sconn, fileid);
if (fsp1 && fsp1->initial_allocation_size) {
allocation_size = SMB_VFS_GET_ALLOC_SIZE(conn, fsp1, psbuf);
}
}
id = vfs_file_id_from_sbuf(conn, &sbuf);
- for(all_fsps = file_find_di_first(id); all_fsps;
+ for(all_fsps = file_find_di_first(conn->sconn, id); all_fsps;
all_fsps = file_find_di_next(all_fsps)) {
/*
* We're setting the time explicitly for UNIX.