summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2005-09-28 22:32:57 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-29 08:46:26 -0700
commit666002218d59db271e5c1ede1d80227170c51987 (patch)
tree1fadcb278c817ce56a653e5c3c58637f5056feec /net/core
parentecba97d4aacf4e80c56eb73e39af0369cb8539a4 (diff)
downloadop-kernel-dev-666002218d59db271e5c1ede1d80227170c51987.zip
op-kernel-dev-666002218d59db271e5c1ede1d80227170c51987.tar.gz
[PATCH] proc_mkdir() should be used to create procfs directories
A bunch of create_proc_dir_entry() calls creating directories had crept in since the last sweep; converted to proc_mkdir(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/pktgen.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index ef430b1e..b7f2d65 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -186,7 +186,7 @@
/* Used to help with determining the pkts on receive */
#define PKTGEN_MAGIC 0xbe9be955
-#define PG_PROC_DIR "pktgen"
+#define PG_PROC_DIR "net/pktgen"
#define MAX_CFLOWS 65536
@@ -1476,18 +1476,7 @@ static int proc_thread_write(struct file *file, const char __user *user_buffer,
static int create_proc_dir(void)
{
- int len;
- /* does proc_dir already exists */
- len = strlen(PG_PROC_DIR);
-
- for (pg_proc_dir = proc_net->subdir; pg_proc_dir; pg_proc_dir=pg_proc_dir->next) {
- if ((pg_proc_dir->namelen == len) &&
- (! memcmp(pg_proc_dir->name, PG_PROC_DIR, len)))
- break;
- }
-
- if (!pg_proc_dir)
- pg_proc_dir = create_proc_entry(PG_PROC_DIR, S_IFDIR, proc_net);
+ pg_proc_dir = proc_mkdir(PG_PROC_DIR, NULL);
if (!pg_proc_dir)
return -ENODEV;
@@ -1497,7 +1486,7 @@ static int create_proc_dir(void)
static int remove_proc_dir(void)
{
- remove_proc_entry(PG_PROC_DIR, proc_net);
+ remove_proc_entry(PG_PROC_DIR, NULL);
return 0;
}
@@ -2908,7 +2897,7 @@ static int pktgen_add_device(struct pktgen_thread *t, const char* ifname)
pkt_dev->udp_dst_max = 9;
strncpy(pkt_dev->ifname, ifname, 31);
- sprintf(pkt_dev->fname, "net/%s/%s", PG_PROC_DIR, ifname);
+ sprintf(pkt_dev->fname, "%s/%s", PG_PROC_DIR, ifname);
if (! pktgen_setup_dev(pkt_dev)) {
printk("pktgen: ERROR: pktgen_setup_dev failed.\n");
@@ -2981,7 +2970,7 @@ static int pktgen_create_thread(const char* name, int cpu)
spin_lock_init(&t->if_lock);
t->cpu = cpu;
- sprintf(t->fname, "net/%s/%s", PG_PROC_DIR, t->name);
+ sprintf(t->fname, "%s/%s", PG_PROC_DIR, t->name);
t->proc_ent = create_proc_entry(t->fname, 0600, NULL);
if (!t->proc_ent) {
printk("pktgen: cannot create %s procfs entry.\n", t->fname);
@@ -3064,7 +3053,7 @@ static int __init pg_init(void)
create_proc_dir();
- sprintf(module_fname, "net/%s/pgctrl", PG_PROC_DIR);
+ sprintf(module_fname, "%s/pgctrl", PG_PROC_DIR);
module_proc_ent = create_proc_entry(module_fname, 0600, NULL);
if (!module_proc_ent) {
printk("pktgen: ERROR: cannot create %s procfs entry.\n", module_fname);
OpenPOWER on IntegriCloud