<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 1, 2017 at 10:57 PM, Gandalf Corvotempesta <span dir="ltr"><<a href="mailto:gandalf.corvotempesta@gmail.com" target="_blank">gandalf.corvotempesta@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">2017-05-01 19:12 GMT+02:00 Pranith Kumar Karampuri <<a href="mailto:pkarampu@redhat.com">pkarampu@redhat.com</a>>:<br>
> I agree it should. Question is how? What will be the resulting brick-map?<br>
<br>
</span>This is why i'm suggesting to add a file mapping somewhere.<br>
You could also use xattr for this:<br>
<br>
"file1" is mapped to GFID, then, as xattr for that GFID, you could<br>
save the server/brick location, it this<br>
way you always know where a file is.<br></blockquote><div><br></div><div>To know GFID of file1 you must know where the file resides so that you can do getxattr trusted.gfid on the file. So storing server/brick location on gfid is not getting us much more information that what we already have.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
To keep it simple for non-developers like me (this is wrong, it's a<br>
simplification):<br>
"/tmp/file1" hashes to 306040e474f199e7969ec266afd10d<wbr>93<br>
<br>
hash starts with "3" thus is located on brick3<br>
<br>
You don't need any metadata for this, the hash algoritm is the only<br>
thing you need.<br>
<br>
But if you store the file location mapping somewhere (in example as<br>
xattr for the GFID file) you can look for the file without using the<br>
hash algoritm location.<br>
<br>
ORIG_FILE="/tmp/file1"<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
GFID="<wbr>306040e474f199e7969ec266afd10d<wbr>93" <<---- How did we get GFID?<br></blockquote><div><br></div><div>May be I didn't understand your solution properly.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
FILE_LOCATION=$(getfattr -n "file_location" $GFID)<br>
<br>
if $FILE_LOCATION<br>
read from $FILE_LOCATION<br>
else<br>
read from original algoritm<br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Pranith<br></div></div>
</div></div>