From 03a9d9dbce61ceb2506a0f193d6407c7d8f4c7e6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 4 May 2011 15:42:54 +0200 Subject: [PATCH] vfs_gpfs: Store the winattrs in st.vfs_private This avoids a considerable amount of gpfs_winattr calls (cherry picked from commit 2329fb56a701804585d866817586b4d567966b92) --- source3/modules/vfs_gpfs.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index b8bc1b239bc..e8d8bd38aeb 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -1088,6 +1088,7 @@ static int vfs_gpfs_stat(struct vfs_handle_struct *handle, if (ret == 0) { smb_fname->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec; smb_fname->st.st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec; + smb_fname->st.vfs_private = attrs.winAttrs; } return 0; } @@ -1135,6 +1136,7 @@ static int vfs_gpfs_lstat(struct vfs_handle_struct *handle, if (ret == 0) { smb_fname->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec; smb_fname->st.st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec; + smb_fname->st.vfs_private = attrs.winAttrs; } return 0; } @@ -1199,18 +1201,23 @@ static bool vfs_gpfs_is_offline(struct vfs_handle_struct *handle, struct gpfs_winattr attrs; char *path = NULL; NTSTATUS status; - int ret; status = get_full_smb_filename(talloc_tos(), fname, &path); if (!NT_STATUS_IS_OK(status)) { errno = map_errno_from_nt_status(status); return -1; } - ret = get_gpfs_winattrs(path, &attrs); - if (ret == -1) { - TALLOC_FREE(path); - return false; + if (VALID_STAT(*sbuf)) { + attrs.winAttrs = sbuf->vfs_private; + } else { + int ret; + ret = get_gpfs_winattrs(path, &attrs); + + if (ret == -1) { + TALLOC_FREE(path); + return false; + } } if ((attrs.winAttrs & GPFS_WINATTR_OFFLINE) != 0) { DEBUG(10, ("%s is offline\n", path)); -- 2.11.4.GIT