<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/fuse/dev.c, branch v4.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-04-04T17:41:08Z</updated>
<entry>
<title>mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros</title>
<updated>2016-04-04T17:41:08Z</updated>
<author>
<name>Kirill A. Shutemov</name>
<email>kirill.shutemov@linux.intel.com</email>
</author>
<published>2016-04-01T12:29:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=09cbfeaf1a5a67bfb3201e0c83c810cecb2efa5a'/>
<id>urn:sha1:09cbfeaf1a5a67bfb3201e0c83c810cecb2efa5a</id>
<content type='text'>
PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
ago with promise that one day it will be possible to implement page
cache with bigger chunks than PAGE_SIZE.

This promise never materialized.  And unlikely will.

We have many places where PAGE_CACHE_SIZE assumed to be equal to
PAGE_SIZE.  And it's constant source of confusion on whether
PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
especially on the border between fs and mm.

Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
breakage to be doable.

Let's stop pretending that pages in page cache are special.  They are
not.

The changes are pretty straight-forward:

 - &lt;foo&gt; &lt;&lt; (PAGE_CACHE_SHIFT - PAGE_SHIFT) -&gt; &lt;foo&gt;;

 - &lt;foo&gt; &gt;&gt; (PAGE_CACHE_SHIFT - PAGE_SHIFT) -&gt; &lt;foo&gt;;

 - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -&gt; PAGE_{SIZE,SHIFT,MASK,ALIGN};

 - page_cache_get() -&gt; get_page();

 - page_cache_release() -&gt; put_page();

This patch contains automated changes generated with coccinelle using
script below.  For some reason, coccinelle doesn't patch header files.
I've called spatch for them manually.

The only adjustment after coccinelle is revert of changes to
PAGE_CAHCE_ALIGN definition: we are going to drop it later.

There are few places in the code where coccinelle didn't reach.  I'll
fix them manually in a separate patch.  Comments and documentation also
will be addressed with the separate patch.

virtual patch

