From: Volker Lendecke Date: Mon, 16 Sep 2019 10:50:02 +0000 (-0700) Subject: vfs: Make "fd_handle->gen_id" 64-bit everywhere X-Git-Tag: talloc-2.3.1~827 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f8db9b3cff9ef548a66b45f998573aea103db8c;p=thirdparty%2Fsamba.git vfs: Make "fd_handle->gen_id" 64-bit everywhere Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 3b024355168..fef68396221 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -321,7 +321,7 @@ struct fd_handle { * DELETE_ON_CLOSE is not stored in the share * mode database. */ - unsigned long gen_id; + uint64_t gen_id; }; struct fsp_lease { diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index d3592f193e8..0972a639522 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -79,11 +79,13 @@ NTSTATUS set_file_oplock(files_struct *fsp) sconn->oplocks.exclusive_open++; } - DEBUG(5,("set_file_oplock: granted oplock on file %s, %s/%lu, " - "tv_sec = %x, tv_usec = %x\n", - fsp_str_dbg(fsp), file_id_string_tos(&fsp->file_id), - fsp->fh->gen_id, (int)fsp->open_time.tv_sec, - (int)fsp->open_time.tv_usec )); + DBG_INFO("granted oplock on file %s, %s/%"PRIu64", " + "tv_sec = %x, tv_usec = %x\n", + fsp_str_dbg(fsp), + file_id_string_tos(&fsp->file_id), + fsp->fh->gen_id, + (int)fsp->open_time.tv_sec, + (int)fsp->open_time.tv_usec); return NT_STATUS_OK; } @@ -763,10 +765,12 @@ static files_struct *initial_break_processing( */ if(fsp->oplock_type == NO_OPLOCK) { - DEBUG(3, ("initial_break_processing: file %s (file_id = %s " - "gen_id = %lu) has no oplock. Allowing break to " - "succeed regardless.\n", fsp_str_dbg(fsp), - file_id_string_tos(&id), fsp->fh->gen_id)); + DBG_NOTICE("file %s (file_id = %s gen_id = %"PRIu64") " + "has no oplock. " + "Allowing break to succeed regardless.\n", + fsp_str_dbg(fsp), + file_id_string_tos(&id), + fsp->fh->gen_id); return NULL; } diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c index 9292a3370e5..2a494ea05c1 100644 --- a/source3/smbd/oplock_linux.c +++ b/source3/smbd/oplock_linux.c @@ -149,10 +149,11 @@ static bool linux_set_kernel_oplock(struct kernel_oplocks *ctx, return False; } - DEBUG(3,("linux_set_kernel_oplock: got kernel oplock on file %s, " - "file_id = %s gen_id = %lu\n", - fsp_str_dbg(fsp), file_id_string_tos(&fsp->file_id), - fsp->fh->gen_id)); + DBG_NOTICE("got kernel oplock on file %s, " + "file_id = %s gen_id = %"PRIu64"\n", + fsp_str_dbg(fsp), + file_id_string_tos(&fsp->file_id), + fsp->fh->gen_id); return True; } @@ -171,10 +172,12 @@ static void linux_release_kernel_oplock(struct kernel_oplocks *ctx, */ int state = fcntl(fsp->fh->fd, F_GETLEASE, 0); dbgtext("linux_release_kernel_oplock: file %s, file_id = %s " - "gen_id = %lu has kernel oplock state " - "of %x.\n", fsp_str_dbg(fsp), + "gen_id = %"PRIu64" has kernel oplock state " + "of %x.\n", + fsp_str_dbg(fsp), file_id_string_tos(&fsp->file_id), - fsp->fh->gen_id, state ); + fsp->fh->gen_id, + state); } /* @@ -184,10 +187,12 @@ static void linux_release_kernel_oplock(struct kernel_oplocks *ctx, if (DEBUGLVL(0)) { dbgtext("linux_release_kernel_oplock: Error when " "removing kernel oplock on file " ); - dbgtext("%s, file_id = %s, gen_id = %lu. " - "Error was %s\n", fsp_str_dbg(fsp), + dbgtext("%s, file_id = %s, gen_id = %"PRIu64". " + "Error was %s\n", + fsp_str_dbg(fsp), file_id_string_tos(&fsp->file_id), - fsp->fh->gen_id, strerror(errno) ); + fsp->fh->gen_id, + strerror(errno)); } } }