From: Jeremy Allison Date: Wed, 23 Jun 2021 01:07:29 +0000 (-0700) Subject: s3: VFS: xattr_tdb: Remove xattr_tdb_getxattr. X-Git-Tag: tevent-0.11.0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce9cdeb3504e007557a870ae99d3a84c8a7b9c36;p=thirdparty%2Fsamba.git s3: VFS: xattr_tdb: Remove xattr_tdb_getxattr. No longer used. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c index d9854a0b83b..daa99b2cc3e 100644 --- a/source3/modules/vfs_xattr_tdb.c +++ b/source3/modules/vfs_xattr_tdb.c @@ -62,53 +62,6 @@ static int xattr_tdb_get_file_id(struct vfs_handle_struct *handle, return 0; } -static ssize_t xattr_tdb_getxattr(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - const char *name, - void *value, - size_t size) -{ - struct file_id id; - struct db_context *db; - ssize_t xattr_size; - int ret; - DATA_BLOB blob; - TALLOC_CTX *frame = talloc_stackframe(); - - SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, - if (!xattr_tdb_init(-1, frame, &db)) - { - TALLOC_FREE(frame); return -1; - }); - - ret = xattr_tdb_get_file_id(handle, smb_fname->base_name, &id); - if (ret == -1) { - TALLOC_FREE(frame); - return -1; - } - - xattr_size = xattr_tdb_getattr(db, frame, &id, name, &blob); - if (xattr_size < 0) { - errno = ENOATTR; - TALLOC_FREE(frame); - return -1; - } - - if (size == 0) { - TALLOC_FREE(frame); - return xattr_size; - } - - if (blob.length > size) { - TALLOC_FREE(frame); - errno = ERANGE; - return -1; - } - memcpy(value, blob.data, xattr_size); - TALLOC_FREE(frame); - return xattr_size; -} - struct xattr_tdb_getxattrat_state { struct vfs_aio_state vfs_aio_state; ssize_t xattr_size; @@ -650,7 +603,6 @@ static int xattr_tdb_connect(vfs_handle_struct *handle, const char *service, } static struct vfs_fn_pointers vfs_xattr_tdb_fns = { - .getxattr_fn = xattr_tdb_getxattr, .getxattrat_send_fn = xattr_tdb_getxattrat_send, .getxattrat_recv_fn = xattr_tdb_getxattrat_recv, .fgetxattr_fn = xattr_tdb_fgetxattr,