From 3bc8527cdc7a7958c8906044dbb0e7ad21f5e336 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 17 Sep 2019 19:16:31 -0700 Subject: [PATCH] s3: VFS: vfs_xattr_tdb: Remove unlink_fn. No longer used. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/modules/vfs_xattr_tdb.c | 60 --------------------------------- 1 file changed, 60 deletions(-) diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c index 588a2740d68..1d97770e0b6 100644 --- a/source3/modules/vfs_xattr_tdb.c +++ b/source3/modules/vfs_xattr_tdb.c @@ -590,65 +590,6 @@ static int xattr_tdb_mkdirat(vfs_handle_struct *handle, return 0; } -/* - * On unlink we need to delete the tdb record - */ -static int xattr_tdb_unlink(vfs_handle_struct *handle, - const struct smb_filename *smb_fname) -{ - struct smb_filename *smb_fname_tmp = NULL; - struct file_id id; - struct db_context *db; - int ret = -1; - bool remove_record = false; - 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; - }); - - smb_fname_tmp = cp_smb_filename(frame, smb_fname); - if (smb_fname_tmp == NULL) { - TALLOC_FREE(frame); - errno = ENOMEM; - return -1; - } - - if (smb_fname_tmp->flags & SMB_FILENAME_POSIX_PATH) { - ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname_tmp); - } else { - ret = SMB_VFS_NEXT_STAT(handle, smb_fname_tmp); - } - if (ret == -1) { - goto out; - } - - if (smb_fname_tmp->st.st_ex_nlink == 1) { - /* Only remove record on last link to file. */ - remove_record = true; - } - - ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname_tmp); - - if (ret == -1) { - goto out; - } - - if (!remove_record) { - goto out; - } - - id = SMB_VFS_NEXT_FILE_ID_CREATE(handle, &smb_fname_tmp->st); - - xattr_tdb_remove_all_attrs(db, &id); - - out: - TALLOC_FREE(frame); - return ret; -} - /* * On unlink we need to delete the tdb record */ @@ -815,7 +756,6 @@ static struct vfs_fn_pointers vfs_xattr_tdb_fns = { .fremovexattr_fn = xattr_tdb_fremovexattr, .open_fn = xattr_tdb_open, .mkdirat_fn = xattr_tdb_mkdirat, - .unlink_fn = xattr_tdb_unlink, .unlinkat_fn = xattr_tdb_unlinkat, .rmdir_fn = xattr_tdb_rmdir, .connect_fn = xattr_tdb_connect, -- 2.47.3