)]}'
{
  "log": [
    {
      "commit": "4fbf4291aa15926cd4fdca0ffe9122e89d0459db",
      "tree": "ec2195c39ef8117acea598af4a5c20c77f67aa0b",
      "parents": [
        "440f0affe247e9990c8f8778f1861da4fd7d5e50"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Thu Nov 19 18:11:04 2009 +0000"
      },
      "committer": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Thu Nov 19 18:11:04 2009 +0000"
      },
      "message": "FS-Cache: Allow the current state of all objects to be dumped\n\nAllow the current state of all fscache objects to be dumped by doing:\n\n\tcat /proc/fs/fscache/objects\n\nBy default, all objects and all fields will be shown.  This can be restricted\nby adding a suitable key to one of the caller\u0027s keyrings (such as the session\nkeyring):\n\n\tkeyctl add user fscache:objlist \"\u003crestrictions\u003e\" @s\n\nThe \u003crestrictions\u003e are:\n\n\tK\tShow hexdump of object key (don\u0027t show if not given)\n\tA\tShow hexdump of object aux data (don\u0027t show if not given)\n\nAnd paired restrictions:\n\n\tC\tShow objects that have a cookie\n\tc\tShow objects that don\u0027t have a cookie\n\tB\tShow objects that are busy\n\tb\tShow objects that aren\u0027t busy\n\tW\tShow objects that have pending writes\n\tw\tShow objects that don\u0027t have pending writes\n\tR\tShow objects that have outstanding reads\n\tr\tShow objects that don\u0027t have outstanding reads\n\tS\tShow objects that have slow work queued\n\ts\tShow objects that don\u0027t have slow work queued\n\nIf neither side of a restriction pair is given, then both are implied.  For\nexample:\n\n\tkeyctl add user fscache:objlist KB @s\n\nshows objects that are busy, and lists their object keys, but does not dump\ntheir auxiliary data.  It also implies \"CcWwRrSs\", but as \u0027B\u0027 is given, \u0027b\u0027 is\nnot implied.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\n"
    },
    {
      "commit": "b510882281d56873e1194021643b7c325336f84f",
      "tree": "86cd206b0d2b55dc355833ca238d46488161b64c",
      "parents": [
        "952efe7b7840e1c726ae88222245e4efe6bd88f3"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:39 2009 +0100"
      },
      "committer": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:39 2009 +0100"
      },
      "message": "FS-Cache: Implement data I/O part of netfs API\n\nImplement the data I/O part of the FS-Cache netfs API.  The documentation and\nAPI header file were added in a previous patch.\n\nThis patch implements the following functions for the netfs to call:\n\n (*) fscache_attr_changed().\n\n     Indicate that the object has changed its attributes.  The only attribute\n     currently recorded is the file size.  Only pages within the set file size\n     will be stored in the cache.\n\n     This operation is submitted for asynchronous processing, and will return\n     immediately.  It will return -ENOMEM if an out of memory error is\n     encountered, -ENOBUFS if the object is not actually cached, or 0 if the\n     operation is successfully queued.\n\n (*) fscache_read_or_alloc_page().\n (*) fscache_read_or_alloc_pages().\n\n     Request data be fetched from the disk, and allocate internal metadata to\n     track the netfs pages and reserve disk space for unknown pages.\n\n     These operations perform semi-asynchronous data reads.  Upon returning\n     they will indicate which pages they think can be retrieved from disk, and\n     will have set in progress attempts to retrieve those pages.\n\n     These will return, in order of preference, -ENOMEM on memory allocation\n     error, -ERESTARTSYS if a signal interrupted proceedings, -ENODATA if one\n     or more requested pages are not yet cached, -ENOBUFS if the object is not\n     actually cached or if there isn\u0027t space for future pages to be cached on\n     this object, or 0 if successful.\n\n     In the case of the multipage function, the pages for which reads are set\n     in progress will be removed from the list and the page count decreased\n     appropriately.\n\n     If any read operations should fail, the completion function will be given\n     an error, and will also be passed contextual information to allow the\n     netfs to fall back to querying the server for the absent pages.\n\n     For each successful read, the page completion function will also be\n     called.\n\n     Any pages subsequently tracked by the cache will have PG_fscache set upon\n     them on return.  fscache_uncache_page() must be called for such pages.\n\n     If supplied by the netfs, the mark_pages_cached() cookie op will be\n     invoked for any pages now tracked.\n\n (*) fscache_alloc_page().\n\n     Allocate internal metadata to track a netfs page and reserve disk space.\n\n     This will return -ENOMEM on memory allocation error, -ERESTARTSYS on\n     signal, -ENOBUFS if the object isn\u0027t cached, or there isn\u0027t enough space\n     in the cache, or 0 if successful.\n\n     Any pages subsequently tracked by the cache will have PG_fscache set upon\n     them on return.  fscache_uncache_page() must be called for such pages.\n\n     If supplied by the netfs, the mark_pages_cached() cookie op will be\n     invoked for any pages now tracked.\n\n (*) fscache_write_page().\n\n     Request data be stored to disk.  This may only be called on pages that\n     have been read or alloc\u0027d by the above three functions and have not yet\n     been uncached.\n\n     This will return -ENOMEM on memory allocation error, -ERESTARTSYS on\n     signal, -ENOBUFS if the object isn\u0027t cached, or there isn\u0027t immediately\n     enough space in the cache, or 0 if successful.\n\n     On a successful return, this operation will have queued the page for\n     asynchronous writing to the cache.  The page will be returned with\n     PG_fscache_write set until the write completes one way or another.  The\n     caller will not be notified if the write fails due to an I/O error.  If\n     that happens, the object will become available and all pending writes will\n     be aborted.\n\n     Note that the cache may batch up page writes, and so it may take a while\n     to get around to writing them out.\n\n     The caller must assume that until PG_fscache_write is cleared the page is\n     use by the cache.  Any changes made to the page may be reflected on disk.\n     The page may even be under DMA.\n\n (*) fscache_uncache_page().\n\n     Indicate that the cache should stop tracking a page previously read or\n     alloc\u0027d from the cache.  If the page was alloc\u0027d only, but unwritten, it\n     will not appear on disk.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Steve Dickson \u003csteved@redhat.com\u003e\nAcked-by: Trond Myklebust \u003cTrond.Myklebust@netapp.com\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nTested-by: Daire Byrne \u003cDaire.Byrne@framestore.com\u003e\n"
    },
    {
      "commit": "952efe7b7840e1c726ae88222245e4efe6bd88f3",
      "tree": "fed43da6709707d0eb51b8695b6b382a221e99bd",
      "parents": [
        "ccc4fc3d11e91477036d1f82bfa2d442f6ce77f0"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:39 2009 +0100"
      },
      "committer": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:39 2009 +0100"
      },
      "message": "FS-Cache: Add and document asynchronous operation handling\n\nAdd and document asynchronous operation handling for use by FS-Cache\u0027s data\nstorage and retrieval routines.\n\nThe following documentation is added to:\n\n\tDocumentation/filesystems/caching/operations.txt\n\n\t\t       \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\t\t       ASYNCHRONOUS OPERATIONS HANDLING\n\t\t       \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nOVERVIEW\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nFS-Cache has an asynchronous operations handling facility that it uses for its\ndata storage and retrieval routines.  Its operations are represented by\nfscache_operation structs, though these are usually embedded into some other\nstructure.\n\nThis facility is available to and expected to be be used by the cache backends,\nand FS-Cache will create operations and pass them off to the appropriate cache\nbackend for completion.\n\nTo make use of this facility, \u003clinux/fscache-cache.h\u003e should be #included.\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nOPERATION RECORD INITIALISATION\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nAn operation is recorded in an fscache_operation struct:\n\n\tstruct fscache_operation {\n\t\tunion {\n\t\t\tstruct work_struct fast_work;\n\t\t\tstruct slow_work slow_work;\n\t\t};\n\t\tunsigned long\t\tflags;\n\t\tfscache_operation_processor_t processor;\n\t\t...\n\t};\n\nSomeone wanting to issue an operation should allocate something with this\nstruct embedded in it.  They should initialise it by calling:\n\n\tvoid fscache_operation_init(struct fscache_operation *op,\n\t\t\t\t    fscache_operation_release_t release);\n\nwith the operation to be initialised and the release function to use.\n\nThe op-\u003eflags parameter should be set to indicate the CPU time provision and\nthe exclusivity (see the Parameters section).\n\nThe op-\u003efast_work, op-\u003eslow_work and op-\u003eprocessor flags should be set as\nappropriate for the CPU time provision (see the Parameters section).\n\nFSCACHE_OP_WAITING may be set in op-\u003eflags prior to each submission of the\noperation and waited for afterwards.\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nPARAMETERS\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nThere are a number of parameters that can be set in the operation record\u0027s flag\nparameter.  There are three options for the provision of CPU time in these\noperations:\n\n (1) The operation may be done synchronously (FSCACHE_OP_MYTHREAD).  A thread\n     may decide it wants to handle an operation itself without deferring it to\n     another thread.\n\n     This is, for example, used in read operations for calling readpages() on\n     the backing filesystem in CacheFiles.  Although readpages() does an\n     asynchronous data fetch, the determination of whether pages exist is done\n     synchronously - and the netfs does not proceed until this has been\n     determined.\n\n     If this option is to be used, FSCACHE_OP_WAITING must be set in op-\u003eflags\n     before submitting the operation, and the operating thread must wait for it\n     to be cleared before proceeding:\n\n\t\twait_on_bit(\u0026op-\u003eflags, FSCACHE_OP_WAITING,\n\t\t\t    fscache_wait_bit, TASK_UNINTERRUPTIBLE);\n\n (2) The operation may be fast asynchronous (FSCACHE_OP_FAST), in which case it\n     will be given to keventd to process.  Such an operation is not permitted\n     to sleep on I/O.\n\n     This is, for example, used by CacheFiles to copy data from a backing fs\n     page to a netfs page after the backing fs has read the page in.\n\n     If this option is used, op-\u003efast_work and op-\u003eprocessor must be\n     initialised before submitting the operation:\n\n\t\tINIT_WORK(\u0026op-\u003efast_work, do_some_work);\n\n (3) The operation may be slow asynchronous (FSCACHE_OP_SLOW), in which case it\n     will be given to the slow work facility to process.  Such an operation is\n     permitted to sleep on I/O.\n\n     This is, for example, used by FS-Cache to handle background writes of\n     pages that have just been fetched from a remote server.\n\n     If this option is used, op-\u003eslow_work and op-\u003eprocessor must be\n     initialised before submitting the operation:\n\n\t\tfscache_operation_init_slow(op, processor)\n\nFurthermore, operations may be one of two types:\n\n (1) Exclusive (FSCACHE_OP_EXCLUSIVE).  Operations of this type may not run in\n     conjunction with any other operation on the object being operated upon.\n\n     An example of this is the attribute change operation, in which the file\n     being written to may need truncation.\n\n (2) Shareable.  Operations of this type may be running simultaneously.  It\u0027s\n     up to the operation implementation to prevent interference between other\n     operations running at the same time.\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nPROCEDURE\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nOperations are used through the following procedure:\n\n (1) The submitting thread must allocate the operation and initialise it\n     itself.  Normally this would be part of a more specific structure with the\n     generic op embedded within.\n\n (2) The submitting thread must then submit the operation for processing using\n     one of the following two functions:\n\n\tint fscache_submit_op(struct fscache_object *object,\n\t\t\t      struct fscache_operation *op);\n\n\tint fscache_submit_exclusive_op(struct fscache_object *object,\n\t\t\t\t\tstruct fscache_operation *op);\n\n     The first function should be used to submit non-exclusive ops and the\n     second to submit exclusive ones.  The caller must still set the\n     FSCACHE_OP_EXCLUSIVE flag.\n\n     If successful, both functions will assign the operation to the specified\n     object and return 0.  -ENOBUFS will be returned if the object specified is\n     permanently unavailable.\n\n     The operation manager will defer operations on an object that is still\n     undergoing lookup or creation.  The operation will also be deferred if an\n     operation of conflicting exclusivity is in progress on the object.\n\n     If the operation is asynchronous, the manager will retain a reference to\n     it, so the caller should put their reference to it by passing it to:\n\n\tvoid fscache_put_operation(struct fscache_operation *op);\n\n (3) If the submitting thread wants to do the work itself, and has marked the\n     operation with FSCACHE_OP_MYTHREAD, then it should monitor\n     FSCACHE_OP_WAITING as described above and check the state of the object if\n     necessary (the object might have died whilst the thread was waiting).\n\n     When it has finished doing its processing, it should call\n     fscache_put_operation() on it.\n\n (4) The operation holds an effective lock upon the object, preventing other\n     exclusive ops conflicting until it is released.  The operation can be\n     enqueued for further immediate asynchronous processing by adjusting the\n     CPU time provisioning option if necessary, eg:\n\n\top-\u003eflags \u0026\u003d ~FSCACHE_OP_TYPE;\n\top-\u003eflags |\u003d ~FSCACHE_OP_FAST;\n\n     and calling:\n\n\tvoid fscache_enqueue_operation(struct fscache_operation *op)\n\n     This can be used to allow other things to have use of the worker thread\n     pools.\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nASYNCHRONOUS CALLBACK\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWhen used in asynchronous mode, the worker thread pool will invoke the\nprocessor method with a pointer to the operation.  This should then get at the\ncontainer struct by using container_of():\n\n\tstatic void fscache_write_op(struct fscache_operation *_op)\n\t{\n\t\tstruct fscache_storage *op \u003d\n\t\t\tcontainer_of(_op, struct fscache_storage, op);\n\t...\n\t}\n\nThe caller holds a reference on the operation, and will invoke\nfscache_put_operation() when the processor function returns.  The processor\nfunction is at liberty to call fscache_enqueue_operation() or to take extra\nreferences.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Steve Dickson \u003csteved@redhat.com\u003e\nAcked-by: Trond Myklebust \u003cTrond.Myklebust@netapp.com\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nTested-by: Daire Byrne \u003cDaire.Byrne@framestore.com\u003e\n"
    },
    {
      "commit": "36c9559022850f919269564a74bf17fdabf4bb30",
      "tree": "f163afcf8f8a9eb1a5d63fd6198fcb3e29564493",
      "parents": [
        "2868cbea72dc89ae0eb17693596b1dedaafff1c5"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:38 2009 +0100"
      },
      "committer": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:38 2009 +0100"
      },
      "message": "FS-Cache: Object management state machine\n\nImplement the cache object management state machine.\n\nThe following documentation is added to illuminate the working of this state\nmachine.  It will also be added as:\n\n\tDocumentation/filesystems/caching/object.txt\n\n\t     \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\t     IN-KERNEL CACHE OBJECT REPRESENTATION AND MANAGEMENT\n\t     \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nREPRESENTATION\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nFS-Cache maintains an in-kernel representation of each object that a netfs is\ncurrently interested in.  Such objects are represented by the fscache_cookie\nstruct and are referred to as cookies.\n\nFS-Cache also maintains a separate in-kernel representation of the objects that\na cache backend is currently actively caching.  Such objects are represented by\nthe fscache_object struct.  The cache backends allocate these upon request, and\nare expected to embed them in their own representations.  These are referred to\nas objects.\n\nThere is a 1:N relationship between cookies and objects.  A cookie may be\nrepresented by multiple objects - an index may exist in more than one cache -\nor even by no objects (it may not be cached).\n\nFurthermore, both cookies and objects are hierarchical.  The two hierarchies\ncorrespond, but the cookies tree is a superset of the union of the object trees\nof multiple caches:\n\n\t    NETFS INDEX TREE               :      CACHE 1     :      CACHE 2\n\t                                   :                  :\n\t                                   :   +-----------+  :\n\t                          +-----------\u003e|  IObject  |  :\n\t      +-----------+       |        :   +-----------+  :\n\t      |  ICookie  |-------+        :         |        :\n\t      +-----------+       |        :         |        :   +-----------+\n\t            |             +------------------------------\u003e|  IObject  |\n\t            |                      :         |        :   +-----------+\n\t            |                      :         V        :         |\n\t            |                      :   +-----------+  :         |\n\t            V             +-----------\u003e|  IObject  |  :         |\n\t      +-----------+       |        :   +-----------+  :         |\n\t      |  ICookie  |-------+        :         |        :         V\n\t      +-----------+       |        :         |        :   +-----------+\n\t            |             +------------------------------\u003e|  IObject  |\n\t      +-----+-----+                :         |        :   +-----------+\n\t      |           |                :         |        :         |\n\t      V           |                :         V        :         |\n\t+-----------+     |                :   +-----------+  :         |\n\t|  ICookie  |-------------------------\u003e|  IObject  |  :         |\n\t+-----------+     |                :   +-----------+  :         |\n\t      |           V                :         |        :         V\n\t      |     +-----------+          :         |        :   +-----------+\n\t      |     |  ICookie  |--------------------------------\u003e|  IObject  |\n\t      |     +-----------+          :         |        :   +-----------+\n\t      V           |                :         V        :         |\n\t+-----------+     |                :   +-----------+  :         |\n\t|  DCookie  |-------------------------\u003e|  DObject  |  :         |\n\t+-----------+     |                :   +-----------+  :         |\n\t                  |                :                  :         |\n\t          +-------+-------+        :                  :         |\n\t          |               |        :                  :         |\n\t          V               V        :                  :         V\n\t    +-----------+   +-----------+  :                  :   +-----------+\n\t    |  DCookie  |   |  DCookie  |------------------------\u003e|  DObject  |\n\t    +-----------+   +-----------+  :                  :   +-----------+\n\t                                   :                  :\n\nIn the above illustration, ICookie and IObject represent indices and DCookie\nand DObject represent data storage objects.  Indices may have representation in\nmultiple caches, but currently, non-index objects may not.  Objects of any type\nmay also be entirely unrepresented.\n\nAs far as the netfs API goes, the netfs is only actually permitted to see\npointers to the cookies.  The cookies themselves and any objects attached to\nthose cookies are hidden from it.\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nOBJECT MANAGEMENT STATE MACHINE\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWithin FS-Cache, each active object is managed by its own individual state\nmachine.  The state for an object is kept in the fscache_object struct, in\nobject-\u003estate.  A cookie may point to a set of objects that are in different\nstates.\n\nEach state has an action associated with it that is invoked when the machine\nwakes up in that state.  There are four logical sets of states:\n\n (1) Preparation: states that wait for the parent objects to become ready.  The\n     representations are hierarchical, and it is expected that an object must\n     be created or accessed with respect to its parent object.\n\n (2) Initialisation: states that perform lookups in the cache and validate\n     what\u0027s found and that create on disk any missing metadata.\n\n (3) Normal running: states that allow netfs operations on objects to proceed\n     and that update the state of objects.\n\n (4) Termination: states that detach objects from their netfs cookies, that\n     delete objects from disk, that handle disk and system errors and that free\n     up in-memory resources.\n\nIn most cases, transitioning between states is in response to signalled events.\nWhen a state has finished processing, it will usually set the mask of events in\nwhich it is interested (object-\u003eevent_mask) and relinquish the worker thread.\nThen when an event is raised (by calling fscache_raise_event()), if the event\nis not masked, the object will be queued for processing (by calling\nfscache_enqueue_object()).\n\nPROVISION OF CPU TIME\n---------------------\n\nThe work to be done by the various states is given CPU time by the threads of\nthe slow work facility (see Documentation/slow-work.txt).  This is used in\npreference to the workqueue facility because:\n\n (1) Threads may be completely occupied for very long periods of time by a\n     particular work item.  These state actions may be doing sequences of\n     synchronous, journalled disk accesses (lookup, mkdir, create, setxattr,\n     getxattr, truncate, unlink, rmdir, rename).\n\n (2) Threads may do little actual work, but may rather spend a lot of time\n     sleeping on I/O.  This means that single-threaded and 1-per-CPU-threaded\n     workqueues don\u0027t necessarily have the right numbers of threads.\n\nLOCKING SIMPLIFICATION\n----------------------\n\nBecause only one worker thread may be operating on any particular object\u0027s\nstate machine at once, this simplifies the locking, particularly with respect\nto disconnecting the netfs\u0027s representation of a cache object (fscache_cookie)\nfrom the cache backend\u0027s representation (fscache_object) - which may be\nrequested from either end.\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nTHE SET OF STATES\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nThe object state machine has a set of states that it can be in.  There are\npreparation states in which the object sets itself up and waits for its parent\nobject to transit to a state that allows access to its children:\n\n (1) State FSCACHE_OBJECT_INIT.\n\n     Initialise the object and wait for the parent object to become active.  In\n     the cache, it is expected that it will not be possible to look an object\n     up from the parent object, until that parent object itself has been looked\n     up.\n\nThere are initialisation states in which the object sets itself up and accesses\ndisk for the object metadata:\n\n (2) State FSCACHE_OBJECT_LOOKING_UP.\n\n     Look up the object on disk, using the parent as a starting point.\n     FS-Cache expects the cache backend to probe the cache to see whether this\n     object is represented there, and if it is, to see if it\u0027s valid (coherency\n     management).\n\n     The cache should call fscache_object_lookup_negative() to indicate lookup\n     failure for whatever reason, and should call fscache_obtained_object() to\n     indicate success.\n\n     At the completion of lookup, FS-Cache will let the netfs go ahead with\n     read operations, no matter whether the file is yet cached.  If not yet\n     cached, read operations will be immediately rejected with ENODATA until\n     the first known page is uncached - as to that point there can be no data\n     to be read out of the cache for that file that isn\u0027t currently also held\n     in the pagecache.\n\n (3) State FSCACHE_OBJECT_CREATING.\n\n     Create an object on disk, using the parent as a starting point.  This\n     happens if the lookup failed to find the object, or if the object\u0027s\n     coherency data indicated what\u0027s on disk is out of date.  In this state,\n     FS-Cache expects the cache to create\n\n     The cache should call fscache_obtained_object() if creation completes\n     successfully, fscache_object_lookup_negative() otherwise.\n\n     At the completion of creation, FS-Cache will start processing write\n     operations the netfs has queued for an object.  If creation failed, the\n     write ops will be transparently discarded, and nothing recorded in the\n     cache.\n\nThere are some normal running states in which the object spends its time\nservicing netfs requests:\n\n (4) State FSCACHE_OBJECT_AVAILABLE.\n\n     A transient state in which pending operations are started, child objects\n     are permitted to advance from FSCACHE_OBJECT_INIT state, and temporary\n     lookup data is freed.\n\n (5) State FSCACHE_OBJECT_ACTIVE.\n\n     The normal running state.  In this state, requests the netfs makes will be\n     passed on to the cache.\n\n (6) State FSCACHE_OBJECT_UPDATING.\n\n     The state machine comes here to update the object in the cache from the\n     netfs\u0027s records.  This involves updating the auxiliary data that is used\n     to maintain coherency.\n\nAnd there are terminal states in which an object cleans itself up, deallocates\nmemory and potentially deletes stuff from disk:\n\n (7) State FSCACHE_OBJECT_LC_DYING.\n\n     The object comes here if it is dying because of a lookup or creation\n     error.  This would be due to a disk error or system error of some sort.\n     Temporary data is cleaned up, and the parent is released.\n\n (8) State FSCACHE_OBJECT_DYING.\n\n     The object comes here if it is dying due to an error, because its parent\n     cookie has been relinquished by the netfs or because the cache is being\n     withdrawn.\n\n     Any child objects waiting on this one are given CPU time so that they too\n     can destroy themselves.  This object waits for all its children to go away\n     before advancing to the next state.\n\n (9) State FSCACHE_OBJECT_ABORT_INIT.\n\n     The object comes to this state if it was waiting on its parent in\n     FSCACHE_OBJECT_INIT, but its parent died.  The object will destroy itself\n     so that the parent may proceed from the FSCACHE_OBJECT_DYING state.\n\n(10) State FSCACHE_OBJECT_RELEASING.\n(11) State FSCACHE_OBJECT_RECYCLING.\n\n     The object comes to one of these two states when dying once it is rid of\n     all its children, if it is dying because the netfs relinquished its\n     cookie.  In the first state, the cached data is expected to persist, and\n     in the second it will be deleted.\n\n(12) State FSCACHE_OBJECT_WITHDRAWING.\n\n     The object transits to this state if the cache decides it wants to\n     withdraw the object from service, perhaps to make space, but also due to\n     error or just because the whole cache is being withdrawn.\n\n(13) State FSCACHE_OBJECT_DEAD.\n\n     The object transits to this state when the in-memory object record is\n     ready to be deleted.  The object processor shouldn\u0027t ever see an object in\n     this state.\n\nTHE SET OF EVENTS\n-----------------\n\nThere are a number of events that can be raised to an object state machine:\n\n (*) FSCACHE_OBJECT_EV_UPDATE\n\n     The netfs requested that an object be updated.  The state machine will ask\n     the cache backend to update the object, and the cache backend will ask the\n     netfs for details of the change through its cookie definition ops.\n\n (*) FSCACHE_OBJECT_EV_CLEARED\n\n     This is signalled in two circumstances:\n\n     (a) when an object\u0027s last child object is dropped and\n\n     (b) when the last operation outstanding on an object is completed.\n\n     This is used to proceed from the dying state.\n\n (*) FSCACHE_OBJECT_EV_ERROR\n\n     This is signalled when an I/O error occurs during the processing of some\n     object.\n\n (*) FSCACHE_OBJECT_EV_RELEASE\n (*) FSCACHE_OBJECT_EV_RETIRE\n\n     These are signalled when the netfs relinquishes a cookie it was using.\n     The event selected depends on whether the netfs asks for the backing\n     object to be retired (deleted) or retained.\n\n (*) FSCACHE_OBJECT_EV_WITHDRAW\n\n     This is signalled when the cache backend wants to withdraw an object.\n     This means that the object will have to be detached from the netfs\u0027s\n     cookie.\n\nBecause the withdrawing releasing/retiring events are all handled by the object\nstate machine, it doesn\u0027t matter if there\u0027s a collision with both ends trying\nto sever the connection at the same time.  The state machine can just pick\nwhich one it wants to honour, and that effects the other.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Steve Dickson \u003csteved@redhat.com\u003e\nAcked-by: Trond Myklebust \u003cTrond.Myklebust@netapp.com\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nTested-by: Daire Byrne \u003cDaire.Byrne@framestore.com\u003e\n"
    },
    {
      "commit": "726dd7ff10c217dd74329c94643dc8ebea27334b",
      "tree": "9bd5b011f945fca4f1b057f7e7750414b1fd9fbd",
      "parents": [
        "955d00917f0c094e0f2fb88df967e980ab66b8ca"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:38 2009 +0100"
      },
      "committer": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:38 2009 +0100"
      },
      "message": "FS-Cache: Add netfs registration\n\nAdd functions to register and unregister a network filesystem or other client\nof the FS-Cache service.  This allocates and releases the cookie representing\nthe top-level index for a netfs, and makes it available to the netfs.\n\nIf the FS-Cache facility is disabled, then the calls are optimised away at\ncompile time.\n\nNote that whilst this patch may appear to work with FS-Cache enabled and a\nnetfs attempting to use it, it will leak the cookie it allocates for the netfs\nas fscache_relinquish_cookie() is implemented in a later patch.  This will\ncause the slab code to emit a warning when the module is removed.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Steve Dickson \u003csteved@redhat.com\u003e\nAcked-by: Trond Myklebust \u003cTrond.Myklebust@netapp.com\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nTested-by: Daire Byrne \u003cDaire.Byrne@framestore.com\u003e\n"
    },
    {
      "commit": "955d00917f0c094e0f2fb88df967e980ab66b8ca",
      "tree": "c6109684239fd45462e494fb4f26aa8e2e651922",
      "parents": [
        "4c515dd47ab41be3f89e757d441661795470b376"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:38 2009 +0100"
      },
      "committer": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:38 2009 +0100"
      },
      "message": "FS-Cache: Provide a slab for cookie allocation\n\nProvide a slab from which can be allocated the FS-Cache cookies that will be\npresented to the netfs.\n\nAlso provide a slab constructor and a function to recursively discard a cookie\nand its ancestor chain.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Steve Dickson \u003csteved@redhat.com\u003e\nAcked-by: Trond Myklebust \u003cTrond.Myklebust@netapp.com\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nTested-by: Daire Byrne \u003cDaire.Byrne@framestore.com\u003e\n"
    },
    {
      "commit": "0e04d4cefcf4d8fbbdb2c50e93ad541582933fd2",
      "tree": "97c4cda6a2c246660e6a5c718a9272375cdb259c",
      "parents": [
        "a6891645cf2ddd4778096848a864580e7258faba"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:37 2009 +0100"
      },
      "committer": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:37 2009 +0100"
      },
      "message": "FS-Cache: Add cache tag handling\n\nImplement two features of FS-Cache:\n\n (1) The ability to request and release cache tags - names by which a cache may\n     be known to a netfs, and thus selected for use.\n\n (2) An internal function by which a cache is selected by consulting the netfs,\n     if the netfs wishes to be consulted.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Steve Dickson \u003csteved@redhat.com\u003e\nAcked-by: Trond Myklebust \u003cTrond.Myklebust@netapp.com\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nTested-by: Daire Byrne \u003cDaire.Byrne@framestore.com\u003e\n"
    },
    {
      "commit": "a6891645cf2ddd4778096848a864580e7258faba",
      "tree": "e0095e8b87e199e7310508fc3687660746860600",
      "parents": [
        "7394daa8c61dfda4baa687f133748fa0b599b017"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:37 2009 +0100"
      },
      "committer": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:37 2009 +0100"
      },
      "message": "FS-Cache: Root index definition\n\nAdd a description of the root index of the cache for later patches to make use\nof.\n\nThe root index is owned by FS-Cache itself.  When a netfs requests caching\nfacilities, FS-Cache will, if one doesn\u0027t already exist, create an entry in\nthe root index with the key being the name of the netfs (\"AFS\" for example),\nand the auxiliary data holding the index structure version supplied by the\nnetfs:\n\n\t\t\t\t     FSDEF\n\t\t\t\t       |\n\t\t\t\t +-----------+\n\t\t\t\t |           |\n\t\t\t\tNFS         AFS\n\t\t\t       [v\u003d1]       [v\u003d1]\n\nIf an entry with the appropriate name does already exist, the version is\ncompared.  If the version is different, the entire subtree from that entry\nwill be discarded and a new entry created.\n\nThe new entry will be an index, and a cookie referring to it will be passed to\nthe netfs.  This is then the root handle by which the netfs accesses the\ncache.  It can create whatever objects it likes in that index, including\nfurther indices.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Steve Dickson \u003csteved@redhat.com\u003e\nAcked-by: Trond Myklebust \u003cTrond.Myklebust@netapp.com\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nTested-by: Daire Byrne \u003cDaire.Byrne@framestore.com\u003e\n"
    },
    {
      "commit": "7394daa8c61dfda4baa687f133748fa0b599b017",
      "tree": "32d2c55ed60596918ec62ce6ecca186337bf4660",
      "parents": [
        "06b3db1b9bccdc8c2c743122a89745279e5ecc46"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:37 2009 +0100"
      },
      "committer": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:37 2009 +0100"
      },
      "message": "FS-Cache: Add use of /proc and presentation of statistics\n\nMake FS-Cache create its /proc interface and present various statistical\ninformation through it.  Also provide the functions for updating this\ninformation.\n\nThese features are enabled by:\n\n\tCONFIG_FSCACHE_PROC\n\tCONFIG_FSCACHE_STATS\n\tCONFIG_FSCACHE_HISTOGRAM\n\nThe /proc directory for FS-Cache is also exported so that caching modules can\nadd their own statistics there too.\n\nThe FS-Cache module is loadable at this point, and the statistics files can be\nexamined by userspace:\n\n\tcat /proc/fs/fscache/stats\n\tcat /proc/fs/fscache/histogram\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Steve Dickson \u003csteved@redhat.com\u003e\nAcked-by: Trond Myklebust \u003cTrond.Myklebust@netapp.com\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nTested-by: Daire Byrne \u003cDaire.Byrne@framestore.com\u003e\n"
    },
    {
      "commit": "06b3db1b9bccdc8c2c743122a89745279e5ecc46",
      "tree": "b60850bd899c1a87b5b372cfbf1e72cf380c862a",
      "parents": [
        "0dfc41d1efcc4180abfd32f68f0ade540e636ff6"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:36 2009 +0100"
      },
      "committer": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Apr 03 16:42:36 2009 +0100"
      },
      "message": "FS-Cache: Add main configuration option, module entry points and debugging\n\nAdd the main configuration option, allowing FS-Cache to be selected; the\nmodule entry and exit functions and the debugging stuff used by these patches.\n\nThe two configuration options added are:\n\n\tCONFIG_FSCACHE\n\tCONFIG_FSCACHE_DEBUG\n\nThe first enables the facility, and the second makes the debugging statements\nenableable through the \"debug\" module parameter.  The value of this parameter\nis a bitmask as described in:\n\n\tDocumentation/filesystems/caching/fscache.txt\n\nThe module can be loaded at this point, but all it will do at this point in\nthe patch series is to start up the slow work facility and shut it down again.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Steve Dickson \u003csteved@redhat.com\u003e\nAcked-by: Trond Myklebust \u003cTrond.Myklebust@netapp.com\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nTested-by: Daire Byrne \u003cDaire.Byrne@framestore.com\u003e\n"
    }
  ]
}
