From 55b57f48facae55f96513ba8a060881d22343645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Thu, 18 Nov 2010 17:22:31 +0100 Subject: [PATCH 3/8] s3/vfs_gpfs: map SPARSE attribute to/from WINATTRs, too --- source3/modules/vfs_gpfs.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 694bde7..ffe51c3 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -970,7 +970,7 @@ static int gpfs_set_xattr(struct vfs_handle_struct *handle, const char *path, dosmode = dosattrib.info.info3.attrib; attrs.winAttrs = 0; - /*Just map RD_ONLY, ARCHIVE, SYSTEM and HIDDEN. Ignore the others*/ + /*Just map RD_ONLY, ARCHIVE, SYSTEM HIDDEN and SPARSE. Ignore the others*/ if (dosmode & FILE_ATTRIBUTE_ARCHIVE){ attrs.winAttrs |= GPFS_WINATTR_ARCHIVE; } @@ -983,6 +983,9 @@ static int gpfs_set_xattr(struct vfs_handle_struct *handle, const char *path, if (dosmode & FILE_ATTRIBUTE_READONLY){ attrs.winAttrs |= GPFS_WINATTR_READONLY; } + if (dosmode & FILE_ATTRIBUTE_SPARSE) { + attrs.winAttrs |= GPFS_WINATTR_SPARSE_FILE; + } ret = set_gpfs_winattrs(CONST_DISCARD(char *, path), @@ -1019,7 +1022,7 @@ static ssize_t gpfs_get_xattr(struct vfs_handle_struct *handle, const char *pat DEBUG(10, ("gpfs_get_xattr:Got attributes: 0x%x\n",attrs.winAttrs)); - /*Just map RD_ONLY, ARCHIVE, SYSTEM and HIDDEN. Ignore the others*/ + /*Just map RD_ONLY, ARCHIVE, SYSTEM, HIDDEN and SPARSE. Ignore the others*/ if (attrs.winAttrs & GPFS_WINATTR_ARCHIVE){ dosmode |= FILE_ATTRIBUTE_ARCHIVE; } @@ -1032,6 +1035,9 @@ static ssize_t gpfs_get_xattr(struct vfs_handle_struct *handle, const char *pat if (attrs.winAttrs & GPFS_WINATTR_READONLY){ dosmode |= FILE_ATTRIBUTE_READONLY; } + if (attrs.winAttrs & GPFS_WINATTR_SPARSE_FILE) { + dosmode |= FILE_ATTRIBUTE_SPARSE; + } snprintf(attrstr, size, "0x%2.2x", dosmode & SAMBA_ATTRIBUTES_MASK); DEBUG(10, ("gpfs_get_xattr: returning %s\n",attrstr)); -- 1.7.3.1