diff options
Diffstat (limited to 'Documentation/filesystems/porting')
-rw-r--r-- | Documentation/filesystems/porting | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index b12c89538680..07a32b42cf9c 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
@@ -216,7 +216,6 @@ had ->revalidate()) add calls in ->follow_link()/->readlink(). | |||
216 | ->d_parent changes are not protected by BKL anymore. Read access is safe | 216 | ->d_parent changes are not protected by BKL anymore. Read access is safe |
217 | if at least one of the following is true: | 217 | if at least one of the following is true: |
218 | * filesystem has no cross-directory rename() | 218 | * filesystem has no cross-directory rename() |
219 | * dcache_lock is held | ||
220 | * we know that parent had been locked (e.g. we are looking at | 219 | * we know that parent had been locked (e.g. we are looking at |
221 | ->d_parent of ->lookup() argument). | 220 | ->d_parent of ->lookup() argument). |
222 | * we are called from ->rename(). | 221 | * we are called from ->rename(). |
@@ -318,3 +317,71 @@ if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput( | |||
318 | may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly | 317 | may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly |
319 | free the on-disk inode, you may end up doing that while ->write_inode() is writing | 318 | free the on-disk inode, you may end up doing that while ->write_inode() is writing |
320 | to it. | 319 | to it. |
320 | |||
321 | --- | ||
322 | [mandatory] | ||
323 | |||
324 | .d_delete() now only advises the dcache as to whether or not to cache | ||
325 | unreferenced dentries, and is now only called when the dentry refcount goes to | ||
326 | 0. Even on 0 refcount transition, it must be able to tolerate being called 0, | ||
327 | 1, or more times (eg. constant, idempotent). | ||
328 | |||
329 | --- | ||
330 | [mandatory] | ||
331 | |||
332 | .d_compare() calling convention and locking rules are significantly | ||
333 | changed. Read updated documentation in Documentation/filesystems/vfs.txt (and | ||
334 | look at examples of other filesystems) for guidance. | ||
335 | |||
336 | --- | ||
337 | [mandatory] | ||
338 | |||
339 | .d_hash() calling convention and locking rules are significantly | ||
340 | changed. Read updated documentation in Documentation/filesystems/vfs.txt (and | ||
341 | look at examples of other filesystems) for guidance. | ||
342 | |||
343 | --- | ||
344 | [mandatory] | ||
345 | dcache_lock is gone, replaced by fine grained locks. See fs/dcache.c | ||
346 | for details of what locks to replace dcache_lock with in order to protect | ||
347 | particular things. Most of the time, a filesystem only needs ->d_lock, which | ||
348 | protects *all* the dcache state of a given dentry. | ||
349 | |||
350 | -- | ||
351 | [mandatory] | ||
352 | |||
353 | Filesystems must RCU-free their inodes, if they can have been accessed | ||
354 | via rcu-walk path walk (basically, if the file can have had a path name in the | ||
355 | vfs namespace). | ||
356 | |||
357 | i_dentry and i_rcu share storage in a union, and the vfs expects | ||
358 | i_dentry to be reinitialized before it is freed, so an: | ||
359 | |||
360 | INIT_LIST_HEAD(&inode->i_dentry); | ||
361 | |||
362 | must be done in the RCU callback. | ||
363 | |||
364 | -- | ||
365 | [recommended] | ||
366 | vfs now tries to do path walking in "rcu-walk mode", which avoids | ||
367 | atomic operations and scalability hazards on dentries and inodes (see | ||
368 | Documentation/filesystems/path-walk.txt). d_hash and d_compare changes (above) | ||
369 | are examples of the changes required to support this. For more complex | ||
370 | filesystem callbacks, the vfs drops out of rcu-walk mode before the fs call, so | ||
371 | no changes are required to the filesystem. However, this is costly and loses | ||
372 | the benefits of rcu-walk mode. We will begin to add filesystem callbacks that | ||
373 | are rcu-walk aware, shown below. Filesystems should take advantage of this | ||
374 | where possible. | ||
375 | |||
376 | -- | ||
377 | [mandatory] | ||
378 | d_revalidate is a callback that is made on every path element (if | ||
379 | the filesystem provides it), which requires dropping out of rcu-walk mode. This | ||
380 | may now be called in rcu-walk mode (nd->flags & LOOKUP_RCU). -ECHILD should be | ||
381 | returned if the filesystem cannot handle rcu-walk. See | ||
382 | Documentation/filesystems/vfs.txt for more details. | ||
383 | |||
384 | permission and check_acl are inode permission checks that are called | ||
385 | on many or all directory inodes on the way down a path walk (to check for | ||
386 | exec permission). These must now be rcu-walk aware (flags & IPERM_RCU). See | ||
387 | Documentation/filesystems/vfs.txt for more details. | ||