]> git.karo-electronics.de Git - karo-tx-linux.git/commit
fs/pipe.c: add ->statfs callback for pipefs
authorPavel Emelyanov <xemul@parallels.com>
Mon, 24 Oct 2011 14:58:34 +0000 (01:58 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 25 Oct 2011 09:07:55 +0000 (20:07 +1100)
commitc56ddf6f4ce91370734001e359f0c9c484991732
treed5c69532c20473e242b4a55d2415db8b7528a1eb
parent5b1ea4da43508f3ef38c8a2b7b3507e3777a683e
fs/pipe.c: add ->statfs callback for pipefs

Currently a statfs on a pipe's /proc/<pid>/fd/ link returns -ENOSYS.  Wire
pipfs up so that the statfs succeeds.

This is required by checkpoint-restart in the userspace to make it
possible to distinguish pipes from fifos.

When we dump information about task's open files we use the /proc/pid/fd
directoy's symlinks and the fact that opening any of them gives us exactly
the same dentry->inode pair as the original process has.  Now if a task
we're dumping has opened pipe and fifo we need to detect this and act
accordingly.  Knowing that an fd with type S_ISFIFO resides on a pipefs is
the most precise way.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Reviewed-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/pipe.c