diff options
Diffstat (limited to 'fs/proc/generic.c')
| -rw-r--r-- | fs/proc/generic.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 6c6315d04028..8a8c34461d48 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
| @@ -249,6 +249,18 @@ out: | |||
| 249 | return error; | 249 | return error; |
| 250 | } | 250 | } |
| 251 | 251 | ||
| 252 | static int proc_getattr(struct vfsmount *mnt, struct dentry *dentry, | ||
| 253 | struct kstat *stat) | ||
| 254 | { | ||
| 255 | struct inode *inode = dentry->d_inode; | ||
| 256 | struct proc_dir_entry *de = PROC_I(inode)->pde; | ||
| 257 | if (de && de->nlink) | ||
| 258 | inode->i_nlink = de->nlink; | ||
| 259 | |||
| 260 | generic_fillattr(inode, stat); | ||
| 261 | return 0; | ||
| 262 | } | ||
| 263 | |||
| 252 | static struct inode_operations proc_file_inode_operations = { | 264 | static struct inode_operations proc_file_inode_operations = { |
| 253 | .setattr = proc_notify_change, | 265 | .setattr = proc_notify_change, |
| 254 | }; | 266 | }; |
| @@ -329,10 +341,10 @@ static void release_inode_number(unsigned int inum) | |||
| 329 | spin_unlock(&proc_inum_lock); | 341 | spin_unlock(&proc_inum_lock); |
| 330 | } | 342 | } |
| 331 | 343 | ||
| 332 | static int proc_follow_link(struct dentry *dentry, struct nameidata *nd) | 344 | static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd) |
| 333 | { | 345 | { |
| 334 | nd_set_link(nd, PDE(dentry->d_inode)->data); | 346 | nd_set_link(nd, PDE(dentry->d_inode)->data); |
| 335 | return 0; | 347 | return NULL; |
| 336 | } | 348 | } |
| 337 | 349 | ||
| 338 | static struct inode_operations proc_link_inode_operations = { | 350 | static struct inode_operations proc_link_inode_operations = { |
| @@ -475,6 +487,7 @@ static struct file_operations proc_dir_operations = { | |||
| 475 | */ | 487 | */ |
| 476 | static struct inode_operations proc_dir_inode_operations = { | 488 | static struct inode_operations proc_dir_inode_operations = { |
| 477 | .lookup = proc_lookup, | 489 | .lookup = proc_lookup, |
| 490 | .getattr = proc_getattr, | ||
| 478 | .setattr = proc_notify_change, | 491 | .setattr = proc_notify_change, |
| 479 | }; | 492 | }; |
| 480 | 493 | ||
