From 3756467db6a661be91f4aeb484000e993e4a9a4c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 12:18:33 +0100 Subject: Move the posix pending close functionality down into the VFS layer. This hides the pending close fds from the outside. Call order of SMB_VFS_CLOSE is reversed. Originally, it was: fd_close -> fd_close_posix -> SMB_VFS_CLOSE -> close And now it is: fd_close -> SMB_VFS_CLOSE -> fd_close_posix -> close This is in preparation of removing the fd parameter from the SMB_VFS_CLOSE function. But it is also the right place for the pending close calls anyways. Michael (This used to be commit 3cf56b124a2886c6260455bba4bf77d08e9a4f77) --- source3/modules/vfs_default.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/modules/vfs_default.c') diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 31ebb6352a..9887b309f9 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -210,13 +210,13 @@ static int vfswrap_open(vfs_handle_struct *handle, const char *fname, static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp, int fd) { - int result; + NTSTATUS result; START_PROFILE(syscall_close); - - result = close(fd); + result = fd_close_posix(fsp); END_PROFILE(syscall_close); - return result; + + return NT_STATUS_IS_OK(result) ? 0 : -1; } static ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n) -- cgit From 2f8dde9ec8110557c23df6ea66913a7d39425415 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 13:28:28 +0100 Subject: Change fd_close_posix() to return int instead of NTSTATUS. The errno is handed up through the VFS layer to the callers. Michael (This used to be commit d928e6648d61cf2d3c1b77db440efb835b729a84) --- source3/modules/vfs_default.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/modules/vfs_default.c') diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 9887b309f9..a03f4dcef9 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -210,13 +210,12 @@ static int vfswrap_open(vfs_handle_struct *handle, const char *fname, static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp, int fd) { - NTSTATUS result; + int result; START_PROFILE(syscall_close); result = fd_close_posix(fsp); END_PROFILE(syscall_close); - - return NT_STATUS_IS_OK(result) ? 0 : -1; + return result; } static ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n) -- cgit From 0db7aba8af80a01150d1061a4192ab814e4234b7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 14:19:28 +0100 Subject: Remove redundant parameter fd from SMB_VFS_CLOSE(). Now all those redundant fd's have vanished from the VFS API. Michael (This used to be commit 14294535512a7f191c5008e622b6708e417854ae) --- source3/modules/vfs_default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/modules/vfs_default.c') diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index a03f4dcef9..de801a2041 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -208,7 +208,7 @@ static int vfswrap_open(vfs_handle_struct *handle, const char *fname, return result; } -static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp, int fd) +static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp) { int result; -- cgit