Add some DEBUG
authorVolker Lendecke <vl@samba.org>
Sun, 20 Jan 2008 12:55:27 +0000 (13:55 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 20 Jan 2008 12:55:27 +0000 (13:55 +0100)
(This used to be commit 8db25aba63b1dffb0dfbc74012c7ebd0ce4d5682)

source3/modules/vfs_streams_xattr.c
source3/modules/vfs_xattr_tdb.c

index 7d7ec02fe722f59a7068f7ffec3a195cafbbbed0..e304810a02eb17bbc83b8d480f807cf5a0975ab7 100644 (file)
@@ -92,6 +92,8 @@ static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
        struct stream_io *io = (struct stream_io *)
                VFS_FETCH_FSP_EXTENSION(handle, fsp);
 
+       DEBUG(10, ("streams_xattr_fstat called for %d\n", fsp->fh->fd));
+
        if (io == NULL) {
                return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
        }
@@ -105,6 +107,8 @@ static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
                return -1;
        }
 
+       DEBUG(10, ("sbuf->st_size = %d\n", (int)sbuf->st_size));
+
        sbuf->st_ino = stream_inode(sbuf, io->xattr_name);
        sbuf->st_mode &= ~S_IFMT;
         sbuf->st_mode |= S_IFREG;
@@ -219,6 +223,8 @@ static int streams_xattr_open(vfs_handle_struct *handle,  const char *fname,
        int baseflags;
        int hostfd = -1;
 
+       DEBUG(10, ("streams_xattr_open called for %s\n", fname));
+
        if (!is_ntfs_stream_name(fname)) {
                return SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode);
        }
@@ -267,6 +273,8 @@ static int streams_xattr_open(vfs_handle_struct *handle,  const char *fname,
        status = get_ea_value(talloc_tos(), handle->conn, fsp, base,
                              xattr_name, &ea);
 
+       DEBUG(10, ("get_ea_value returned %s\n", nt_errstr(status)));
+
        if (!NT_STATUS_IS_OK(status)
            && !NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
                /*
@@ -274,6 +282,8 @@ static int streams_xattr_open(vfs_handle_struct *handle,  const char *fname,
                 * O_CREAT, the higher levels should have created the base
                 * file for us.
                 */
+               DEBUG(10, ("streams_xattr_open: base file %s not around, "
+                          "returning ENOENT\n", base));
                errno = ENOENT;
                goto fail;
        }
@@ -572,6 +582,8 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct *handle,
        NTSTATUS status;
        int ret;
 
+       DEBUG(10, ("streams_xattr_pwrite called for %d bytes\n", (int)n));
+
        if (sio == NULL) {
                return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
        }
index 7416fa785a9480234d81c3217ecba8a07db4c068..208066bedca39029c1b443775b41c85e07363bcd 100644 (file)
@@ -165,6 +165,9 @@ static ssize_t xattr_tdb_getattr(struct db_context *db_ctx,
        ssize_t result = -1;
        NTSTATUS status;
 
+       DEBUG(10, ("xattr_tdb_getattr called for file %s, name %s\n",
+                  file_id_string_tos(id), name));
+
        status = xattr_tdb_load_attrs(talloc_tos(), db_ctx, id, &attribs);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -250,6 +253,9 @@ static int xattr_tdb_setattr(struct db_context *db_ctx,
        struct tdb_xattrs *attribs;
        uint32_t i;
 
+       DEBUG(10, ("xattr_tdb_setattr called for file %s, name %s\n",
+                  file_id_string_tos(id), name));
+
        rec = xattr_tdb_lock_attrs(talloc_tos(), db_ctx, id);
 
        if (rec == NULL) {