<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Robert</p>
    <p>Excellent. It works like a champ, after changing llapi_get_name()
      to llapi_getname().<br>
    </p>
    <p>Thanks much.  If we meet up at a conference some day, I owe you
      dinner.<br>
    </p>
    <p>John<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 7/18/2016 6:13 PM, Read, Robert
      wrote:<br>
    </div>
    <blockquote
      cite="mid:F00920AB-3E49-4780-89DC-191843D3063B@intel.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      Hi John,
      <div class=""><br class="">
      </div>
      <div class="">The initial string in the OSC name is the filesystem
        name and the long hexadecimal number at the end is the client
        ID. The client ID is specific to the mount point that “owns” the
        OSC, and typically changes each time the filesystem is mounted.
        It is there to differentiate devices  when the same filesystem
        is mounted multiple times. </div>
      <div class=""><br class="">
      </div>
      <div class="">You can retrieve both of the values by passing the
        mount directory to llapi_get_name(). This function returns a
        string with filesystem name and client ID in the format
        “FSNAME-ID". You can split the string on the ‘-‘ to extract
        those values, and then use them construct the right name for the
        current OSC being used for that file on that particular
        mountpoint.</div>
      <div class=""><br class="">
      </div>
      <div class="">Note, like the client ID, the OSC name is specific
        to that mount point. The actual OST name is just
        FSNAME-OST####. </div>
      <div class=""><br class="">
      </div>
      <div class="">robert</div>
      <div class=""><br class="">
        <div class="">
          <div>
            <blockquote type="cite" class="">
              <div class="">On Jul 18, 2016, at 15:22 , John Bauer <<a
                  moz-do-not-send="true"
                  href="mailto:bauerj@iodoctors.com" class="">bauerj@iodoctors.com</a>>
                wrote:</div>
              <br class="Apple-interchange-newline">
              <div class="">
                <div bgcolor="#FFFFFF" text="#000000" class="">
                  <p class="">I will restate the problem I am having
                    with Lustre.  <br class="">
                  </p>
                  <p class="">With my I/O instrumentation library, I
                    want to use <b class=""><font class=""
                        face="Courier New, Courier, monospace">llapi_file_get_stripe</font></b>()
                    to find the OSTs that a file of interest is striped
                    on and then monitor only those OST's using files in
                    the directory /proc/fs/lustre/osc.  This needs to be
                    done programmatically, and in a general sense, with
                    potentially only a relative path name.</p>
                  <p class=""><font class="" face="Courier New, Courier,
                      monospace"><b class="">llapi_file_get stripe</b>()
                      yields<br class="">
                      lmm_stripe_count:   1<br class="">
                      lmm_stripe_size:    1048576<br class="">
                      lmm_pattern:        1<br class="">
                      lmm_layout_gen:     0<br class="">
                      lmm_stripe_offset:  12</font></p>
                  <p class=""><font class="" face="Courier New, Courier,
                      monospace">lmm_oi.oi_fid      
                      <font class="" color="#ff0000"><b class="">0x</b><b
                          class="">194aa</b></font></font></p>
                  <p class=""><font class="" face="Courier New, Courier,
                      monospace">        <b class="">
                        obdidx</b>           objid          
                      objid           group<br class="">
                                  <b class="">12</b>       
                      31515860      0x1e0e4d4                0</font><br
                      class="">
                  </p>
                  <p class="">If I use <b class="">obdidx=12=0xc </b>to
                    find the OST in directory /proc/fs/lustre/osc, I get
                    multiple OSTs as there are multiple file systems
                    with an ost of index 12 ( note that obdidx is
                    decimal and entries in
                    <b class="">/proc/fs/lustre/osc</b> are hexadecimal,
                    so we are looking for OST000c ).</p>
                  <p class="">%<font class="" face="Courier New,
                      Courier, monospace"> ls -ld
                      /proc/fs/lustre/osc/*OST000c*<br class="">
                      dr-xr-xr-x 2 root root 0 Jul 18 14:31
                      /proc/fs/lustre/osc/nbp1-OST000c-osc-ffff88090509f000<br
                        class="">
                      dr-xr-xr-x 2 root root 0 Jul 18 14:31
                      /proc/fs/lustre/osc/nbp2-OST000c-osc-ffff881038061c00<br
                        class="">
                      dr-xr-xr-x 2 root root 0 Jul 18 14:31
                      /proc/fs/lustre/osc/nbp6-OST000c-osc-ffff88084c405400<br
                        class="">
                      dr-xr-xr-x 2 root root 0 Jul 18 14:31
                      /proc/fs/lustre/osc/nbp7-OST000c-osc-ffff8807a8e1d400<br
                        class="">
                      dr-xr-xr-x 2 root root 0 Jul 18 14:31
                      /proc/fs/lustre/osc/nbp8-OST000c-osc-ffff88078339b800<br
                        class="">
                      dr-xr-xr-x 2 root root 0 Jul 18 14:31
                      /proc/fs/lustre/osc/nbp9-OST000c-osc-ffff8807833a5400</font><br
                      class="">
                  </p>
                  <p class="">So I need to figure out which directory
                    entry applies to the OST of my file of interest.</p>
                  <p class="">I looked at the inode for clues.  I did an
                    stat() of the file to get</p>
                  <pre class="">dev_t     st_dev=0xcc5d43c2
ino_t     st_ino=0x2000311ed0194aa</pre>
                  <p class="">I notice the <b class="">lov_user_md->oi_fid=<font
                        class="" color="#ff0000">0x0194aa</font>,</b> 
                    populated by
                    <b class="">llapi_file_get_stripe</b>(), is
                    reflected in the lower part of <b class="">
                      <a moz-do-not-send="true" href="http://stat.st"
                        class="">stat.st</a>_ino=0x<font class=""
                        color="#3366ff">2000311ed</font><font class=""
                        color="#ff0000">0194aa</font></b>.  My question
                    is, "Does the remainder of st_ino,
                    <b class=""><font class="" color="#3366ff">2000311ed</font></b>,
                    give me any clue as to which OST I should use out of
                    <b class="">/proc/fs/lustre/osc</b>?"  The same
                    question applies to the OST's objid=<font class=""
                      face="Courier New, Courier, monospace">0x1e0e4d4<font
                        class="" face="Helvetica, Arial, sans-serif">
                        and the file's st_dev=<font class=""
                          face="Courier New, Courier, monospace">0xcc5d43c2</font>.</font></font></p>
                  <p class=""><font class="" face="Courier New, Courier,
                      monospace"><font class="" face="Helvetica, Arial,
                        sans-serif">Because I know a priori that the
                        file is in the lov nbp2, I know I need to find
                      </font></font><font class="" face="Courier New,
                      Courier, monospace">/proc/fs/lustre/osc/</font><b
                      class=""><font class="" face="Courier New,
                        Courier, monospace">nbp2-OST000c-osc-ffff881038061c00.</font></b><font
                      class="" face="Helvetica, Arial, sans-serif"><b
                        class=""> 
                      </b>What does the <br class="">
                      <font class="" face="Courier New, Courier,
                        monospace"><b class="">ffff881038061c00
                        </b></font>represent?</font><font class=""
                      face="Courier New, Courier, monospace"><font
                        class="" face="Helvetica, Arial, sans-serif"> 
                        It is the same value for all OST's in a given
                        lov, so I am guessing it is lov related.</font></font><b
                      class=""><font class="" face="Courier New,
                        Courier, monospace"><br class="">
                      </font></b></p>
                  <font class="" face="Helvetica, Arial, sans-serif"><font
                      class="" face="Helvetica, Arial, sans-serif">There
                      are over 1200 OST on the node, so I want to
                      minimize the number that I instrument.<br class="">
                    </font>Any information that would shed some light on
                    this would be greatly appreciated. 
                    <br class="">
                    John</font><br class="">
                  <pre class="moz-signature" cols="72">-- 
I/O Doctors, LLC
507-766-0378
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:bauerj@iodoctors.com">bauerj@iodoctors.com</a></pre>
                </div>
                _______________________________________________<br
                  class="">
                lustre-discuss mailing list<br class="">
                <a moz-do-not-send="true"
                  href="mailto:lustre-discuss@lists.lustre.org" class="">lustre-discuss@lists.lustre.org</a><br
                  class="">
<a class="moz-txt-link-freetext" href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br
                  class="">
              </div>
            </blockquote>
          </div>
          <br class="">
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
I/O Doctors, LLC
507-766-0378
<a class="moz-txt-link-abbreviated" href="mailto:bauerj@iodoctors.com">bauerj@iodoctors.com</a></pre>
  </body>
</html>