lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 02 Apr 2009 17:48:38 +0100
From:	David Howells <dhowells@...hat.com>
To:	Nick Piggin <nickpiggin@...oo.com.au>
Cc:	dhowells@...hat.com, viro@...iv.linux.org.uk, nfsv4@...ux-nfs.org,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: What I mean by a 'netfs' when dealing with FS-Cache


I think I see the problem.  I think you're misunderstanding what I mean by
netfs.

Note that when I say 'netfs' I don't necessarily _mean_ it has to be a network
fs.  It could be NFS, AFS, CIFS, but it might also be ISO9660.  Look at these
two diagrams (taken from the docs added by patch 07):

	+---------+
	|         |                        +--------------+
	|   NFS   |--+                     |              |
	|         |  |                 +-->|   CacheFS    |
	+---------+  |   +----------+  |   |  /dev/hda5   |
	             |   |          |  |   +--------------+
	+---------+  +-->|          |  |
	|         |      |          |--+
	|   AFS   |----->| FS-Cache |
	|         |      |          |--+
	+---------+  +-->|          |  |
	             |   |          |  |   +--------------+
	+---------+  |   +----------+  |   |              |
	|         |  |                 +-->|  CacheFiles  |
	|  ISOFS  |--+                     |  /var/cache  |
	|         |                        +--------------+
	+---------+

NFS, AFS and ISOFS in this diagram all fill the roll of 'netfs'.  CacheFS
(cache on blockdev) and CacheFiles (cache on filesystem) fill the roll of
'backingfs'.

And:

	+---------+
	|         |
	| Server  |
	|         |
	+---------+
	     |                  NETWORK
	~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	     |
	     |           +----------+
	     V           |          |
	+---------+      |          |
	|         |      |          |
	|   NFS   |----->| FS-Cache |
	|         |      |          |--+
	+---------+      |          |  |   +--------------+   +--------------+
	     |           |          |  |   |              |   |              |
	     V           +----------+  +-->|  CacheFiles  |-->|  Ext3        |
	+---------+                        |  /var/cache  |   |  /dev/sda6   |
	|         |                        +--------------+   +--------------+
	|   VFS   |                                ^                     ^
	|         |                                |                     |
	+---------+                                +--------------+      |
	     |                  KERNEL SPACE                      |      |
	~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~|~~~~
	     |                  USER SPACE                        |      |
	     V                                                    |      |
	+---------+                                           +--------------+
	|         |                                           |              |
	| Process |                                           | cachefilesd  |
	|         |                                           |              |
	+---------+                                           +--------------+


FS-Cache tracks pages from the 'netfs' because it may want to keep metadata on
them (such as where in the backingfs the pages are to be stored).  In many
ways, PG_fscache is equivalent of PG_mappedtodisk.  You could think of it as
PG_mappedtocache if you like.

The procedure for the netfs to use the cache on a page is that it calls one
of:

	fscache_read_or_alloc_page()
	fscache_read_or_alloc_pages()
	fscache_alloc_page()

to either read pages from the cache or reserve space in the cache into which
the page can be written.

Then, the netfs calls:

	fscache_write_page()

to write pages back to the cache as often as it likes.  This may only be
called if read/alloc has been called first, and is permitted, inside the
caching backend (eg CacheFiles), to cache metadata about the read/alloc.

Finally, to polish off, the netfs calls:

	fscache_uncache_page()

to tell FS-Cache to release any metadata it might hold on that page.

As I've been saying, I want to be able to make iso9660 be a client of FS-Cache
- ie: fill the roll of a netfs.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