diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-03-12 16:08:09 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-03-12 16:08:09 -0400 |
| commit | 609eb39c8d8a8d2930780428f6cbe2f63eb84734 (patch) | |
| tree | 0cf74a0e6e64531b31c5a1c9d45fbcb88f5e4d1f /fs/proc/generic.c | |
| parent | 123d43acd2e55cd7db792d17c7e906db42cada42 (diff) | |
| parent | 22626216c46f2ec86287e75ea86dd9ac3df54265 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits)
[SCTP]: Fix local_addr deletions during list traversals.
net: fix build with CONFIG_NET=n
[TCP]: Prevent sending past receiver window with TSO (at last skb)
rt2x00: Add new D-Link USB ID
rt2x00: never disable multicast because it disables broadcast too
libertas: fix the 'compare command with itself' properly
drivers/net/Kconfig: fix whitespace for GELIC_WIRELESS entry
[NETFILTER]: nf_queue: don't return error when unregistering a non-existant handler
[NETFILTER]: nfnetlink_queue: fix EPERM when binding/unbinding and instance 0 exists
[NETFILTER]: nfnetlink_log: fix EPERM when binding/unbinding and instance 0 exists
[NETFILTER]: nf_conntrack: replace horrible hack with ksize()
[NETFILTER]: nf_conntrack: add \n to "expectation table full" message
[NETFILTER]: xt_time: fix failure to match on Sundays
[NETFILTER]: nfnetlink_log: fix computation of netlink skb size
[NETFILTER]: nfnetlink_queue: fix computation of allocated size for netlink skb.
[NETFILTER]: nfnetlink: fix ifdef in nfnetlink_compat.h
[NET]: include <linux/types.h> into linux/ethtool.h for __u* typedef
[NET]: Make /proc/net a symlink on /proc/self/net (v3)
RxRPC: fix rxrpc_recvmsg()'s returning of msg_name
net/enc28j60: oops fix
...
Diffstat (limited to 'fs/proc/generic.c')
| -rw-r--r-- | fs/proc/generic.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 68971e66cd41..a36ad3c75cf4 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
| @@ -377,15 +377,14 @@ static struct dentry_operations proc_dentry_operations = | |||
| 377 | * Don't create negative dentries here, return -ENOENT by hand | 377 | * Don't create negative dentries here, return -ENOENT by hand |
| 378 | * instead. | 378 | * instead. |
| 379 | */ | 379 | */ |
| 380 | struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) | 380 | struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir, |
| 381 | struct dentry *dentry) | ||
| 381 | { | 382 | { |
| 382 | struct inode *inode = NULL; | 383 | struct inode *inode = NULL; |
| 383 | struct proc_dir_entry * de; | ||
| 384 | int error = -ENOENT; | 384 | int error = -ENOENT; |
| 385 | 385 | ||
| 386 | lock_kernel(); | 386 | lock_kernel(); |
| 387 | spin_lock(&proc_subdir_lock); | 387 | spin_lock(&proc_subdir_lock); |
| 388 | de = PDE(dir); | ||
| 389 | if (de) { | 388 | if (de) { |
| 390 | for (de = de->subdir; de ; de = de->next) { | 389 | for (de = de->subdir; de ; de = de->next) { |
| 391 | if (de->namelen != dentry->d_name.len) | 390 | if (de->namelen != dentry->d_name.len) |
| @@ -393,8 +392,6 @@ struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nam | |||
| 393 | if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { | 392 | if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { |
| 394 | unsigned int ino; | 393 | unsigned int ino; |
| 395 | 394 | ||
| 396 | if (de->shadow_proc) | ||
| 397 | de = de->shadow_proc(current, de); | ||
| 398 | ino = de->low_ino; | 395 | ino = de->low_ino; |
| 399 | de_get(de); | 396 | de_get(de); |
| 400 | spin_unlock(&proc_subdir_lock); | 397 | spin_unlock(&proc_subdir_lock); |
| @@ -417,6 +414,12 @@ out_unlock: | |||
| 417 | return ERR_PTR(error); | 414 | return ERR_PTR(error); |
| 418 | } | 415 | } |
| 419 | 416 | ||
| 417 | struct dentry *proc_lookup(struct inode *dir, struct dentry *dentry, | ||
| 418 | struct nameidata *nd) | ||
| 419 | { | ||
| 420 | return proc_lookup_de(PDE(dir), dir, dentry); | ||
| 421 | } | ||
| 422 | |||
| 420 | /* | 423 | /* |
| 421 | * This returns non-zero if at EOF, so that the /proc | 424 | * This returns non-zero if at EOF, so that the /proc |
| 422 | * root directory can use this and check if it should | 425 | * root directory can use this and check if it should |
| @@ -426,10 +429,9 @@ out_unlock: | |||
| 426 | * value of the readdir() call, as long as it's non-negative | 429 | * value of the readdir() call, as long as it's non-negative |
| 427 | * for success.. | 430 | * for success.. |
| 428 | */ | 431 | */ |
| 429 | int proc_readdir(struct file * filp, | 432 | int proc_readdir_de(struct proc_dir_entry *de, struct file *filp, void *dirent, |
| 430 | void * dirent, filldir_t filldir) | 433 | filldir_t filldir) |
| 431 | { | 434 | { |
| 432 | struct proc_dir_entry * de; | ||
| 433 | unsigned int ino; | 435 | unsigned int ino; |
| 434 | int i; | 436 | int i; |
| 435 | struct inode *inode = filp->f_path.dentry->d_inode; | 437 | struct inode *inode = filp->f_path.dentry->d_inode; |
| @@ -438,7 +440,6 @@ int proc_readdir(struct file * filp, | |||
| 438 | lock_kernel(); | 440 | lock_kernel(); |
| 439 | 441 | ||
| 440 | ino = inode->i_ino; | 442 | ino = inode->i_ino; |
| 441 | de = PDE(inode); | ||
| 442 | if (!de) { | 443 | if (!de) { |
| 443 | ret = -EINVAL; | 444 | ret = -EINVAL; |
| 444 | goto out; | 445 | goto out; |
| @@ -499,6 +500,13 @@ out: unlock_kernel(); | |||
| 499 | return ret; | 500 | return ret; |
| 500 | } | 501 | } |
| 501 | 502 | ||
| 503 | int proc_readdir(struct file *filp, void *dirent, filldir_t filldir) | ||
| 504 | { | ||
| 505 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
| 506 | |||
| 507 | return proc_readdir_de(PDE(inode), filp, dirent, filldir); | ||
| 508 | } | ||
| 509 | |||
| 502 | /* | 510 | /* |
| 503 | * These are the generic /proc directory operations. They | 511 | * These are the generic /proc directory operations. They |
| 504 | * use the in-memory "struct proc_dir_entry" tree to parse | 512 | * use the in-memory "struct proc_dir_entry" tree to parse |
