summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-05-16 16:37:47 -0700
committerJeremy Allison <jra@samba.org>2016-05-21 01:28:27 +0200
commita3df904a7a4825ab83ffc6207e88622e79b2765b (patch)
tree599b73b2dd743c60f28786932e9a6ccbd5828d3b /source3/locking
parent4146fb94fe5e65001310dffc85ef22e930ee2e6e (diff)
downloadsamba-a3df904a7a4825ab83ffc6207e88622e79b2765b.tar.gz
s3: locking: Add some const.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Jeff Layton <jlayton@samba.org>
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/posix.c23
-rw-r--r--source3/locking/proto.h2
2 files changed, 13 insertions, 12 deletions
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index beab9a47b5a..1773b2282ba 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -346,7 +346,7 @@ struct lock_ref_count_key {
Form a static locking key for a dev/inode pair for the lock ref count
******************************************************************/
-static TDB_DATA locking_ref_count_key_fsp(files_struct *fsp,
+static TDB_DATA locking_ref_count_key_fsp(const files_struct *fsp,
struct lock_ref_count_key *tmp)
{
ZERO_STRUCTP(tmp);
@@ -359,9 +359,9 @@ static TDB_DATA locking_ref_count_key_fsp(files_struct *fsp,
Convenience function to get an fd_array key from an fsp.
******************************************************************/
-static TDB_DATA fd_array_key_fsp(files_struct *fsp)
+static TDB_DATA fd_array_key_fsp(const files_struct *fsp)
{
- return make_tdb_data((uint8_t *)&fsp->file_id, sizeof(fsp->file_id));
+ return make_tdb_data((const uint8_t *)&fsp->file_id, sizeof(fsp->file_id));
}
/*******************************************************************
@@ -414,7 +414,7 @@ bool posix_locking_end(void)
pair. Creates entry if it doesn't exist.
****************************************************************************/
-static void increment_lock_ref_count(files_struct *fsp)
+static void increment_lock_ref_count(const files_struct *fsp)
{
struct lock_ref_count_key tmp;
int32_t lock_ref_count = 0;
@@ -431,7 +431,7 @@ static void increment_lock_ref_count(files_struct *fsp)
fsp_str_dbg(fsp), (int)lock_ref_count));
}
-static void decrement_lock_ref_count(files_struct *fsp)
+static void decrement_lock_ref_count(const files_struct *fsp)
{
struct lock_ref_count_key tmp;
int32_t lock_ref_count = 0;
@@ -452,7 +452,7 @@ static void decrement_lock_ref_count(files_struct *fsp)
Fetch the lock ref count.
****************************************************************************/
-static int32_t get_lock_ref_count(files_struct *fsp)
+static int32_t get_lock_ref_count(const files_struct *fsp)
{
struct lock_ref_count_key tmp;
NTSTATUS status;
@@ -475,7 +475,7 @@ static int32_t get_lock_ref_count(files_struct *fsp)
Delete a lock_ref_count entry.
****************************************************************************/
-static void delete_lock_ref_count(files_struct *fsp)
+static void delete_lock_ref_count(const files_struct *fsp)
{
struct lock_ref_count_key tmp;
@@ -492,7 +492,7 @@ static void delete_lock_ref_count(files_struct *fsp)
Add an fd to the pending close tdb.
****************************************************************************/
-static void add_fd_to_close_entry(files_struct *fsp)
+static void add_fd_to_close_entry(const files_struct *fsp)
{
struct db_record *rec;
int *fds;
@@ -532,7 +532,7 @@ static void add_fd_to_close_entry(files_struct *fsp)
Remove all fd entries for a specific dev/inode pair from the tdb.
****************************************************************************/
-static void delete_close_entries(files_struct *fsp)
+static void delete_close_entries(const files_struct *fsp)
{
struct db_record *rec;
@@ -551,7 +551,8 @@ static void delete_close_entries(files_struct *fsp)
****************************************************************************/
static size_t get_posix_pending_close_entries(TALLOC_CTX *mem_ctx,
- files_struct *fsp, int **entries)
+ const files_struct *fsp,
+ int **entries)
{
TDB_DATA dbuf;
NTSTATUS status;
@@ -582,7 +583,7 @@ static size_t get_posix_pending_close_entries(TALLOC_CTX *mem_ctx,
to delete all locks on this fsp before this function is called.
****************************************************************************/
-int fd_close_posix(struct files_struct *fsp)
+int fd_close_posix(const struct files_struct *fsp)
{
int saved_errno = 0;
int ret;
diff --git a/source3/locking/proto.h b/source3/locking/proto.h
index 8ff1c7cd632..1eabd6a603c 100644
--- a/source3/locking/proto.h
+++ b/source3/locking/proto.h
@@ -219,7 +219,7 @@ bool is_posix_locked(files_struct *fsp,
enum brl_flavour lock_flav);
bool posix_locking_init(bool read_only);
bool posix_locking_end(void);
-int fd_close_posix(struct files_struct *fsp);
+int fd_close_posix(const struct files_struct *fsp);
bool set_posix_lock_windows_flavour(files_struct *fsp,
uint64_t u_offset,
uint64_t u_count,