return True;
}
+bool smb_vfs_call_lock(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, int op, SMB_OFF_T offset,
+ SMB_OFF_T count, int type)
+{
+ VFS_FIND(lock);
+ return handle->fns->lock(handle, fsp, op, offset, count, type);
+}
+
/****************************************************************************
Actual function that does POSIX locks. Copes with 64 -> 32 bit cruft and
broken NFS implementations.
return ret;
}
+bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, SMB_OFF_T *poffset,
+ SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+{
+ VFS_FIND(getlock);
+ return handle->fns->getlock(handle, fsp, poffset, pcount, ptype, ppid);
+}
+
/****************************************************************************
Actual function that gets POSIX locks. Copes with 64 -> 32 bit cruft and
broken NFS implementations.
SMB_OFF_T count;
int posix_lock_type = map_posix_lock_type(fsp,*plock_type);
- DEBUG(10,("is_posix_locked: File %s, offset = %.0f, count = %.0f, type = %s\n",
- fsp->fsp_name, (double)*pu_offset, (double)*pu_count, posix_lock_type_name(*plock_type) ));
+ DEBUG(10,("is_posix_locked: File %s, offset = %.0f, count = %.0f, "
+ "type = %s\n", fsp_str_dbg(fsp), (double)*pu_offset,
+ (double)*pu_count, posix_lock_type_name(*plock_type)));
/*
* If the requested lock won't fit in the POSIX range, we will
TALLOC_FREE(rec);
DEBUG(10,("increment_windows_lock_ref_count for file now %s = %d\n",
- fsp->fsp_name, lock_ref_count ));
+ fsp_str_dbg(fsp), lock_ref_count));
}
/****************************************************************************
TALLOC_FREE(rec);
DEBUG(10,("reduce_windows_lock_ref_count for file now %s = %d\n",
- fsp->fsp_name, lock_ref_count ));
+ fsp_str_dbg(fsp), lock_ref_count));
}
static void decrement_windows_lock_ref_count(files_struct *fsp)
}
DEBUG(10,("get_windows_lock_count for file %s = %d\n",
- fsp->fsp_name, lock_ref_count ));
+ fsp_str_dbg(fsp), lock_ref_count));
return lock_ref_count;
}
TALLOC_FREE(rec);
DEBUG(10,("delete_windows_lock_ref_count for file %s\n",
- fsp->fsp_name));
+ fsp_str_dbg(fsp)));
}
/****************************************************************************
TALLOC_FREE(rec);
DEBUG(10,("add_fd_to_close_entry: added fd %d file %s\n",
- fsp->fh->fd, fsp->fsp_name ));
+ fsp->fh->fd, fsp_str_dbg(fsp)));
}
/****************************************************************************
*/
char *msg = NULL;
- /* Don't check if alloc succeeds here - we're
- * forcing a core dump anyway. */
-
- asprintf(&msg, "logic flaw in cases: l_curr: start = %.0f, size = %.0f : \
-lock: start = %.0f, size = %.0f", (double)l_curr->start, (double)l_curr->size, (double)lock->start, (double)lock->size );
-
- smb_panic(msg);
+ if (asprintf(&msg, "logic flaw in cases: l_curr: start = %.0f, size = %.0f : \
+lock: start = %.0f, size = %.0f", (double)l_curr->start, (double)l_curr->size, (double)lock->start, (double)lock->size ) != -1) {
+ smb_panic(msg);
+ } else {
+ smb_panic("posix_lock_list");
+ }
}
} /* end for ( l_curr = lhead; l_curr;) */
} /* end for (i=0; i<num_locks && ul_head; i++) */
struct lock_list *llist = NULL;
struct lock_list *ll = NULL;
- DEBUG(5,("set_posix_lock_windows_flavour: File %s, offset = %.0f, count = %.0f, type = %s\n",
- fsp->fsp_name, (double)u_offset, (double)u_count, posix_lock_type_name(lock_type) ));
+ DEBUG(5,("set_posix_lock_windows_flavour: File %s, offset = %.0f, "
+ "count = %.0f, type = %s\n", fsp_str_dbg(fsp),
+ (double)u_offset, (double)u_count,
+ posix_lock_type_name(lock_type)));
/*
* If the requested lock won't fit in the POSIX range, we will
struct lock_list *ulist = NULL;
struct lock_list *ul = NULL;
- DEBUG(5,("release_posix_lock_windows_flavour: File %s, offset = %.0f, count = %.0f\n",
- fsp->fsp_name, (double)u_offset, (double)u_count ));
+ DEBUG(5,("release_posix_lock_windows_flavour: File %s, offset = %.0f, "
+ "count = %.0f\n", fsp_str_dbg(fsp),
+ (double)u_offset, (double)u_count));
/* Remember the number of Windows locks we have on this dev/ino pair. */
decrement_windows_lock_ref_count(fsp);
SMB_OFF_T count;
int posix_lock_type = map_posix_lock_type(fsp,lock_type);
- DEBUG(5,("set_posix_lock_posix_flavour: File %s, offset = %.0f, count = %.0f, type = %s\n",
- fsp->fsp_name, (double)u_offset, (double)u_count, posix_lock_type_name(lock_type) ));
+ DEBUG(5,("set_posix_lock_posix_flavour: File %s, offset = %.0f, count "
+ "= %.0f, type = %s\n", fsp_str_dbg(fsp),
+ (double)u_offset, (double)u_count,
+ posix_lock_type_name(lock_type)));
/*
* If the requested lock won't fit in the POSIX range, we will
struct lock_list *ulist = NULL;
struct lock_list *ul = NULL;
- DEBUG(5,("release_posix_lock_posix_flavour: File %s, offset = %.0f, count = %.0f\n",
- fsp->fsp_name, (double)u_offset, (double)u_count ));
+ DEBUG(5,("release_posix_lock_posix_flavour: File %s, offset = %.0f, "
+ "count = %.0f\n", fsp_str_dbg(fsp),
+ (double)u_offset, (double)u_count));
/*
* If the requested lock won't fit in the POSIX range, we will