<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators, branch v3.7.5</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>cluster/ec : Mark new entry changelog in entry self-heal</title>
<updated>2015-10-06T16:38:42+00:00</updated>
<author>
<name>Ashish Pandey</name>
<email>aspandey@redhat.com</email>
</author>
<published>2015-08-30T15:54:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=25e581d42e6e064718bb902d8819ed458d333a4d'/>
<id>25e581d42e6e064718bb902d8819ed458d333a4d</id>
<content type='text'>
Problem :
When a new entry is created dirty mark xattrs are not
created this will need full heal to be performed, even
when there are partial failures.

Solution :
Marks new entry changelog in self-heal.

PS: Also fixed erasing of dirty markers when no data heal
is required.

BUG: 1258313
Signed-off-by: Ashish Pandey &lt;aspandey@redhat.com&gt;
Change-Id: I156e3d3201afa77efe118e1aaace1d91c90a9613
Reviewed-on: http://review.gluster.org/12306
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem :
When a new entry is created dirty mark xattrs are not
created this will need full heal to be performed, even
when there are partial failures.

Solution :
Marks new entry changelog in self-heal.

PS: Also fixed erasing of dirty markers when no data heal
is required.

BUG: 1258313
Signed-off-by: Ashish Pandey &lt;aspandey@redhat.com&gt;
Change-Id: I156e3d3201afa77efe118e1aaace1d91c90a9613
Reviewed-on: http://review.gluster.org/12306
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>features/shard: Use the xattr rsp dict to pick shard xattrs in xattrop cbk</title>
<updated>2015-10-06T11:48:26+00:00</updated>
<author>
<name>Krutika Dhananjay</name>
<email>kdhananj@redhat.com</email>
</author>
<published>2015-10-05T10:00:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=8eaa67b98aaa02ee0a389fd28304402687d9cfa8'/>
<id>8eaa67b98aaa02ee0a389fd28304402687d9cfa8</id>
<content type='text'>
        Backport of: http://review.gluster.org/#/c/12300/

The change http://review.gluster.org/#/c/11938/ makes a fix in posix translator
which would cause sharding to fail fops post xattrop without this patch.

Change-Id: Id86b332a14b190694f5098e94bceb86e5b73e127
BUG: 1268804
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12301
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
Tested-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
        Backport of: http://review.gluster.org/#/c/12300/

The change http://review.gluster.org/#/c/11938/ makes a fix in posix translator
which would cause sharding to fail fops post xattrop without this patch.

Change-Id: Id86b332a14b190694f5098e94bceb86e5b73e127
BUG: 1268804
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12301
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
Tested-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dht/rebalance: fix mem-leak in rebalance</title>
<updated>2015-10-06T11:10:19+00:00</updated>
<author>
<name>Susant Palai</name>
<email>spalai@redhat.com</email>
</author>
<published>2015-09-28T06:22:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=0d1be89fb2b2b9ad8bbc270069baf4dd64f8f017'/>
<id>0d1be89fb2b2b9ad8bbc270069baf4dd64f8f017</id>
<content type='text'>
Change-Id: I37faf983fc02996541f3d96a17cb2a2c2cdb6781
BUG: 1261234
Reviewed-on: http://review.gluster.org/12235
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
Tested-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
Signed-off-by: Susant Palai &lt;spalai@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12296
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I37faf983fc02996541f3d96a17cb2a2c2cdb6781
BUG: 1261234
Reviewed-on: http://review.gluster.org/12235
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
Tested-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
Signed-off-by: Susant Palai &lt;spalai@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12296
</pre>
</div>
</content>
</entry>
<entry>
<title>fd: Do fd_bind on successful open</title>
<updated>2015-10-06T06:11:02+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pkarampu@redhat.com</email>
</author>
<published>2015-06-02T11:09:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=c3dd76e9da783d879258cde17680f7d8747506f8'/>
<id>c3dd76e9da783d879258cde17680f7d8747506f8</id>
<content type='text'>
- fd_unref should decrement fd-&gt;inode-&gt;fd_count only if it is present in the
inode's fd list.
- successful open/opendir should perform fd_bind.

 &gt;Change-Id: I81dd04f330e2fee86369a6dc7147af44f3d49169
 &gt;BUG: 1207735
 &gt;Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
 &gt;Reviewed-on: http://review.gluster.org/11044
 &gt;Reviewed-by: Anoop C S &lt;anoopcs@redhat.com&gt;
 &gt;Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
 &gt;Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
 &gt;Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;

