From: Pavel Emelyanov Date: Wed, 28 Sep 2011 00:50:30 +0000 (+1000) Subject: fs/pipe.c: add ->statfs callback for pipefs X-Git-Tag: next-20111004~1^2~117 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=436b25879226fe8c0a24ea9ffece3904c29781e2;p=karo-tx-linux.git fs/pipe.c: add ->statfs callback for pipefs Currently a statfs on a pipe's /proc//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 Reviewed-by: Tejun Heo Acked-by: Serge Hallyn Signed-off-by: Cyrill Gorcunov Cc: Al Viro Signed-off-by: Andrew Morton <> --- diff --git a/fs/pipe.c b/fs/pipe.c index 0e0be1dc0f8e..4065f07366b3 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -1254,6 +1254,7 @@ out: static const struct super_operations pipefs_ops = { .destroy_inode = free_inode_nonrcu, + .statfs = simple_statfs, }; /*