summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-handle.h
diff options
context:
space:
mode:
authorVarun Shastry <vshastry@redhat.com>2013-08-22 10:28:26 +0530
committerVarun Shastry <vshastry@redhat.com>2013-09-19 15:15:33 +0530
commitc1958d703af67ae7154c8ff8ff348c39853e6b6f (patch)
tree95348a6dc3cfaca06dc62778404c29affe3ff6d9 /xlators/storage/posix/src/posix-handle.h
parentce8fbc6f8549fe6377823252731c36d77b4fdbce (diff)
posix, quota, glusterd, dht: Modification to the pgfid xattr handling
Commit makes the following changes to the source. i. Updating hard link count for parent dir should be configurable. Starts working only when the quota is enabled. ii. Heal nlinks of pgfid xattr in lookup. iii. Start quota crawler without readdirp optimization. iv. Rename: Handle the internal fops properly. Use GLUSTERFS_INTERNAL_FOP_KEY for representing the internal fops. Change-Id: Ic6586a82a8bb6eb4329eb6cbd5430da11418e753 BUG: 969461 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Signed-off-by: Varun Shastry <vshastry@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-handle.h')
-rw-r--r--xlators/storage/posix/src/posix-handle.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix-handle.h b/xlators/storage/posix/src/posix-handle.h
index da48366e..5490d016 100644
--- a/xlators/storage/posix/src/posix-handle.h
+++ b/xlators/storage/posix/src/posix-handle.h
@@ -46,6 +46,22 @@
} \
} while (0)
+#define SET_PGFID_XATTR_IF_ABSENT(path, key, value, flags, op_ret, this, label) \
+ do { \
+ op_ret = sys_lgetxattr (path, key, &value, sizeof (value)); \
+ if (op_ret == -1) { \
+ op_errno = errno; \
+ if (op_errno == ENOATTR) { \
+ SET_PGFID_XATTR (path, key, value, flags, \
+ op_ret, this, label); \
+ } else { \
+ gf_log (this->name, GF_LOG_WARNING,"getting " \
+ "xattr failed on %s: key = %s (%s)", \
+ path, key, strerror (op_errno)); \
+ } \
+ } \
+ } while (0)
+
#define REMOVE_PGFID_XATTR(path, key, op_ret, this, label) do { \
op_ret = sys_lremovexattr (path, key); \
if (op_ret == -1) { \
@@ -72,7 +88,6 @@
} else { \
value = ntoh32 (value); \
value++; \
- value = hton32 (value); \
} \
SET_PGFID_XATTR (path, key, value, flags, op_ret, this, label); \
} while (0)
@@ -88,7 +103,6 @@
} else { \
value = ntoh32 (value); \
value--; \
- value = hton32 (value); \
if (value > 0) { \
SET_PGFID_XATTR (path, key, value, flags, op_ret, \
this, label); \