BUG: 1259697
Change-Id: I73b79dd3519aa085fb84dde74b321511cbccce1a
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12100
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- fd_unref should decrement fd-&gt;inode-&gt;fd_count only if it is present in the
inode's fd list.
- successful open/opendir should perform fd_bind.

 &gt;Change-Id: I81dd04f330e2fee86369a6dc7147af44f3d49169
 &gt;BUG: 1207735
 &gt;Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
 &gt;Reviewed-on: http://review.gluster.org/11044
 &gt;Reviewed-by: Anoop C S &lt;anoopcs@redhat.com&gt;
 &gt;Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
 &gt;Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
 &gt;Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;

BUG: 1259697
Change-Id: I73b79dd3519aa085fb84dde74b321511cbccce1a
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12100
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd, dht: volume set for use-readdirp in dht</title>
<updated>2015-10-05T06:49:38+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pkarampu@redhat.com</email>
</author>
<published>2015-09-23T13:26:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=e4c5188cdfe407d9ccdecd56c65d4771f098ffa8'/>
<id>e4c5188cdfe407d9ccdecd56c65d4771f098ffa8</id>
<content type='text'>
 &gt;Change-Id: Icab246b1d02808864d878d949fa56f9f889b538a
 &gt;BUG: 1265677
 &gt;Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
 &gt;Reviewed-on: http://review.gluster.org/12221
 &gt;Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
 &gt;Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
 &gt;Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
 &gt;Reviewed-by: Raghavendra Bhat &lt;raghavendra@redhat.com&gt;
 &gt;Reviewed-by: Kaushal M &lt;kaushal@redhat.com&gt;
 &gt;(cherry picked from commit 059db0254f5670a34f1a928155c0c7d1cd03b53a)

Change-Id: Ifc46ed08fc10b32f5e814aa09c155e11e8c93138
BUG: 1267822
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12269
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 &gt;Change-Id: Icab246b1d02808864d878d949fa56f9f889b538a
 &gt;BUG: 1265677
 &gt;Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
 &gt;Reviewed-on: http://review.gluster.org/12221
 &gt;Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
 &gt;Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
 &gt;Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
 &gt;Reviewed-by: Raghavendra Bhat &lt;raghavendra@redhat.com&gt;
 &gt;Reviewed-by: Kaushal M &lt;kaushal@redhat.com&gt;
 &gt;(cherry picked from commit 059db0254f5670a34f1a928155c0c7d1cd03b53a)

Change-Id: Ifc46ed08fc10b32f5e814aa09c155e11e8c93138
BUG: 1267822
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12269
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>storage/posix: Reduce number of getxattrs for internal xattrs</title>
<updated>2015-10-05T06:49:07+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pkarampu@redhat.com</email>
</author>
<published>2015-09-28T07:39:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=eaee9b73d254fa68540aa59bfe7d28205fe78aca'/>
<id>eaee9b73d254fa68540aa59bfe7d28205fe78aca</id>
<content type='text'>
Most of the gluster internal xattrs don't exceed 256 bytes. So try
getxattr with ~256 bytes. If it gives ERANGE then go the old way
of getxattr with NULL 'buf' to find the length and then getxattr with
allocated 'buf' to fill the data. This way we reduce lot of getxattrs.

 &gt;Change-Id: I716d484bc9ba67a81d0cedb5ee3e72a5ba661f6d
 &gt;BUG: 1265893
 &gt;Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
 &gt;Reviewed-on: http://review.gluster.org/12240
 &gt;Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
 &gt;Reviewed-by: N Balachandran &lt;nbalacha@redhat.com&gt;
 &gt;Reviewed-by: Raghavendra Bhat &lt;raghavendra@redhat.com&gt;
 &gt;(cherry picked from commit 801b7bd50a51c66e327ad79cdfc131654e069cdc)

Change-Id: I96d026e6ebee0111185c1d0a33e10a6d6577fbe7
BUG: 1267823
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12270
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most of the gluster internal xattrs don't exceed 256 bytes. So try
getxattr with ~256 bytes. If it gives ERANGE then go the old way
of getxattr with NULL 'buf' to find the length and then getxattr with
allocated 'buf' to fill the data. This way we reduce lot of getxattrs.

 &gt;Change-Id: I716d484bc9ba67a81d0cedb5ee3e72a5ba661f6d
 &gt;BUG: 1265893
 &gt;Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
 &gt;Reviewed-on: http://review.gluster.org/12240
 &gt;Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
 &gt;Reviewed-by: N Balachandran &lt;nbalacha@redhat.com&gt;
 &gt;Reviewed-by: Raghavendra Bhat &lt;raghavendra@redhat.com&gt;
 &gt;(cherry picked from commit 801b7bd50a51c66e327ad79cdfc131654e069cdc)

