]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbstatus: add file_id information to byte-range locks in json output
authorJule Anger <janger@samba.org>
Mon, 1 Aug 2022 09:15:44 +0000 (11:15 +0200)
committerJule Anger <janger@samba.org>
Mon, 8 Aug 2022 12:56:29 +0000 (12:56 +0000)
Adds a dictionary with file_id information (devid, inode and extid) for
each byte-range locked file.

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/utils/status.c
source3/utils/status_json.c
source3/utils/status_json.h
source3/utils/status_json_dummy.c

index f02e8e14951d638b03fd8a79efb62055535d446e..6aad917d07567a87d6813e6a02f96b6dce4ff33c 100644 (file)
@@ -412,6 +412,7 @@ static void print_brl(struct file_id id,
        } else {
                print_brl_json(state,
                               pid,
+                              id,
                               desc,
                               lock_flav,
                               (intmax_t)start,
index 71783916004e9bd47232504c7148b55604d4d10d..695bfd0a21c4e6bd48ab5f1c0fc193b582711fd0 100644 (file)
@@ -1035,6 +1035,7 @@ failure:
 
 int print_brl_json(struct traverse_state *state,
                   const struct server_id server_id,
+                  struct file_id fid,
                   const char *type,
                   enum brl_flavour flavour,
                   intmax_t start,
@@ -1070,6 +1071,10 @@ int print_brl_json(struct traverse_state *state,
                goto failure;
        }
 
+       result = add_fileid_to_json(&file_json, fid);
+       if (result < 0) {
+               goto failure;
+       }
        result = json_add_string(&file_json, "file_name", filename);
        if (result < 0) {
                goto failure;
index 61e7b6a0540ae7f96fab79a1076f73b0b214ce8c..70087a3f65d369fcd68ae5059dffe639c9072ac6 100644 (file)
@@ -55,6 +55,7 @@ int print_share_mode_json(struct traverse_state *state,
 
 int print_brl_json(struct traverse_state *state,
                   const struct server_id server_id,
+                  struct file_id fid,
                   const char *type,
                   enum brl_flavour flavour,
                   intmax_t start,
index c657e55b44f1f08d03387f5836410e301e3140e6..8923c41aac4adcbe5231ccf5be3c7682c5f22799 100644 (file)
@@ -72,6 +72,7 @@ int print_share_mode_json(struct traverse_state *state,
 
 int print_brl_json(struct traverse_state *state,
                   const struct server_id server_id,
+                  struct file_id fid,
                   const char *type,
                   enum brl_flavour flavour,
                   intmax_t start,