Whamcloud - gitweb
LUDOC-297 protocol: Update protocol document
[doc/protocol.git] / stat.txt
1
2 Stat
3 ~~~~
4
5 The POSIX file system operation 'stat()' returns 'struct stat'
6 information about a resource (file or directory), and in Lustre that
7 information is obtained via the 'll_getattr()' function on the
8 client. How this is accomplished within Lustre depends on the state of
9 the client's directory entry cache as well as the locks it holds on
10 the relevant resources. If the client has no information about the
11 resource or any of the directories on the path leading to it (the
12 cache is "cold") then it has to get that information first. Refer to
13 <<path-lookup>> for the details. If the client cache already has all
14 the lookup information about the path, and it has a valid read lock
15 on the resource then the information can come entirely from cache: no
16 Lustre messages flow at all. If the client does need to acquire a lock
17 on the resource (for each relevant MDT and OST) then the client issues
18 an LDLM_ENQUEUE request to the MDT (respectively OST) with the
19 'getattr' intent, see <<intents>>. The getattr intent to the MDT
20 returns UID, GID and mode, while the intent to the OST(s) returns the
21 size and the file timestamps. The responses to the LDLM_ENQUEUE with
22 intents provide all the required stat information without any
23 additional messages.
24