Change-Id: I96d026e6ebee0111185c1d0a33e10a6d6577fbe7
BUG: 1267823
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12270
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>storage/posix: Prevent extra handle-path</title>
<updated>2015-10-01T09:27:24+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pkarampu@redhat.com</email>
</author>
<published>2015-09-23T16:11:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=e31eebf0a4026db32c9793563a0ac3815082cddd'/>
<id>e31eebf0a4026db32c9793563a0ac3815082cddd</id>
<content type='text'>
In readdirp_fill we already have the path of the file/directory.
No need to construct handle-path again. This saves two lstats and
at least two readlink calls per directory.

 &gt;Change-Id: I8d1b2afeda3e053265a243d4e9a101192f5f509e
 &gt;BUG: 1265893
 &gt;Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
 &gt;Reviewed-on: http://review.gluster.org/12222
 &gt;Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
 &gt;Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
 &gt;Reviewed-by: Raghavendra Bhat &lt;raghavendra@redhat.com&gt;
 &gt;(cherry picked from commit 7f33579e8a42eb19e92559a6c3acaeb92b6bb184)

Change-Id: I6e0654256e09551ed4763aea4c24e17a2039c405
BUG: 1267149
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12249
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Raghavendra Bhat &lt;raghavendra@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In readdirp_fill we already have the path of the file/directory.
No need to construct handle-path again. This saves two lstats and
at least two readlink calls per directory.

 &gt;Change-Id: I8d1b2afeda3e053265a243d4e9a101192f5f509e
 &gt;BUG: 1265893
 &gt;Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
 &gt;Reviewed-on: http://review.gluster.org/12222
 &gt;Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
 &gt;Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
 &gt;Reviewed-by: Raghavendra Bhat &lt;raghavendra@redhat.com&gt;
 &gt;(cherry picked from commit 7f33579e8a42eb19e92559a6c3acaeb92b6bb184)

Change-Id: I6e0654256e09551ed4763aea4c24e17a2039c405
BUG: 1267149
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12249
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Raghavendra Bhat &lt;raghavendra@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>features/shard: Port log messages to new framework</title>
<updated>2015-09-30T06:04:36+00:00</updated>
<author>
<name>Krutika Dhananjay</name>
<email>kdhananj@redhat.com</email>
</author>
<published>2015-09-21T11:27:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=3d74cb6e906288154cdb2001dc430734459a029e'/>
<id>3d74cb6e906288154cdb2001dc430734459a029e</id>
<content type='text'>
        Backport of: http://review.gluster.org/12217

Change-Id: I129ff0d6d1cab15078fa474132c290950f5e1137
BUG: 1266822
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12236
Reviewed-by: Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
        Backport of: http://review.gluster.org/12217

Change-Id: I129ff0d6d1cab15078fa474132c290950f5e1137
BUG: 1266822
Signed-off-by: Krutika Dhananjay &lt;kdhananj@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12236
Reviewed-by: Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cluster/dht : FOP handling during file migration</title>
<updated>2015-09-29T05:37:11+00:00</updated>
<author>
<name>N Balachandran</name>
<email>nbalacha@redhat.com</email>
</author>
<published>2015-09-28T10:04:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=50bf70fe5a538cbcffef058126a4d25155c19bf4'/>
<id>50bf70fe5a538cbcffef058126a4d25155c19bf4</id>
<content type='text'>
An earlier patch introduced a bug in the FOP migration
code. Fixed the issue.

Change-Id: Ib7d8d3f54ddd455b7f53b0b2e3a82a9e942ba1f9
BUG: 1266872
Signed-off-by: N Balachandran &lt;nbalacha@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12238
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An earlier patch introduced a bug in the FOP migration
code. Fixed the issue.

