diff options
author | Volker Lendecke <vl@samba.org> | 2011-05-04 15:42:54 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-05-04 16:11:30 +0200 |
commit | 2329fb56a701804585d866817586b4d567966b92 (patch) | |
tree | 74cb99921443f3cee4f8d850257dece04a91a387 /source3 | |
parent | d08414b6799747f224ba02300585c8b15ac6bc0e (diff) | |
download | samba-2329fb56a701804585d866817586b4d567966b92.tar.gz samba-2329fb56a701804585d866817586b4d567966b92.tar.bz2 samba-2329fb56a701804585d866817586b4d567966b92.zip |
vfs_gpfs: Store the winattrs in st.vfs_private
This avoids a considerable amount of gpfs_winattr calls
Diffstat (limited to 'source3')
-rw-r--r-- | source3/modules/vfs_gpfs.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index b8bc1b239b..e8d8bd38ae 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)); |