From 438032e12f3040fbb58488ca537e4d8da39b6124 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 22 Feb 2008 09:41:41 +0100 Subject: [PATCH] pvfs_unlink: move stream logic into pvfs_unlink_one() metze --- source/ntvfs/posix/pvfs_unlink.c | 42 ++++++-------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) diff --git a/source/ntvfs/posix/pvfs_unlink.c b/source/ntvfs/posix/pvfs_unlink.c index 0763a4e48..bda4014be 100644 --- a/source/ntvfs/posix/pvfs_unlink.c +++ b/source/ntvfs/posix/pvfs_unlink.c @@ -24,32 +24,6 @@ #include "system/dir.h" -/* - unlink a stream - */ -static NTSTATUS pvfs_unlink_stream(struct pvfs_state *pvfs, - struct ntvfs_request *req, - union smb_unlink *unl, - struct pvfs_filename *name) -{ - NTSTATUS status; - - /* make sure its matches the given attributes */ - status = pvfs_match_attrib(pvfs, name, - unl->unlink.in.attrib, 0); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - status = pvfs_can_delete(pvfs, req, name, NULL); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - return pvfs_stream_delete(pvfs, name, -1); -} - - /* unlink a file */ @@ -106,6 +80,14 @@ static NTSTATUS pvfs_unlink_one(struct pvfs_state *pvfs, return status; } + if (name->stream_name) { + if (!name->stream_exists) { + return NT_STATUS_OBJECT_NAME_NOT_FOUND; + } + + return pvfs_stream_delete(pvfs, name, -1); + } + return pvfs_unlink_file(pvfs, name); } @@ -141,14 +123,6 @@ NTSTATUS pvfs_unlink(struct ntvfs_module_context *ntvfs, return NT_STATUS_FILE_IS_A_DIRECTORY; } - if (name->stream_name) { - if (!name->stream_exists) { - return NT_STATUS_OBJECT_NAME_NOT_FOUND; - } - - return pvfs_unlink_stream(pvfs, req, unl, name); - } - if (!name->has_wildcard) { return pvfs_unlink_one(pvfs, req, unl, name); } -- 2.34.1