smbd: Add brl_fsp access function
authorVolker Lendecke <vl@samba.org>
Tue, 10 Sep 2013 17:41:32 +0000 (19:41 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 11 Sep 2013 06:27:11 +0000 (08:27 +0200)
source3/locking/brlock.c
source3/locking/proto.h
source3/modules/vfs_full_audit.c
source3/modules/vfs_time_audit.c

index 0639649576b8b7f92323245d47313b7943575817..cc5d7a8ae0b898700b6f7e229f9767eea9a2c56f 100644 (file)
@@ -68,6 +68,11 @@ unsigned int brl_num_locks(const struct byte_range_lock *brl)
        return brl->num_locks;
 }
 
+struct files_struct *brl_fsp(struct byte_range_lock *brl)
+{
+       return brl->fsp;
+}
+
 /****************************************************************************
  See if two locking contexts are equal.
 ****************************************************************************/
index f5137f97d27b12b5e2775e59e4d5ff2925166084..1573f6b306d3036092c743c34fd564c7aa073d96 100644 (file)
@@ -29,6 +29,7 @@ void brl_init(bool read_only);
 void brl_shutdown(void);
 
 unsigned int brl_num_locks(const struct byte_range_lock *brl);
+struct files_struct *brl_fsp(struct byte_range_lock *brl);
 
 NTSTATUS brl_lock_windows_default(struct byte_range_lock *br_lck,
                struct lock_struct *plock,
index 549f55e189565ae88b17b9361ded488fa779338a..37d8aa45030a855e4bd4eef70f7d778b62eeb558 100644 (file)
@@ -1655,7 +1655,8 @@ static NTSTATUS smb_full_audit_brl_lock_windows(struct vfs_handle_struct *handle
            blocking_lock, blr);
 
        do_log(SMB_VFS_OP_BRL_LOCK_WINDOWS, NT_STATUS_IS_OK(result), handle,
-           "%s:%llu-%llu. type=%d. blocking=%d", fsp_str_do_log(br_lck->fsp),
+           "%s:%llu-%llu. type=%d. blocking=%d",
+              fsp_str_do_log(brl_fsp(br_lck)),
            plock->start, plock->size, plock->lock_type, blocking_lock);
 
        return result;
@@ -1672,7 +1673,8 @@ static bool smb_full_audit_brl_unlock_windows(struct vfs_handle_struct *handle,
            plock);
 
        do_log(SMB_VFS_OP_BRL_UNLOCK_WINDOWS, (result == 0), handle,
-           "%s:%llu-%llu:%d", fsp_str_do_log(br_lck->fsp), plock->start,
+              "%s:%llu-%llu:%d", fsp_str_do_log(brl_fsp(br_lck)),
+              plock->start,
            plock->size, plock->lock_type);
 
        return result;
@@ -1688,7 +1690,8 @@ static bool smb_full_audit_brl_cancel_windows(struct vfs_handle_struct *handle,
        result = SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock, blr);
 
        do_log(SMB_VFS_OP_BRL_CANCEL_WINDOWS, (result == 0), handle,
-           "%s:%llu-%llu:%d", fsp_str_do_log(br_lck->fsp), plock->start,
+              "%s:%llu-%llu:%d", fsp_str_do_log(brl_fsp(br_lck)),
+              plock->start,
            plock->size, plock->lock_type);
 
        return result;
index 1b14d650afd3f07b1f5325acd15db93a634b187b..98a6151797c2a9b86ec8a68e5188ef11bd34fdb9 100644 (file)
@@ -1558,7 +1558,7 @@ static NTSTATUS smb_time_audit_brl_lock_windows(struct vfs_handle_struct *handle
 
        if (timediff > audit_timeout) {
                smb_time_audit_log_fsp("brl_lock_windows", timediff,
-                                      br_lck->fsp);
+                                      brl_fsp(br_lck));
        }
 
        return result;
@@ -1581,7 +1581,7 @@ static bool smb_time_audit_brl_unlock_windows(struct vfs_handle_struct *handle,
 
        if (timediff > audit_timeout) {
                smb_time_audit_log_fsp("brl_unlock_windows", timediff,
-                                      br_lck->fsp);
+                                      brl_fsp(br_lck));
        }
 
        return result;
@@ -1603,7 +1603,7 @@ static bool smb_time_audit_brl_cancel_windows(struct vfs_handle_struct *handle,
 
        if (timediff > audit_timeout) {
                smb_time_audit_log_fsp("brl_cancel_windows", timediff,
-                                      br_lck->fsp);
+                                      brl_fsp(br_lck));
        }
 
        return result;