Whamcloud - gitweb
LUDOC-293 protocol: Merge all recent patches
[doc/protocol.git] / stat.txt
diff --git a/stat.txt b/stat.txt
new file mode 100644 (file)
index 0000000..f8aae30
--- /dev/null
+++ b/stat.txt
@@ -0,0 +1,24 @@
+
+Stat
+~~~~
+
+The POSIX file system operation 'stat()' returns 'struct stat'
+information about a resource (file or directory), and in Lustre that
+information is obtained via the 'll_getattr()' function on the
+client. How this is accomplished within Lustre depends on the state of
+the client's directory entry cache as well as the locks it holds on
+the relevant resources. If the client has no information about the
+resource or any of the directories on the path leading to it (the
+cache is "cold") then it has to get that information first. Refer to
+<<path-lookup>> for the details. If the client cache already has all
+the lookup information about the path, and it has a valid read lock
+on the resource then the information can come entirely from cache: no
+Lustre messages flow at all. If the client does need to acquire a lock
+on the resource (for each relevant MDT and OST) then the client issues
+an LDLM_ENQUEUE request to the MDT (respectively OST) with the
+'getattr' intent, see <<intents>>. The getattr intent to the MDT
+returns UID, GID and mode, while the intent to the OST(s) returns the
+size and the file timestamps. The responses to the LDLM_ENQUEUE with
+intents provide all the required stat information without any
+additional messages.
+