]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: Make "fd_handle->gen_id" 64-bit everywhere
authorVolker Lendecke <vl@samba.org>
Mon, 16 Sep 2019 10:50:02 +0000 (03:50 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 17 Sep 2019 22:49:35 +0000 (22:49 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/vfs.h
source3/smbd/oplock.c
source3/smbd/oplock_linux.c

index 3b0243551682e8c9deddc57ab7c6e7f627cbb89d..fef68396221a265a680aa8b4f8c2cdadb48f330f 100644 (file)
@@ -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 {
index d3592f193e8adc7b3fd69ebb8a748c73c249f6f5..0972a63952243ea0de21c36fb7aa64aff18b803e 100644 (file)
@@ -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;
        }
 
index 9292a3370e562e6a79edca0b5a9c8ebb735db95d..2a494ea05c111d118ff4443b4194d749a1942887 100644 (file)
@@ -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));
                }
        }
 }