]> git.karo-electronics.de Git - karo-tx-linux.git/commit
fs/pipe.c: add ->statfs callback for pipefs
authorPavel Emelyanov <xemul@parallels.com>
Wed, 28 Sep 2011 00:50:30 +0000 (10:50 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 30 Sep 2011 04:53:32 +0000 (14:53 +1000)
commiteb4c3b4848f8daaa709cbfa33564e5cb5a3f250b
tree0d2a5f8fd9571092170b7e4d4c772500a1c6fa6b
parent30789cd17f493e9505bbf060ebadd7dc33061394
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 <>
fs/pipe.c