<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Gulim;
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:Gulim;
        panose-1:2 11 6 0 0 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        text-autospace:none;
        word-break:break-hangul;
        font-size:10.0pt;
        font-family:"Malgun Gothic";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Malgun Gothic";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
 /* Page Definitions */
 @page Section1
        {size:612.0pt 792.0pt;
        margin:3.0cm 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=KO link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US>Hello,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I&#8217;m trying to store additional metadata
like content-type and etc at extended attribute.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>My client code are like<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>fd = glusterfs_open( path );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>glusterfs_write( fd, data, data_length );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>glusterfs_close( fd );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//------<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>glusterfs_setxattr( path, attr_name,
attr_value, value_length,0 );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>My concern is that above client code runs
on multiple machines and multi-threaded.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>In higher concurrency, client A could write
content, client B write content, client B write its attribute then client A
write its attribute.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>So to speak, file content comes from client
B but attribute comes from client A.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>If I use a lock server, I can guarantee
data integrity. But is there a simpler way to store extended attributes at an
atomic environment? <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I see another function, glusterfs_fsetxattr
which accepts open glusterfs_file descriptor. If I rewrite as following, can I
guarantee the integrity?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>fd = glusterfs_open( path );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>glusterfs_write( fd, data, data_length );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>glusterfs_fsetxattr( fd, attr_name,
attr_value, value_length,0 );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>glusterfs_close( fd );&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Thanks<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric ideograph-other;
word-break:keep-all'><b><span lang=EN-US style='font-family:Gulim'>DongMin Yu</span></b><span
lang=EN-US style='font-size:12.0pt;font-family:Gulim'><o:p></o:p></span></p>

<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric ideograph-other;
word-break:keep-all'><span lang=EN-US style='font-size:12.0pt;font-family:Gulim'>&nbsp;<o:p></o:p></span></p>

<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric ideograph-other;
word-break:keep-all'><span lang=EN-US style='font-family:Gulim'>HOSTWAY IDC
Corp. / R&amp;D Principal Researcher</span><span lang=EN-US style='font-size:
12.0pt;font-family:Gulim'><o:p></o:p></span></p>

<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric ideograph-other;
word-break:keep-all'><span lang=EN-US style='font-family:Gulim'>TEL. +822 2105
6037</span><span lang=EN-US style='font-size:12.0pt;font-family:Gulim'><o:p></o:p></span></p>

<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric ideograph-other;
word-break:keep-all'><span lang=EN-US style='font-family:Gulim'>FAX. +822 2105
6019</span><span lang=EN-US style='font-size:12.0pt;font-family:Gulim'><o:p></o:p></span></p>

<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric ideograph-other;
word-break:keep-all'><span lang=EN-US style='font-family:Gulim'>CELL. +8216
2086 1357</span><span lang=EN-US style='font-size:12.0pt;font-family:Gulim'><o:p></o:p></span></p>

<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric ideograph-other;
word-break:keep-all'><span lang=EN-US style='font-family:Gulim'>EMAIL: <a
href="mailto:min.yu@hostwaycorp.com"><span style='color:blue'>min.yu@hostwaycorp.com</span></a>
</span><span lang=EN-US style='font-size:12.0pt;font-family:Gulim'><o:p></o:p></span></p>

<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric ideograph-other;
word-break:keep-all'><span lang=EN-US style='font-family:Gulim'>Website: <a
href="http://www.hostway.com"><span style='color:blue'>http://www.hostway.com</span></a>
</span><span lang=EN-US style='font-size:12.0pt;font-family:Gulim'><o:p></o:p></span></p>

<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric ideograph-other;
word-break:keep-all'><span lang=EN-US style='font-size:12.0pt;font-family:Gulim'>&nbsp;<o:p></o:p></span></p>

<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;font-family:
"Times New Roman","serif";color:black'>NOTICE: &nbsp;This email and any file
transmitted are confidential and/or legally privileged and intended only for
the person(s) directly addressed. &nbsp;If you are not the intended recipient,
any use, copying, transmission, distribution, or other forms of dissemination
is strictly prohibited. &nbsp;If you have received this email in error, please
notify the sender immediately and permanently delete the email and files, if
any.</span></b><span lang=EN-US><o:p></o:p></span></p>

</div>

</body>

</html>