Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347893
b: refs/heads/master
c: 4c9a44a
h: refs/heads/master
i:
  347891: ff38989
v: v3
  • Loading branch information
Linus Torvalds committed Dec 21, 2012
1 parent d847c63 commit 0a6f060
Show file tree
Hide file tree
Showing 316 changed files with 18,513 additions and 2,787 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cfde819088422503b5c69e03ab7bb90f87121d4d
refs/heads/master: 4c9a44aebeaef35570a67aed17b72a2cf8d0b219
4 changes: 4 additions & 0 deletions trunk/Documentation/ABI/testing/sysfs-bus-rbd
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ snap_*

A directory per each snapshot

parent

Information identifying the pool, image, and snapshot id for
the parent image in a layered rbd image (format 2 only).

Entries under /sys/bus/rbd/devices/<dev-id>/snap_<snap-name>
-------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions trunk/Documentation/filesystems/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ ext4.txt
- info, mount options and specifications for the Ext4 filesystem.
files.txt
- info on file management in the Linux kernel.
f2fs.txt
- info and mount options for the F2FS filesystem.
fuse.txt
- info on the Filesystem in User SpacE including mount options.
gfs2.txt
Expand Down
6 changes: 0 additions & 6 deletions trunk/Documentation/filesystems/Locking
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ rename: yes (all) (see below)
readlink: no
follow_link: no
put_link: no
truncate: yes (see below)
setattr: yes
permission: no (may not block if called in rcu-walk mode)
get_acl: no
Expand All @@ -96,11 +95,6 @@ atomic_open: yes
Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
victim.
cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.
->truncate() is never called directly - it's a callback, not a
method. It's called by vmtruncate() - deprecated library function used by
->setattr(). Locking information above applies to that call (i.e. is
inherited from ->setattr() - vmtruncate() is used when ATTR_SIZE had been
passed).

See Documentation/filesystems/directory-locking for more detailed discussion
of the locking scheme for directory operations.
Expand Down
38 changes: 37 additions & 1 deletion trunk/Documentation/filesystems/caching/backend-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,18 @@ performed on the denizens of the cache. These are held in a structure of type:
obtained by calling object->cookie->def->get_aux()/get_attr().


(*) Invalidate data object [mandatory]:

int (*invalidate_object)(struct fscache_operation *op)

This is called to invalidate a data object (as pointed to by op->object).
All the data stored for this object should be discarded and an
attr_changed operation should be performed. The caller will follow up
with an object update operation.

fscache_op_complete() must be called on op before returning.


(*) Discard object [mandatory]:

void (*drop_object)(struct fscache_object *object)
Expand Down Expand Up @@ -419,7 +431,10 @@ performed on the denizens of the cache. These are held in a structure of type:

If an I/O error occurs, fscache_io_error() should be called and -ENOBUFS
returned if possible or fscache_end_io() called with a suitable error
code..
code.

fscache_put_retrieval() should be called after a page or pages are dealt
with. This will complete the operation when all pages are dealt with.


(*) Request pages be read from cache [mandatory]:
Expand Down Expand Up @@ -526,6 +541,27 @@ FS-Cache provides some utilities that a cache backend may make use of:
error value should be 0 if successful and an error otherwise.


(*) Record that one or more pages being retrieved or allocated have been dealt
with:

void fscache_retrieval_complete(struct fscache_retrieval *op,
int n_pages);

This is called to record the fact that one or more pages have been dealt
with and are no longer the concern of this operation. When the number of
pages remaining in the operation reaches 0, the operation will be
completed.


(*) Record operation completion:

void fscache_op_complete(struct fscache_operation *op);

This is called to record the completion of an operation. This deducts
this operation from the parent object's run state, potentially permitting
one or more pending operations to start running.


(*) Set highest store limit:

