<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>I will restate the problem I am having with Lustre.  <br>
    </p>
    <p>With my I/O instrumentation library, I want to use <b><font
          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><font face="Courier New, Courier, monospace"><b>llapi_file_get
          stripe</b>() yields<br>
        lmm_stripe_count:   1<br>
        lmm_stripe_size:    1048576<br>
        lmm_pattern:        1<br>
        lmm_layout_gen:     0<br>
        lmm_stripe_offset:  12</font></p>
    <p><font face="Courier New, Courier, monospace">lmm_oi.oi_fid      
        <font color="#ff0000"><b>0x</b><b>194aa</b></font></font></p>
    <p><font face="Courier New, Courier, monospace">        <b>obdidx</b>          
        objid           objid           group<br>
                    <b>12</b>        31515860     
        0x1e0e4d4                0</font><br>
    </p>
    <p>If I use <b>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>/proc/fs/lustre/osc</b> are hexadecimal, so we
      are looking for OST000c ).</p>
    <p>%<font face="Courier New, Courier, monospace"> ls -ld
        /proc/fs/lustre/osc/*OST000c*<br>
        dr-xr-xr-x 2 root root 0 Jul 18 14:31
        /proc/fs/lustre/osc/nbp1-OST000c-osc-ffff88090509f000<br>
        dr-xr-xr-x 2 root root 0 Jul 18 14:31
        /proc/fs/lustre/osc/nbp2-OST000c-osc-ffff881038061c00<br>
        dr-xr-xr-x 2 root root 0 Jul 18 14:31
        /proc/fs/lustre/osc/nbp6-OST000c-osc-ffff88084c405400<br>
        dr-xr-xr-x 2 root root 0 Jul 18 14:31
        /proc/fs/lustre/osc/nbp7-OST000c-osc-ffff8807a8e1d400<br>
        dr-xr-xr-x 2 root root 0 Jul 18 14:31
        /proc/fs/lustre/osc/nbp8-OST000c-osc-ffff88078339b800<br>
        dr-xr-xr-x 2 root root 0 Jul 18 14:31
        /proc/fs/lustre/osc/nbp9-OST000c-osc-ffff8807833a5400</font><br>
    </p>
    <p>So I need to figure out which directory entry applies to the OST
      of my file of interest.</p>
    <p>I looked at the inode for clues.  I did an stat() of the file to
      get</p>
    <pre>dev_t     st_dev=0xcc5d43c2
ino_t     st_ino=0x2000311ed0194aa</pre>
    <p>I notice the <b>lov_user_md->oi_fid=<font color="#ff0000">0x0194aa</font>,</b> 
      populated by <b>llapi_file_get_stripe</b>(), is reflected in the
      lower part of <b>stat.st_ino=0x<font color="#3366ff">2000311ed</font><font
          color="#ff0000">0194aa</font></b>.  My question is, "Does the
      remainder of st_ino, <b><font color="#3366ff">2000311ed</font></b>,
      give me any clue as to which OST I should use out of <b>/proc/fs/lustre/osc</b>?" 
      The same question applies to the OST's objid=<font face="Courier
        New, Courier, monospace">0x1e0e4d4<font face="Helvetica, Arial,
          sans-serif"> and the file's st_dev=<font face="Courier New,
            Courier, monospace">0xcc5d43c2</font>.</font></font></p>
    <p><font face="Courier New, Courier, monospace"><font
          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
        face="Courier New, Courier, monospace">/proc/fs/lustre/osc/</font><b><font
          face="Courier New, Courier, monospace">nbp2-OST000c-osc-ffff881038061c00.</font></b><font
        face="Helvetica, Arial, sans-serif"><b>  </b>What does the <br>
        <font face="Courier New, Courier, monospace"><b>ffff881038061c00
          </b></font>represent?</font><font face="Courier New, Courier,
        monospace"><font 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><font face="Courier New,
          Courier, monospace"><br>
        </font></b></p>
    <font face="Helvetica, Arial, sans-serif"><font face="Helvetica,
        Arial, sans-serif">There are over 1200 OST on the node, so I
        want to minimize the number that I instrument.<br>
      </font>Any information that would shed some light on this would be
      greatly appreciated.  <br>
      John</font><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>