<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 1, 2014 at 6:07 AM, Vimal A R <span dir="ltr">&lt;<a href="mailto:arvimal@yahoo.in" target="_blank">arvimal@yahoo.in</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello fuse-devel / fs-cache / gluster-devel lists,<br>
<br>
I would like to propose the idea of implementing FS-Cache support in the fuse kernel module, which I am planning to do as part of my UG university course. This proposal is by no means final, since I have just started to look into this.<br>

<br>
There are several user-space filesystems which are based on the FUSE kernel module. As of now, if I understand correct, the only networked filesystems having FS-Cache support are NFS and AFS.<br>
<br>
Implementing support hooks for fs-cache in the fuse module would provide networked filesystems such as GlusterFS the benefit of  a client-side caching mechanism, which should decrease the access times.<br></blockquote><div>
<br></div><div>If you are planning to test this with GlusterFS, note that one of the first challenges would be to have persistent filehandles in FUSE. While GlusterFS has a notion of a persistent handle (GFID, 128bit) which is constant across clients and remounts, the FUSE kernel module is presented a transient LONG (64/32 bit) which is specific to the mount instance (actually, the address of the userspace inode_t within glusterfs process - allows for constant time filehandle resolution).</div>
<div><br></div><div>This would be a challenge with any FUSE based filesystem which has persistent filehandles larger than 64bit.</div><div><br></div><div>Thanks</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

When enabled, FS-Cache would maintain a virtual indexing tree to cache the data or object-types per network FS. Indices in the tree are used by FS-Cache to find objects faster. The tree or index structure under the main network FS index depends on the filesystem. Cookies are used to represent the indices, the pages etc..<br>

<br>
The tree structure would be as following:<br>
<br>
a) The virtual index tree maintained by fs-cache would look like:<br>
<br>
* FS-Cache master index -&gt; The network-filesystem indice (NFS/AFS etc..) -&gt; per-share indices -&gt; File-handle indices -&gt; Page indices<br>
<br>
b) In case of FUSE-based filesystems, the tree would be similar to :<br>
<br>
* FS-Cache master index -&gt; FUSE indice -&gt; Per FS indices -&gt; file-handle indices -&gt; page indices.<br>
<br>
c) In case of FUSE based filesystems as GlusterFS, the tree would as :<br>
<br>
* FS-Cache master index -&gt; FUSE indice (fuse.glusterfs) -&gt; GlusterFS volume ID (a UUID exists for each volume) - &gt; GlusterFS file-handle indices (based on the GFID of a file) -&gt; page indices.<br>
<br>
The idea is to enable FUSE to work with the FS-Cache network filesystem API, which is documented at &#39;<a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/caching/netfs-api.txt" target="_blank">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/caching/netfs-api.txt</a>&#39;.<br>

<br>
The implementation of FS-Cache support in NFS can be taken as a guideline to understand and start off.<br>
<br>
I will reply to this mail with any other updates that would come up whilst pursuing this further. I request any sort of feedback/suggestions, ideas, any pitfalls etc.. that can help in taking this further.<br>
<br>
Thank you,<br>
<br>
Vimal<br>
<br>
References:<br>
* <a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/caching/fscache.txt" target="_blank">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/caching/fscache.txt</a><br>

* <a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/caching/netfs-api.txt" target="_blank">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/caching/netfs-api.txt</a><br>

* <a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/caching/object.txt" target="_blank">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/caching/object.txt</a><br>

* <a href="http://people.redhat.com/dhowells/fscache/FS-Cache.pdf" target="_blank">http://people.redhat.com/dhowells/fscache/FS-Cache.pdf</a><br>
* <a href="http://people.redhat.com/steved/fscache/docs/HOWTO.txt" target="_blank">http://people.redhat.com/steved/fscache/docs/HOWTO.txt</a><br>
* <a href="https://en.wikipedia.org/wiki/CacheFS" target="_blank">https://en.wikipedia.org/wiki/CacheFS</a><br>
* <a href="https://lwn.net/Articles/160122/" target="_blank">https://lwn.net/Articles/160122/</a><br>
* <a href="http://www.linux-mag.com/id/7378/" target="_blank">http://www.linux-mag.com/id/7378/</a><br>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
<a href="http://supercolony.gluster.org/mailman/listinfo/gluster-devel" target="_blank">http://supercolony.gluster.org/mailman/listinfo/gluster-devel</a><br>
</blockquote></div><br></div></div>