void fscache_set_store_limit(struct fscache_object *object,
Expand Down
46 changes: 38 additions & 8 deletions trunk/Documentation/filesystems/caching/netfs-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ This document contains the following sections:
(12) Index and data file update
(13) Miscellaneous cookie operations
(14) Cookie unregistration
(15) Index and data file invalidation
(16) FS-Cache specific page flags.
(15) Index invalidation
(16) Data file invalidation
(17) FS-Cache specific page flags.


=============================
Expand Down Expand Up @@ -767,13 +768,42 @@ the cookies for "child" indices, objects and pages have been relinquished
first.


================================
INDEX AND DATA FILE INVALIDATION
================================
==================
INDEX INVALIDATION
==================

There is no direct way to invalidate an index subtree. To do this, the caller
should relinquish and retire the cookie they have, and then acquire a new one.


======================
DATA FILE INVALIDATION
======================

Sometimes it will be necessary to invalidate an object that contains data.
Typically this will be necessary when the server tells the netfs of a foreign
change - at which point the netfs has to throw away all the state it had for an
inode and reload from the server.

To indicate that a cache object should be invalidated, the following function
can be called:

void fscache_invalidate(struct fscache_cookie *cookie);

This can be called with spinlocks held as it defers the work to a thread pool.
All extant storage, retrieval and attribute change ops at this point are
cancelled and discarded. Some future operations will be rejected until the
cache has had a chance to insert a barrier in the operations queue. After
that, operations will be queued again behind the invalidation operation.

The invalidation operation will perform an attribute change operation and an
auxiliary data update operation as it is very likely these will have changed.

Using the following function, the netfs can wait for the invalidation operation
to have reached a point at which it can start submitting ordinary operations
once again:

There is no direct way to invalidate an index subtree or a data file. To do
this, the caller should relinquish and retire the cookie they have, and then
acquire a new one.
void fscache_wait_on_invalidate(struct fscache_cookie *cookie);


===========================
Expand Down
23 changes: 15 additions & 8 deletions trunk/Documentation/filesystems/caching/object.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,14 @@ servicing netfs requests:
The normal running state. In this state, requests the netfs makes will be
passed on to the cache.

(6) State FSCACHE_OBJECT_UPDATING.
(6) State FSCACHE_OBJECT_INVALIDATING.

The object is undergoing invalidation. When the state comes here, it
discards all pending read, write and attribute change operations as it is
going to clear out the cache entirely and reinitialise it. It will then
continue to the FSCACHE_OBJECT_UPDATING state.

(7) State FSCACHE_OBJECT_UPDATING.

The state machine comes here to update the object in the cache from the
netfs's records. This involves updating the auxiliary data that is used
Expand All @@ -225,13 +232,13 @@ servicing netfs requests:
And there are terminal states in which an object cleans itself up, deallocates
memory and potentially deletes stuff from disk:

(7) State FSCACHE_OBJECT_LC_DYING.
(8) State FSCACHE_OBJECT_LC_DYING.

The object comes here if it is dying because of a lookup or creation
error. This would be due to a disk error or system error of some sort.
Temporary data is cleaned up, and the parent is released.

(8) State FSCACHE_OBJECT_DYING.
(9) State FSCACHE_OBJECT_DYING.

The object comes here if it is dying due to an error, because its parent
cookie has been relinquished by the netfs or because the cache is being
Expand All @@ -241,27 +248,27 @@ memory and potentially deletes stuff from disk:
can destroy themselves. This object waits for all its children to go away
before advancing to the next state.

(9) State FSCACHE_OBJECT_ABORT_INIT.
(10) State FSCACHE_OBJECT_ABORT_INIT.

The object comes to this state if it was waiting on its parent in
FSCACHE_OBJECT_INIT, but its parent died. The object will destroy itself
so that the parent may proceed from the FSCACHE_OBJECT_DYING state.

(10) State FSCACHE_OBJECT_RELEASING.
(11) State FSCACHE_OBJECT_RECYCLING.
(11) State FSCACHE_OBJECT_RELEASING.
(12) State FSCACHE_OBJECT_RECYCLING.

The object comes to one of these two states when dying once it is rid of
all its children, if it is dying because the netfs relinquished its
cookie. In the first state, the cached data is expected to persist, and
in the second it will be deleted.

(12) State FSCACHE_OBJECT_WITHDRAWING.
(13) State FSCACHE_OBJECT_WITHDRAWING.

The object transits to this state if the cache decides it wants to
withdraw the object from service, perhaps to make space, but also due to
error or just because the whole cache is being withdrawn.

(13) State FSCACHE_OBJECT_DEAD.
(14) State FSCACHE_OBJECT_DEAD.

The object transits to this state when the in-memory object record is
ready to be deleted. The object processor shouldn't ever see an object in
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/filesystems/caching/operations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Operations are used through the following procedure:
necessary (the object might have died whilst the thread was waiting).

When it has finished doing its processing, it should call
fscache_put_operation() on it.
fscache_op_complete() and fscache_put_operation() on it.

(4) The operation holds an effective lock upon the object, preventing other
exclusive ops conflicting until it is released. The operation can be
Expand Down
Loading

0 comments on commit 0a6f060

Please sign in to comment.