http://wiki.old.lustre.org/index.php?title=Architecture_-_Metadata_API&feed=atom&action=history
Architecture - Metadata API - Revision history
2024-03-29T05:22:33Z
Revision history for this page on the wiki
MediaWiki 1.35.5
http://wiki.old.lustre.org/index.php?title=Architecture_-_Metadata_API&diff=10593&oldid=prev
Docadmin at 21:16, 22 January 2010
2010-01-22T21:16:37Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 21:16, 22 January 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>'''''Note:''''' The content on this page reflects the state of design of a Lustre feature at a particular point in time and may contain outdated information. </div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>'''''Note:<ins class="diffchange diffchange-inline">''</ins>''' ''The content on this page reflects the state of design of a Lustre feature at a particular point in time and may contain outdated information.<ins class="diffchange diffchange-inline">'' </ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Summary ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Summary ==</div></td></tr>
</table>
Docadmin
http://wiki.old.lustre.org/index.php?title=Architecture_-_Metadata_API&diff=10519&oldid=prev
Docadmin: Protected "Architecture - Metadata API" ([edit=sysop] (indefinite) [move=sysop] (indefinite))
2010-01-22T18:05:44Z
<p>Protected "<a href="/index.php?title=Architecture_-_Metadata_API" title="Architecture - Metadata API">Architecture - Metadata API</a>" ([edit=sysop] (indefinite) [move=sysop] (indefinite))</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:05, 22 January 2010</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
Docadmin
http://wiki.old.lustre.org/index.php?title=Architecture_-_Metadata_API&diff=10193&oldid=prev
Docadmin: /* final lookup */
2010-01-19T18:48:43Z
<p><span dir="auto"><span class="autocomment">final lookup</span></span></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:48, 19 January 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l377" >Line 377:</td>
<td colspan="2" class="diff-lineno">Line 377:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== final lookup ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== final lookup ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[Architecture - New_Metadata_API|<del class="diffchange diffchange-inline">New_Metadata_API</del>]]</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Architecture - New_Metadata_API|<ins class="diffchange diffchange-inline">New Metadata API</ins>]]</div></td></tr>
</table>
Docadmin
http://wiki.old.lustre.org/index.php?title=Architecture_-_Metadata_API&diff=10140&oldid=prev
Docadmin at 00:01, 19 January 2010
2010-01-19T00:01:53Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 00:01, 19 January 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">'''''Note:''''' The content on this page reflects the state of design of a Lustre feature at a particular point in time and may contain outdated information. </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Summary ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Summary ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Docadmin
http://wiki.old.lustre.org/index.php?title=Architecture_-_Metadata_API&diff=9926&oldid=prev
Docadmin: /* final lookup */
2010-01-14T23:24:38Z
<p><span dir="auto"><span class="autocomment">final lookup</span></span></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 23:24, 14 January 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l375" >Line 375:</td>
<td colspan="2" class="diff-lineno">Line 375:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== final lookup ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== final lookup ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Architecture <ins class="diffchange diffchange-inline">- New_Metadata_API</ins>|New_Metadata_API]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[<del class="diffchange diffchange-inline">Category:</del>Architecture|<del class="diffchange diffchange-inline">Metadata API]]</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">[[</del>New_Metadata_API]]</div></td><td colspan="2"> </td></tr>
</table>
Docadmin
http://wiki.old.lustre.org/index.php?title=Architecture_-_Metadata_API&diff=9874&oldid=prev
Docadmin: moved Metadata API to Architecture - Metadata API
2010-01-14T21:54:46Z
<p>moved <a href="/index.php?title=Metadata_API&action=edit&redlink=1" class="new" title="Metadata API (page does not exist)">Metadata API</a> to <a href="/index.php?title=Architecture_-_Metadata_API" title="Architecture - Metadata API">Architecture - Metadata API</a></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 21:54, 14 January 2010</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
Docadmin
http://wiki.old.lustre.org/index.php?title=Architecture_-_Metadata_API&diff=9814&oldid=prev
Docadmin: 1 revision
2010-01-14T21:01:10Z
<p>1 revision</p>
<p><b>New page</b></p><div>== Summary ==<br />
<br />
Metadata API is a set of methods llite layer uses to access and manipulate metadata. This page starts from describing existing API. As time goes MdAPI should evolve to become clear and sufficiently portable. <br />
<br />
== Definitions ==<br />
<br />
; '''Lock''': LDLM lock<br />
; '''resolving''': a triple of parent/name pointing to child<br />
<br />
<br />
== Requirements ==<br />
<br />
# clear and sufficient (no tricks needed to use it)<br />
# portable<br />
<br />
== Cache Model ==<br />
<br />
Current implementation supposes four types of cache:<br />
# resolving (dentry in linux)<br />
# attributes (inode in linux)<br />
# directory (pagecache to store directory entries in linux)<br />
# open files<br />
<br />
All of them expect open files are maintained by the kernel with help from filesystem driver (llite module of lustre).<br />
<br />
All these caches are protected by DLM locks. A special type of lock - inode bitlock - was introduced. Each lock may have 3 bits:<br />
# LOOKUP - protects all resolvings to given object (all because of hardlinks) + permissions<br />
# UPDATE - protects all metadata attributes except permissions<br />
# OPEN - allows client to cache open state of a file<br />
<br />
Depending on actual operation client combines bits to access data. For example,<br />
to do intermediate lookup where we only need to make sure the component still exists and permissions haven't changed, LOOKUP bit is required. Once resolving of intermediate component is cached, client doesn't need to lookup it on server again. And given operations within directory don't need LOOKUP bit, client's resolving is still in cache even if another client create/unlink file in that directory.<br />
<br />
== Intents ==<br />
<br />
Intents is a mechanism to save RPCs which is the most expensive part of metadata handling due to network latency.<br />
<br />
Let's imagine open("file", O_CREAT). Linux VFS breaks this request into series of calls to filesystem driver:<br />
# '''lookup''' to find '''file''' if it exists<br />
# if '''file''' doesn't exist, then '''create''' is called<br />
# then '''open''' is called<br />
<br />
Thus, 2 or 3 RPCs could be needed, if we follow usual model. Instead, we send lookup RPC with a special structure called '''intent''' which describes real intent of the operation, MDS does all required work, then '''create''' and '''open''' use results returned to the first operation.<br />
<br />
In reality any operation starts with locking, so usually it's ENQUEUE RPC which carries intent.<br />
<br />
There are few intents defined currently:<br />
<br />
{| cellspacing="0" border="1"<br />
! intent !! purpose !! details<br />
|-<br />
| IT_OPEN<br />
| open file/directory<br />
| may return LOOKUP + OPEN lock<br />
|-<br />
| IT_CREAT<br />
| create file<br />
| used with IT_OPEN, may return LOOKUP + OPEN lock<br />
|-<br />
| IT_READDIR<br />
| readdir<br />
| used to access/cache directories, may return LOOKUP + UPDATE lock<br />
|-<br />
| IT_GETATTR<br />
| lookup/getattr<br />
| used to lookup and get attr (final lookup), may return LOOKUP + UPDATE lock<br />
|-<br />
| IT_LOOKUP<br />
| lookup<br />
| used for intermediate lookups, may return LOOKUP lock<br />
|-<br />
| IT_UNLINK<br />
| unused<br />
| --<br />
|-<br />
| IT_TRUNC<br />
| unused<br />
| --<br />
|-<br />
| IT_GETXATTR<br />
| unused<br />
| --<br />
|}<br />
<br />
== Recovery ==<br />
<br />
== Use Cases ==<br />
<br />
{| cellspacing="0" border="1"<br />
! ID !! Quality Attribute !! Summary<br />
|-<br />
| intermediate lookup<br />
| usability<br />
| lookup of intermediate component of filename<br />
|-<br />
| final lookup<br />
| usability<br />
| lookup of final component of filename<br />
|-<br />
| cached lookup<br />
| performance<br />
| how can user check resolving is still valid<br />
|-<br />
| resolving invalidate<br />
| usability<br />
| how to invalidate cached resolving<br />
|-<br />
| cached negative resolving<br />
| performance<br />
| how can user check name still does not exist<br />
|-<br />
| negative resolving invalidate<br />
| usability<br />
| how can user check name is created now<br />
|-<br />
| mkdir<br />
| usability<br />
| creating of new directory<br />
|-<br />
| rmdir<br />
| usability<br />
| directory removal<br />
|-<br />
| link<br />
| usability<br />
|<br />
|-<br />
| unlink<br />
| usability<br />
|<br />
|-<br />
| unlink open file<br />
| usability, availability<br />
| file should be protected from removal until it's closed<br />
|-<br />
| rename<br />
| usability<br />
|<br />
|-<br />
| stat<br />
| usability<br />
|<br />
|-<br />
| cached stat<br />
| performance<br />
|<br />
|-<br />
| stat invalidate<br />
| usability<br />
|<br />
|-<br />
| readdir<br />
| usability<br />
|<br />
|-<br />
| cached readdir<br />
| performance<br />
|<br />
|-<br />
| readdir invalidate<br />
| usability<br />
|<br />
|-<br />
| open<br />
| usability<br />
|<br />
|-<br />
| cached open<br />
| performance<br />
|<br />
|-<br />
| open invalidate<br />
| usability<br />
|<br />
|-<br />
| close<br />
| usability<br />
|<br />
|-<br />
| open recovery<br />
| availability<br />
| during MDS failover, clients recover opens to provide posix semantics of unlink<br />
|-<br />
| open by fid<br />
| availability<br />
| used by nfsd<br />
|-<br />
| lockless<br />
| usability<br />
| in some cases results can return with no lock<br />
|}<br />
<br />
== Existing MdAPI ==<br />
<br />
=== Data Structures ===<br />
<br />
struct lustre_intent_data {<br />
int it_disposition;<br />
int it_status;<br />
__u64 it_lock_handle;<br />
void *it_data;<br />
int it_lock_mode;<br />
};<br />
<br />
struct lookup_intent {<br />
int it_op;<br />
int it_flags; <br />
int it_create_mode;<br />
union {<br />
struct lustre_intent_data lustre;<br />
} d;<br />
};<br />
<br />
struct mdc_op_data {<br />
struct ll_fid fid1;<br />
struct ll_fid fid2;<br />
struct ll_fid fid3;<br />
struct ll_fid fid4;<br />
__u64 mod_time;<br />
const char *name;<br />
int namelen;<br />
__u32 create_mode;<br />
__u32 suppgids[2];<br />
void *data;<br />
};<br />
<br />
struct lustre_md {<br />
struct mds_body *body;<br />
struct lov_stripe_md *lsm;<br />
#ifdef CONFIG_FS_POSIX_ACL<br />
struct posix_acl *posix_acl;<br />
#endif<br />
};<br />
<br />
=== mdc_intent_lock ===<br />
<br />
int mdc_intent_lock(struct obd_export *exp, struct mdc_op_data *op_data,<br />
void *lmm, int lmmsize, struct lookup_intent *it,<br />
int lookup_flags, struct ptlrpc_request **reqp,<br />
ldlm_blocking_callback cb_blocking, int extra_lock_flags)<br />
<br />
; '''exp''': export for the connection to MDS<br />
; '''op_data''': fids/name/etc - operation args<br />
; '''lmm''': buffer to store striping info<br />
; '''lmmsize''': available space in lmm buffer<br />
; '''it''': intent<br />
; '''lookup_flags''': unused currently<br />
; '''reqp''': where to store address of request (to be used to access server's reply)<br />
; '''cb_blocking''': callback routine, called when correspondent lock is being cacelled - to invalidate cache<br />
; '''extra_flags''': extra flags to be passed LDLM<br />
<br />
mdc_intent_lock() is the major entry point for many metadata operations. as it was described above, some metadata operations are implemented with intents. if we didn't have intents, then operation could look like the following:<br />
<br />
lock(dir);<br />
lookup(dir, name);<br />
unlock(dir);<br />
<br />
with intents (and currently) it looks this way:<br />
<br />
lock(dir, intent, reply);<br />
find lookup result in reply;<br />
<br />
mdc_intent_lock() is that lock() in pseudo-code.<br />
<br />
mdc_intent_lock() is used to lookup name, retrieve attributes, create regular files and open files/directories. it usually returns DLM lock for result object. actual bits of the lock may depend on intent and server's policy. if mdc_intent_lock() returns with a lock, then data in reply is subject to cache.<br />
<br />
=== mdc_set_lock_data ===<br />
<br />
void mdc_set_lock_data(__u64 *l, void *data)<br />
<br />
; '''l''': lock handle<br />
; '''data''': data to be stored in lock's private field<br />
<br />
the function is used to associate lock with some cache entity so that at time lock is being cancelled we can find that entity easily<br />
<br />
=== mdc_readpage ===<br />
<br />
int mdc_readpage(struct obd_export *exp, struct ll_fid *fid, __u64 offset,<br />
struct page *page, struct ptlrpc_request **request)<br />
<br />
; '''exp''': export for connection to MDS<br />
; '''fid''': fid of the directory to be read<br />
; '''offset''': where to start reading from<br />
; '''page''': where to store result ('''LINUX-SPECIFIC YET''')<br />
; '''request''': request where newer attributes of the directory can be fetched from<br />
<br />
=== mdc_setattr ===<br />
<br />
int mdc_setattr(struct obd_export *exp, struct mdc_op_data *op_data,<br />
struct iattr *iattr, void *ea, int ealen, void *ea2, int ea2len,<br />
struct ptlrpc_request **request)<br />
<br />
; '''exp''': connection to MDS<br />
; '''op_data''': operation arguments<br />
; '''iattr''': new attributes (platform specific yet)<br />
; '''ea''': striping info buffer<br />
; '''ealen''': striping info buffer length<br />
; '''ea2''': currently unused<br />
; '''ea2len''': currently unused<br />
; '''request''': where address of request will be stored<br />
<br />
mdc_setattr() sends sync RPC to MDS to change attributes. it does not return any lock, so attributes in reply isn't subject to cache.<br />
<br />
=== mdc_getattr ===<br />
<br />
int mdc_getattr(struct obd_export *exp, struct ll_fid *fid,<br />
obd_valid valid, unsigned int ea_size,<br />
struct ptlrpc_request **request)<br />
<br />
; '''exp''': connection to MDS<br />
; '''fid''': object of interest<br />
; '''valid''': attributes of interest<br />
; '''ea_size''': how many bytes of striping info client can store<br />
; '''reuqest''': where address of request will be stored (to access reply)<br />
<br />
mdc_getattr() sends synchronous RPC to MDS. it never returns lock.<br />
<br />
=== mdc_close ===<br />
<br />
int mdc_close(struct obd_export *exp, struct obdo *oa,<br />
struct obd_client_handle *och, struct ptlrpc_request **request)<br />
<br />
; '''exp''': export for connection to MDS<br />
; '''oa''': <br />
; '''och''': openhandle returned by mdc_intent_lock() at open time<br />
; '''request''': where address of request will be stored (to access reply)<br />
<br />
=== mdc_link ===<br />
<br />
int mdc_link(struct obd_export *exp, struct mdc_op_data *op_data,<br />
struct ptlrpc_request **request)<br />
<br />
=== mdc_unlink ===<br />
<br />
int mdc_unlink(struct obd_export *exp, struct mdc_op_data *op_data,<br />
struct ptlrpc_request **request)<br />
<br />
=== mdc_create ===<br />
<br />
int mdc_create(struct obd_export *exp, struct mdc_op_data *op_data,<br />
const void *data, int datalen, int mode, __u32 uid, __u32 gid,<br />
__u32 cap_effective, __u64 rdev, struct ptlrpc_request **request)<br />
<br />
=== mdc_rename ===<br />
<br />
int mdc_rename(struct obd_export *exp, struct mdc_op_data *op_data,<br />
const char *old, int oldlen, const char *new, int newlen,<br />
struct ptlrpc_request **request)<br />
<br />
=== mdc_req2lustre_md ===<br />
<br />
int mdc_req2lustre_md(struct ptlrpc_request *req, int offset,<br />
struct obd_export *exp,<br />
struct lustre_md *md)<br />
<br />
<br />
== Examples ==<br />
<br />
=== intermediate lookup ===<br />
<br />
VFS parses filename, finds intermediate (not last) component and starts lookup:<br />
# local cache (dcache) is checked<br />
# if dentry is found in dcache, then revalidation is called (llite's revalidation check whether lock with LOOKUP bit is still granted to the client)<br />
# if dentry isn't found in dcache, then lookup method is called<br />
# llite's lookup prepares intent and sends ENQUEUE RPC with the intent<br />
# MDS receives RPC, finds intent and execute it: name is looked up to fid, correspondent attributes are fetched, DLM lock is acquired for this resolving (LOOKUP). all this is put in the reply<br />
# client gets fid and attributes, finds or creates new inode for given fid, adds one more entry into dcache<br />
<br />
ll_lookup_it()<br />
mdc_intent_lock(IT_LOOKUP)<br />
mdc_enqueue()<br />
iget()<br />
ldlm_lock_decref()<br />
<br />
=== final lookup ===<br />
<br />
<br />
[[Category:Architecture|Metadata API]]<br />
[[New_Metadata_API]]</div>
Docadmin