Change-Id: Ib7d8d3f54ddd455b7f53b0b2e3a82a9e942ba1f9
BUG: 1266872
Signed-off-by: N Balachandran &lt;nbalacha@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12238
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>posix: xattrop 'GF_XATTROP_ADD_ARRAY_WITH_DEFAULT' implementation</title>
<updated>2015-09-29T05:35:19+00:00</updated>
<author>
<name>vmallika</name>
<email>vmallika@redhat.com</email>
</author>
<published>2015-09-28T11:22:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=9d31a55b7c4c4e1aeedfdc74eadbf36902f7bcd9'/>
<id>9d31a55b7c4c4e1aeedfdc74eadbf36902f7bcd9</id>
<content type='text'>
This is a backport of http://review.gluster.org/#/c/11702

Implementation of xattrop type:
GF_XATTROP_ADD_ARRAY_WITH_DEFAULT
GF_XATTROP_ADD_ARRAY64_WITH_DEFAULT

These operations are similar to 'GF_XATTROP_ADD_ARRAY',
except that it adds a default value if xattr is missing
or its value is zero on disk.

One use-case of this operation is in inode-quota.
When a new directory is created, its default dir_count
should be set to 1. So when a xattrop performed setting
inode-xattrs, it should account initial dir_count
1 if the xattrs are not present

Here is the usage of this operation

value required in xdata for each key
struct array {
    int32_t   newvalue_1;
    int32_t   newvalue_2;
    ...
    int32_t   newvalue_n;
    int32_t   default_1;
    int32_t   default_2;
    ...
    int32_t   default_n;
};

or

struct array {
    int32_t   value_1;
    int32_t   value_2;
    ...
    int32_t   value_n;
} data[2];
fill data[0] with new value to add
fill data[1] with default value

xattrop GF_XATTROP_ADD_ARRAY_WITH_DEFAULT
for i from 1 to n
{
    if (xattr (dest_i) is zero or not set in the disk)
        dest_i = newvalue_i + default_i
    else
        dest_i = dest_i + newvalue_i
}

value in xdata after xattrop is successful
struct array {
    int32_t   dest_1;
    int32_t   dest_2;
    ...
    int32_t   dest_n;
};

&gt; Change-Id: Ic6a08473e99fd98299a839d4d8416081a7534efd
&gt; BUG: 1243946
&gt; Signed-off-by: vmallika &lt;vmallika@redhat.com&gt;
&gt; Reviewed-on: http://review.gluster.org/11702
&gt; Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;

Change-Id: Ie0c8285d9d582afbc808b0fd878f6c02957ff928
BUG: 1266882
Signed-off-by: vmallika &lt;vmallika@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12241
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a backport of http://review.gluster.org/#/c/11702

Implementation of xattrop type:
GF_XATTROP_ADD_ARRAY_WITH_DEFAULT
GF_XATTROP_ADD_ARRAY64_WITH_DEFAULT

These operations are similar to 'GF_XATTROP_ADD_ARRAY',
except that it adds a default value if xattr is missing
or its value is zero on disk.

One use-case of this operation is in inode-quota.
When a new directory is created, its default dir_count
should be set to 1. So when a xattrop performed setting
inode-xattrs, it should account initial dir_count
1 if the xattrs are not present

Here is the usage of this operation

value required in xdata for each key
struct array {
    int32_t   newvalue_1;
    int32_t   newvalue_2;
    ...
    int32_t   newvalue_n;
    int32_t   default_1;
    int32_t   default_2;
    ...
    int32_t   default_n;
};

or

struct array {
    int32_t   value_1;
    int32_t   value_2;
    ...
    int32_t   value_n;
} data[2];
fill data[0] with new value to add
fill data[1] with default value

xattrop GF_XATTROP_ADD_ARRAY_WITH_DEFAULT
for i from 1 to n
{
    if (xattr (dest_i) is zero or not set in the disk)
        dest_i = newvalue_i + default_i
    else
        dest_i = dest_i + newvalue_i
}

value in xdata after xattrop is successful
struct array {
    int32_t   dest_1;
    int32_t   dest_2;
    ...
    int32_t   dest_n;
};

&gt; Change-Id: Ic6a08473e99fd98299a839d4d8416081a7534efd
&gt; BUG: 1243946
&gt; Signed-off-by: vmallika &lt;vmallika@redhat.com&gt;
&gt; Reviewed-on: http://review.gluster.org/11702
&gt; Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
&gt; Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;

Change-Id: Ie0c8285d9d582afbc808b0fd878f6c02957ff928
BUG: 1266882
Signed-off-by: vmallika &lt;vmallika@redhat.com&gt;
Reviewed-on: http://review.gluster.org/12241
Tested-by: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
Reviewed-by: Raghavendra G &lt;rgowdapp@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
