diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-20 21:14:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-20 21:14:31 -0500 |
commit | 1f0377ff088ed2971c57debc9b0c3b846ec431fd (patch) | |
tree | cd53c8981269e57e38e4285abd71cc990e1cfc67 /Documentation/filesystems | |
parent | 54d46ea993744c5408e39ce0cb4851e13cbea716 (diff) | |
parent | b729d75d19777a5dd34672020516eada43ff026f (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS update from Al Viro:
"fscache fixes, ESTALE patchset, vmtruncate removal series, assorted
misc stuff."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (79 commits)
vfs: make lremovexattr retry once on ESTALE error
vfs: make removexattr retry once on ESTALE
vfs: make llistxattr retry once on ESTALE error
vfs: make listxattr retry once on ESTALE error
vfs: make lgetxattr retry once on ESTALE
vfs: make getxattr retry once on an ESTALE error
vfs: allow lsetxattr() to retry once on ESTALE errors
vfs: allow setxattr to retry once on ESTALE errors
vfs: allow utimensat() calls to retry once on an ESTALE error
vfs: fix user_statfs to retry once on ESTALE errors
vfs: make fchownat retry once on ESTALE errors
vfs: make fchmodat retry once on ESTALE errors
vfs: have chroot retry once on ESTALE error
vfs: have chdir retry lookup and call once on ESTALE error
vfs: have faccessat retry once on an ESTALE error
vfs: have do_sys_truncate retry once on an ESTALE error
vfs: fix renameat to retry on ESTALE errors
vfs: make do_unlinkat retry once on ESTALE errors
vfs: make do_rmdir retry once on ESTALE errors
vfs: add a flags argument to user_path_parent
...
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r-- | Documentation/filesystems/Locking | 6 | ||||
-rw-r--r-- | Documentation/filesystems/caching/backend-api.txt | 38 | ||||
-rw-r--r-- | Documentation/filesystems/caching/netfs-api.txt | 46 | ||||
-rw-r--r-- | Documentation/filesystems/caching/object.txt | 23 | ||||
-rw-r--r-- | Documentation/filesystems/caching/operations.txt | 2 | ||||
-rw-r--r-- | Documentation/filesystems/porting | 2 | ||||
-rw-r--r-- | Documentation/filesystems/vfs.txt | 11 |
7 files changed, 92 insertions, 36 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index e540a24e5d06..f48e0c6b4c42 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -80,7 +80,6 @@ rename: yes (all) (see below) | |||
80 | readlink: no | 80 | readlink: no |
81 | follow_link: no | 81 | follow_link: no |
82 | put_link: no | 82 | put_link: no |
83 | truncate: yes (see below) | ||
84 | setattr: yes | 83 | setattr: yes |
85 | permission: no (may not block if called in rcu-walk mode) | 84 | permission: no (may not block if called in rcu-walk mode) |
86 | get_acl: no | 85 | get_acl: no |
@@ -96,11 +95,6 @@ atomic_open: yes | |||
96 | Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on | 95 | Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on |
97 | victim. | 96 | victim. |
98 | cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem. | 97 | cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem. |
99 | ->truncate() is never called directly - it's a callback, not a | ||
100 | method. It's called by vmtruncate() - deprecated library function used by | ||
101 | ->setattr(). Locking information above applies to that call (i.e. is | ||
102 | inherited from ->setattr() - vmtruncate() is used when ATTR_SIZE had been | ||
103 | passed). | ||
104 | 98 | ||
105 | See Documentation/filesystems/directory-locking for more detailed discussion | 99 | See Documentation/filesystems/directory-locking for more detailed discussion |
106 | of the locking scheme for directory operations. | 100 | of the locking scheme for directory operations. |
diff --git a/Documentation/filesystems/caching/backend-api.txt b/Documentation/filesystems/caching/backend-api.txt index 382d52cdaf2d..d78bab9622c6 100644 --- a/Documentation/filesystems/caching/backend-api.txt +++ b/Documentation/filesystems/caching/backend-api.txt | |||
@@ -308,6 +308,18 @@ performed on the denizens of the cache. These are held in a structure of type: | |||
308 | obtained by calling object->cookie->def->get_aux()/get_attr(). | 308 | obtained by calling object->cookie->def->get_aux()/get_attr(). |
309 | 309 | ||
310 | 310 | ||
311 | (*) Invalidate data object [mandatory]: | ||
312 | |||
313 | int (*invalidate_object)(struct fscache_operation *op) | ||
314 | |||
315 | This is called to invalidate a data object (as pointed to by op->object). | ||
316 | All the data stored for this object should be discarded and an | ||
317 | attr_changed operation should be performed. The caller will follow up | ||
318 | with an object update operation. | ||
319 | |||
320 | fscache_op_complete() must be called on op before returning. | ||
321 | |||
322 | |||
311 | (*) Discard object [mandatory]: | 323 | (*) Discard object [mandatory]: |
312 | 324 | ||
313 | void (*drop_object)(struct fscache_object *object) | 325 | void (*drop_object)(struct fscache_object *object) |
@@ -419,7 +431,10 @@ performed on the denizens of the cache. These are held in a structure of type: | |||
419 | 431 | ||
420 | If an I/O error occurs, fscache_io_error() should be called and -ENOBUFS | 432 | If an I/O error occurs, fscache_io_error() should be called and -ENOBUFS |
421 | returned if possible or fscache_end_io() called with a suitable error | 433 | returned if possible or fscache_end_io() called with a suitable error |
422 | code.. | 434 | code. |
435 | |||
436 | fscache_put_retrieval() should be called after a page or pages are dealt | ||
437 | with. This will complete the operation when all pages are dealt with. | ||
423 | 438 | ||
424 | 439 | ||
425 | (*) Request pages be read from cache [mandatory]: | 440 | (*) Request pages be read from cache [mandatory]: |
@@ -526,6 +541,27 @@ FS-Cache provides some utilities that a cache backend may make use of: | |||
526 | error value should be 0 if successful and an error otherwise. | 541 | error value should be 0 if successful and an error otherwise. |
527 | 542 | ||
528 | 543 | ||
544 | (*) Record that one or more pages being retrieved or allocated have been dealt | ||
545 | with: | ||
546 | |||
547 | void fscache_retrieval_complete(struct fscache_retrieval *op, | ||
548 | int n_pages); | ||
549 | |||
550 | This is called to record the fact that one or more pages have been dealt | ||
551 | with and are no longer the concern of this operation. When the number of | ||
552 | pages remaining in the operation reaches 0, the operation will be | ||
553 | completed. | ||
554 | |||
555 | |||
556 | (*) Record operation completion: | ||
557 | |||
558 | void fscache_op_complete(struct fscache_operation *op); | ||
559 | |||
560 | This is called to record the completion of an operation. This deducts | ||
561 | this operation from the parent object's run state, potentially permitting | ||
562 | one or more pending operations to start running. | ||
563 | |||
564 | |||
529 | (*) Set highest store limit: | 565 | (*) Set highest store limit: |
530 | 566 | ||
531 | void fscache_set_store_limit(struct fscache_object *object, | 567 | void fscache_set_store_limit(struct fscache_object *object, |
diff --git a/Documentation/filesystems/caching/netfs-api.txt b/Documentation/filesystems/caching/netfs-api.txt index 7cc6bf2871eb..97e6c0ecc5ef 100644 --- a/Documentation/filesystems/caching/netfs-api.txt +++ b/Documentation/filesystems/caching/netfs-api.txt | |||
@@ -35,8 +35,9 @@ This document contains the following sections: | |||
35 | (12) Index and data file update | 35 | (12) Index and data file update |
36 | (13) Miscellaneous cookie operations | 36 | (13) Miscellaneous cookie operations |
37 | (14) Cookie unregistration | 37 | (14) Cookie unregistration |
38 | (15) Index and data file invalidation | 38 | (15) Index invalidation |
39 | (16) FS-Cache specific page flags. | 39 | (16) Data file invalidation |
40 | (17) FS-Cache specific page flags. | ||
40 | 41 | ||
41 | 42 | ||
42 | ============================= | 43 | ============================= |
@@ -767,13 +768,42 @@ the cookies for "child" indices, objects and pages have been relinquished | |||
767 | first. | 768 | first. |
768 | 769 | ||
769 | 770 | ||
770 | ================================ | 771 | ================== |
771 | INDEX AND DATA FILE INVALIDATION | 772 | INDEX INVALIDATION |
772 | ================================ | 773 | ================== |
774 | |||
775 | There is no direct way to invalidate an index subtree. To do this, the caller | ||
776 | should relinquish and retire the cookie they have, and then acquire a new one. | ||
777 | |||
778 | |||
779 | ====================== | ||
780 | DATA FILE INVALIDATION | ||
781 | ====================== | ||
782 | |||
783 | Sometimes it will be necessary to invalidate an object that contains data. | ||
784 | Typically this will be necessary when the server tells the netfs of a foreign | ||
785 | change - at which point the netfs has to throw away all the state it had for an | ||
786 | inode and reload from the server. | ||
787 | |||
788 | To indicate that a cache object should be invalidated, the following function | ||
789 | can be called: | ||
790 | |||
791 | void fscache_invalidate(struct fscache_cookie *cookie); | ||
792 | |||
793 | This can be called with spinlocks held as it defers the work to a thread pool. | ||
794 | All extant storage, retrieval and attribute change ops at this point are | ||
795 | cancelled and discarded. Some future operations will be rejected until the | ||
796 | cache has had a chance to insert a barrier in the operations queue. After | ||
797 | that, operations will be queued again behind the invalidation operation. | ||
798 | |||
799 | The invalidation operation will perform an attribute change operation and an | ||
800 | auxiliary data update operation as it is very likely these will have changed. | ||
801 | |||
802 | Using the following function, the netfs can wait for the invalidation operation | ||
803 | to have reached a point at which it can start submitting ordinary operations | ||
804 | once again: | ||
773 | 805 | ||
774 | There is no direct way to invalidate an index subtree or a data file. To do | 806 | void fscache_wait_on_invalidate(struct fscache_cookie *cookie); |
775 | this, the caller should relinquish and retire the cookie they have, and then | ||
776 | acquire a new one. | ||
777 | 807 | ||
778 | 808 | ||
779 | =========================== | 809 | =========================== |
diff --git a/Documentation/filesystems/caching/object.txt b/Documentation/filesystems/caching/object.txt index 58313348da87..100ff41127e4 100644 --- a/Documentation/filesystems/caching/object.txt +++ b/Documentation/filesystems/caching/object.txt | |||
@@ -216,7 +216,14 @@ servicing netfs requests: | |||
216 | The normal running state. In this state, requests the netfs makes will be | 216 | The normal running state. In this state, requests the netfs makes will be |
217 | passed on to the cache. | 217 | passed on to the cache. |
218 | 218 | ||
219 | (6) State FSCACHE_OBJECT_UPDATING. | 219 | (6) State FSCACHE_OBJECT_INVALIDATING. |
220 | |||
221 | The object is undergoing invalidation. When the state comes here, it | ||
222 | discards all pending read, write and attribute change operations as it is | ||
223 | going to clear out the cache entirely and reinitialise it. It will then | ||
224 | continue to the FSCACHE_OBJECT_UPDATING state. | ||
225 | |||
226 | (7) State FSCACHE_OBJECT_UPDATING. | ||
220 | 227 | ||
221 | The state machine comes here to update the object in the cache from the | 228 | The state machine comes here to update the object in the cache from the |
222 | netfs's records. This involves updating the auxiliary data that is used | 229 | netfs's records. This involves updating the auxiliary data that is used |
@@ -225,13 +232,13 @@ servicing netfs requests: | |||
225 | And there are terminal states in which an object cleans itself up, deallocates | 232 | And there are terminal states in which an object cleans itself up, deallocates |
226 | memory and potentially deletes stuff from disk: | 233 | memory and potentially deletes stuff from disk: |
227 | 234 | ||
228 | (7) State FSCACHE_OBJECT_LC_DYING. | 235 | (8) State FSCACHE_OBJECT_LC_DYING. |
229 | 236 | ||
230 | The object comes here if it is dying because of a lookup or creation | 237 | The object comes here if it is dying because of a lookup or creation |
231 | error. This would be due to a disk error or system error of some sort. | 238 | error. This would be due to a disk error or system error of some sort. |
232 | Temporary data is cleaned up, and the parent is released. | 239 | Temporary data is cleaned up, and the parent is released. |
233 | 240 | ||
234 | (8) State FSCACHE_OBJECT_DYING. | 241 | (9) State FSCACHE_OBJECT_DYING. |
235 | 242 | ||
236 | The object comes here if it is dying due to an error, because its parent | 243 | The object comes here if it is dying due to an error, because its parent |
237 | cookie has been relinquished by the netfs or because the cache is being | 244 | cookie has been relinquished by the netfs or because the cache is being |
@@ -241,27 +248,27 @@ memory and potentially deletes stuff from disk: | |||
241 | can destroy themselves. This object waits for all its children to go away | 248 | can destroy themselves. This object waits for all its children to go away |
242 | before advancing to the next state. | 249 | before advancing to the next state. |
243 | 250 | ||
244 | (9) State FSCACHE_OBJECT_ABORT_INIT. | 251 | (10) State FSCACHE_OBJECT_ABORT_INIT. |
245 | 252 | ||
246 | The object comes to this state if it was waiting on its parent in | 253 | The object comes to this state if it was waiting on its parent in |
247 | FSCACHE_OBJECT_INIT, but its parent died. The object will destroy itself | 254 | FSCACHE_OBJECT_INIT, but its parent died. The object will destroy itself |
248 | so that the parent may proceed from the FSCACHE_OBJECT_DYING state. | 255 | so that the parent may proceed from the FSCACHE_OBJECT_DYING state. |
249 | 256 | ||
250 | (10) State FSCACHE_OBJECT_RELEASING. | 257 | (11) State FSCACHE_OBJECT_RELEASING. |
251 | (11) State FSCACHE_OBJECT_RECYCLING. | 258 | (12) State FSCACHE_OBJECT_RECYCLING. |
252 | 259 | ||
253 | The object comes to one of these two states when dying once it is rid of | 260 | The object comes to one of these two states when dying once it is rid of |
254 | all its children, if it is dying because the netfs relinquished its | 261 | all its children, if it is dying because the netfs relinquished its |
255 | cookie. In the first state, the cached data is expected to persist, and | 262 | cookie. In the first state, the cached data is expected to persist, and |
256 | in the second it will be deleted. | 263 | in the second it will be deleted. |
257 | 264 | ||
258 | (12) State FSCACHE_OBJECT_WITHDRAWING. | 265 | (13) State FSCACHE_OBJECT_WITHDRAWING. |
259 | 266 | ||
260 | The object transits to this state if the cache decides it wants to | 267 | The object transits to this state if the cache decides it wants to |
261 | withdraw the object from service, perhaps to make space, but also due to | 268 | withdraw the object from service, perhaps to make space, but also due to |
262 | error or just because the whole cache is being withdrawn. | 269 | error or just because the whole cache is being withdrawn. |
263 | 270 | ||
264 | (13) State FSCACHE_OBJECT_DEAD. | 271 | (14) State FSCACHE_OBJECT_DEAD. |
265 | 272 | ||
266 | The object transits to this state when the in-memory object record is | 273 | The object transits to this state when the in-memory object record is |
267 | ready to be deleted. The object processor shouldn't ever see an object in | 274 | ready to be deleted. The object processor shouldn't ever see an object in |
diff --git a/Documentation/filesystems/caching/operations.txt b/Documentation/filesystems/caching/operations.txt index b6b070c57cbf..bee2a5f93d60 100644 --- a/Documentation/filesystems/caching/operations.txt +++ b/Documentation/filesystems/caching/operations.txt | |||
@@ -174,7 +174,7 @@ Operations are used through the following procedure: | |||
174 | necessary (the object might have died whilst the thread was waiting). | 174 | necessary (the object might have died whilst the thread was waiting). |
175 | 175 | ||
176 | When it has finished doing its processing, it should call | 176 | When it has finished doing its processing, it should call |
177 | fscache_put_operation() on it. | 177 | fscache_op_complete() and fscache_put_operation() on it. |
178 | 178 | ||
179 | (4) The operation holds an effective lock upon the object, preventing other | 179 | (4) The operation holds an effective lock upon the object, preventing other |
180 | exclusive ops conflicting until it is released. The operation can be | 180 | exclusive ops conflicting until it is released. The operation can be |
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index 0742feebc6e2..0472c31c163b 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
@@ -281,7 +281,7 @@ ext2_write_failed and callers for an example. | |||
281 | 281 | ||
282 | [mandatory] | 282 | [mandatory] |
283 | 283 | ||
284 | ->truncate is going away. The whole truncate sequence needs to be | 284 | ->truncate is gone. The whole truncate sequence needs to be |
285 | implemented in ->setattr, which is now mandatory for filesystems | 285 | implemented in ->setattr, which is now mandatory for filesystems |
286 | implementing on-disk size changes. Start with a copy of the old inode_setattr | 286 | implementing on-disk size changes. Start with a copy of the old inode_setattr |
287 | and vmtruncate, and the reorder the vmtruncate + foofs_vmtruncate sequence to | 287 | and vmtruncate, and the reorder the vmtruncate + foofs_vmtruncate sequence to |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 2ee133e030c3..e3869098163e 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -350,7 +350,6 @@ struct inode_operations { | |||
350 | int (*readlink) (struct dentry *, char __user *,int); | 350 | int (*readlink) (struct dentry *, char __user *,int); |
351 | void * (*follow_link) (struct dentry *, struct nameidata *); | 351 | void * (*follow_link) (struct dentry *, struct nameidata *); |
352 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 352 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
353 | void (*truncate) (struct inode *); | ||
354 | int (*permission) (struct inode *, int); | 353 | int (*permission) (struct inode *, int); |
355 | int (*get_acl)(struct inode *, int); | 354 | int (*get_acl)(struct inode *, int); |
356 | int (*setattr) (struct dentry *, struct iattr *); | 355 | int (*setattr) (struct dentry *, struct iattr *); |
@@ -431,16 +430,6 @@ otherwise noted. | |||
431 | started might not be in the page cache at the end of the | 430 | started might not be in the page cache at the end of the |
432 | walk). | 431 | walk). |
433 | 432 | ||
434 | truncate: Deprecated. This will not be called if ->setsize is defined. | ||
435 | Called by the VFS to change the size of a file. The | ||
436 | i_size field of the inode is set to the desired size by the | ||
437 | VFS before this method is called. This method is called by | ||
438 | the truncate(2) system call and related functionality. | ||
439 | |||
440 | Note: ->truncate and vmtruncate are deprecated. Do not add new | ||
441 | instances/calls of these. Filesystems should be converted to do their | ||
442 | truncate sequence via ->setattr(). | ||
443 | |||
444 | permission: called by the VFS to check for access rights on a POSIX-like | 433 | permission: called by the VFS to check for access rights on a POSIX-like |
445 | filesystem. | 434 | filesystem. |
446 | 435 | ||