From d86bc17d12c84e57cba43fbeebc091508be1f439 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 6 Sep 2005 15:17:18 -0700 Subject: [PATCH] --- yaml --- r: 7371 b: refs/heads/master c: 2b579beec255d6589fabe51b60933d723630bcd4 h: refs/heads/master i: 7369: 26bc7d92e16668c18e6485e3f2b0a3aa5a89f480 7367: 2d8e76ee23cd90bd45cdefa9b77dc90de118452c v: v3 --- [refs] | 2 +- trunk/fs/proc/generic.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index d0082ce4814d..c669bc806d51 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 230649da7cb73914b8b2a1ffc802a2951e970454 +refs/heads/master: 2b579beec255d6589fabe51b60933d723630bcd4 diff --git a/trunk/fs/proc/generic.c b/trunk/fs/proc/generic.c index abe8920313fb..8a8c34461d48 100644 --- a/trunk/fs/proc/generic.c +++ b/trunk/fs/proc/generic.c @@ -249,6 +249,18 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr) return error; } +static int proc_getattr(struct vfsmount *mnt, struct dentry *dentry, + struct kstat *stat) +{ + struct inode *inode = dentry->d_inode; + struct proc_dir_entry *de = PROC_I(inode)->pde; + if (de && de->nlink) + inode->i_nlink = de->nlink; + + generic_fillattr(inode, stat); + return 0; +} + static struct inode_operations proc_file_inode_operations = { .setattr = proc_notify_change, }; @@ -475,6 +487,7 @@ static struct file_operations proc_dir_operations = { */ static struct inode_operations proc_dir_inode_operations = { .lookup = proc_lookup, + .getattr = proc_getattr, .setattr = proc_notify_change, };