@@
expression E;
@@
- E &lt;&lt; (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E

@@
expression E;
@@
- E &gt;&gt; (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E

@@
@@
- PAGE_CACHE_SHIFT
+ PAGE_SHIFT

@@
@@
- PAGE_CACHE_SIZE
+ PAGE_SIZE

@@
@@
- PAGE_CACHE_MASK
+ PAGE_MASK

@@
expression E;
@@
- PAGE_CACHE_ALIGN(E)
+ PAGE_ALIGN(E)

@@
expression E;
@@
- page_cache_get(E)
+ get_page(E)

@@
expression E;
@@
- page_cache_release(E)
+ put_page(E)

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs/fuse: fix ioctl type confusion</title>
<updated>2015-08-16T19:35:44Z</updated>
<author>
<name>Jann Horn</name>
<email>jann@thejh.net</email>
</author>
<published>2015-08-16T18:27:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ed1f0e22f49ef42e63875fd2529389a32ff3566'/>
<id>urn:sha1:8ed1f0e22f49ef42e63875fd2529389a32ff3566</id>
<content type='text'>
fuse_dev_ioctl() performed fuse_get_dev() on a user-supplied fd,
leading to a type confusion issue. Fix it by checking file-&gt;f_op.

Signed-off-by: Jann Horn &lt;jann@thejh.net&gt;
Acked-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fuse: separate pqueue for clones</title>
<updated>2015-07-01T14:26:09Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-07-01T14:26:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c3696046beb3a4479715b48f67f6a8a3aef4b3bb'/>
<id>urn:sha1:c3696046beb3a4479715b48f67f6a8a3aef4b3bb</id>
<content type='text'>
Make each fuse device clone refer to a separate processing queue.  The only
constraint on userspace code is that the request answer must be written to
the same device clone as it was read off.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: introduce per-instance fuse_dev structure</title>
<updated>2015-07-01T14:26:08Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-07-01T14:26:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cc080e9e9be16ccf26135d366d7d2b65209f1d56'/>
<id>urn:sha1:cc080e9e9be16ccf26135d366d7d2b65209f1d56</id>
<content type='text'>
Allow fuse device clones to refer to be distinguished.  This patch just
adds the infrastructure by associating a separate "struct fuse_dev" with
each clone.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Reviewed-by: Ashish Samant &lt;ashish.samant@oracle.com&gt;
</content>
</entry>
<entry>
<title>fuse: device fd clone</title>
<updated>2015-07-01T14:26:08Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-07-01T14:26:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=00c570f4ba43ae73b41fa0a2269c3b0ac20386ef'/>
<id>urn:sha1:00c570f4ba43ae73b41fa0a2269c3b0ac20386ef</id>
<content type='text'>
Allow an open fuse device to be "cloned".  Userspace can create a clone by:

      newfd = open("/dev/fuse", O_RDWR)
      ioctl(newfd, FUSE_DEV_IOC_CLONE, &amp;oldfd);

At this point newfd will refer to the same fuse connection as oldfd.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Reviewed-by: Ashish Samant &lt;ashish.samant@oracle.com&gt;
</content>
</entry>
<entry>
<title>fuse: abort: no fc-&gt;lock needed for request ending</title>
<updated>2015-07-01T14:26:08Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-07-01T14:26:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ee314a870e402f4e63b8a651bc96c740ed69cb31'/>
<id>urn:sha1:ee314a870e402f4e63b8a651bc96c740ed69cb31</id>
<content type='text'>
In fuse_abort_conn() when all requests are on private lists we no longer
need fc-&gt;lock protection.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Reviewed-by: Ashish Samant &lt;ashish.samant@oracle.com&gt;
</content>
</entry>
<entry>
<title>fuse: no fc-&gt;lock for pqueue parts</title>
<updated>2015-07-01T14:26:07Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-07-01T14:26:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=46c34a348b0ac74fc9646de8ef0c5b8b29f09da9'/>
<id>urn:sha1:46c34a348b0ac74fc9646de8ef0c5b8b29f09da9</id>
<content type='text'>
Remove fc-&gt;lock protection from processing queue members, now protected by
fpq-&gt;lock.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Reviewed-by: Ashish Samant &lt;ashish.samant@oracle.com&gt;
</content>
</entry>
<entry>
<title>fuse: no fc-&gt;lock in request_end()</title>
<updated>2015-07-01T14:26:07Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-07-01T14:26:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=efe2800facb4505696e602ec4ed1fc947bf114dd'/>
<id>urn:sha1:efe2800facb4505696e602ec4ed1fc947bf114dd</id>
<content type='text'>
No longer need to call request_end() with the connection lock held.  We
still protect the background counters and queue with fc-&gt;lock, so acquire
it if necessary.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Reviewed-by: Ashish Samant &lt;ashish.samant@oracle.com&gt;
</content>
</entry>
<entry>
<title>fuse: cleanup request_end()</title>
<updated>2015-07-01T14:26:07Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-07-01T14:26:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1e6881c36ebbfd47298c42fa82b544c4988933fa'/>
<id>urn:sha1:1e6881c36ebbfd47298c42fa82b544c4988933fa</id>
<content type='text'>
Now that we atomically test having already done everything we no longer
need other protection.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Reviewed-by: Ashish Samant &lt;ashish.samant@oracle.com&gt;
</content>
</entry>
<entry>
<title>fuse: request_end(): do once</title>
<updated>2015-07-01T14:26:06Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2015-07-01T14:26:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=365ae710df91edc97d24817e3271e01bffaaee32'/>
<id>urn:sha1:365ae710df91edc97d24817e3271e01bffaaee32</id>
<content type='text'>
When the connection is aborted it is possible that request_end() will be
called twice.  Use atomic test and set to do the actual ending only once.

test_and_set_bit() also provides the necessary barrier semantics so no
explicit smp_wmb() is necessary.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Reviewed-by: Ashish Samant &lt;ashish.samant@oracle.com&gt;
</content>
</entry>
</feed>
