#include "../lib/util/memcache.h"
#include "lib/util/tevent_ntstatus.h"
#include "g_lock.h"
+#include "smbd/fd_handle.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_LOCKING
ltdb->share_entries,
ltdb->num_share_entries,
my_pid,
- fsp->fh->gen_id,
+ fh_get_gen_id(fsp->fh),
&e,
&found);
if (found) {
.op_type = op_type,
.time.tv_sec = fsp->open_time.tv_sec,
.time.tv_usec = fsp->open_time.tv_usec,
- .share_file_id = fsp->fh->gen_id,
+ .share_file_id = fh_get_gen_id(fsp->fh),
.uid = (uint32_t)uid,
.flags = (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) ?
SHARE_MODE_FLAG_POSIX_OPEN : 0,
ok = share_mode_entry_do(
lck,
messaging_server_id(fsp->conn->sconn->msg_ctx),
- fsp->fh->gen_id,
+ fh_get_gen_id(fsp->fh),
del_share_mode_fn,
&state);
if (!ok) {
ok = share_mode_entry_do(
lck,
messaging_server_id(fsp->conn->sconn->msg_ctx),
- fsp->fh->gen_id,
+ fh_get_gen_id(fsp->fh),
remove_share_oplock_fn,
&state);
if (!ok) {
ok = share_mode_entry_do(
lck,
messaging_server_id(fsp->conn->sconn->msg_ctx),
- fsp->fh->gen_id,
+ fh_get_gen_id(fsp->fh),
downgrade_share_oplock_fn,
&state);
if (!ok) {
ok = share_mode_entry_do(
lck,
messaging_server_id(fsp->conn->sconn->msg_ctx),
- fsp->fh->gen_id,
+ fh_get_gen_id(fsp->fh),
mark_share_mode_disconnected_fn,
&state);
if (!ok) {
(e->flags & SHARE_MODE_FLAG_POSIX_OPEN)) {
return false;
}
- if (e->share_file_id == fsp->fh->gen_id) {
+ if (e->share_file_id == fh_get_gen_id(fsp->fh)) {
struct server_id self = messaging_server_id(
fsp->conn->sconn->msg_ctx);
if (server_id_equal(&self, &e->pid)) {
e.share_file_id,
messaging_server_id(conn->sconn->msg_ctx),
smb1req->mid,
- fsp->fh->gen_id);
+ fh_get_gen_id(fsp->fh));
if (!ok) {
DBG_DEBUG("Could not set new share_mode_entry values\n");
TALLOC_FREE(lck);
* A billion of 64-bit increments per second gives us
* more than 500 years of runtime without wrap.
*/
- fsp->fh->gen_id = gen_id++;
+ gen_id++;
+ fh_set_gen_id(fsp->fh, gen_id);
}
/****************************************************************************
for (fsp=sconn->files; fsp; fsp=fsp->next,count++) {
/* We can have a fsp->fh->fd == -1 here as it could be a stat open. */
if (file_id_equal(&fsp->file_id, &id) &&
- fsp->fh->gen_id == gen_id ) {
+ fh_get_gen_id(fsp->fh) == gen_id ) {
if (count > 10) {
DLIST_PROMOTE(sconn->files, fsp);
}
"stat open with oplock type !\n",
fsp_str_dbg(fsp),
file_id_str_buf(fsp->file_id, &idbuf),
- (unsigned int)fsp->fh->gen_id,
+ (unsigned int)fh_get_gen_id(fsp->fh),
(unsigned int)fsp->oplock_type ));
smb_panic("file_find_dif");
}
/* Put the kernel break info into the message. */
push_file_id_24((char *)msg, &fsp->file_id);
- SIVAL(msg,24,fsp->fh->gen_id);
+ SIVAL(msg, 24, fh_get_gen_id(fsp->fh));
/* Don't need to be root here as we're only ever
sending to ourselves. */
"tv_sec = %x, tv_usec = %x\n",
fsp_str_dbg(fsp),
file_id_str_buf(fsp->file_id, &buf),
- fsp->fh->gen_id,
+ fh_get_gen_id(fsp->fh),
(int)fsp->open_time.tv_sec,
(int)fsp->open_time.tv_usec);
"Allowing break to succeed regardless.\n",
fsp_str_dbg(fsp),
file_id_str_buf(id, &idbuf),
- fsp->fh->gen_id);
+ fh_get_gen_id(fsp->fh));
return NULL;
}
"file_id = %s gen_id = %"PRIu64"\n",
fsp_str_dbg(fsp),
file_id_str_buf(fsp->file_id, &idbuf),
- fsp->fh->gen_id);
+ fh_get_gen_id(fsp->fh));
return True;
}
"of %x.\n",
fsp_str_dbg(fsp),
file_id_str_buf(fsp->file_id, &idbuf),
- fsp->fh->gen_id,
+ fh_get_gen_id(fsp->fh),
state);
}
"Error was %s\n",
fsp_str_dbg(fsp),
file_id_str_buf(fsp->file_id, &idbuf),
- fsp->fh->gen_id,
+ fh_get_gen_id(fsp->fh),
strerror(errno));
}
}