[PATCH 0/12] Further PDE->data assignments cleanups - Kernel

This is a discussion on [PATCH 0/12] Further PDE->data assignments cleanups - Kernel ; This set of patches replaces proc_create/etc and further PDE->data assignment mostly with proc_data_create. Signed-off-by: Denis V. Lunev -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 27

Thread: [PATCH 0/12] Further PDE->data assignments cleanups

  1. [PATCH 0/12] Further PDE->data assignments cleanups

    This set of patches replaces proc_create/etc and further PDE->data
    assignment mostly with proc_data_create.

    Signed-off-by: Denis V. Lunev

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. [PATCH 4/12] ipv6: assign PDE->data before gluing PDE into /proc tree

    Simply replace proc_create and further data assigned with proc_create_data.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    Cc: Hideaki YOSHIFUJI
    ---
    net/ipv6/proc.c | 6 ++----
    1 files changed, 2 insertions(+), 4 deletions(-)

    diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
    index ca8b82f..df0736a 100644
    --- a/net/ipv6/proc.c
    +++ b/net/ipv6/proc.c
    @@ -247,13 +247,11 @@ int snmp6_register_dev(struct inet6_dev *idev)
    if (!proc_net_devsnmp6)
    return -ENOENT;

    - p = proc_create(idev->dev->name, S_IRUGO,
    - proc_net_devsnmp6, &snmp6_seq_fops);
    + p = proc_create_data(idev->dev->name, S_IRUGO,
    + proc_net_devsnmp6, &snmp6_seq_fops, idev);
    if (!p)
    return -ENOMEM;

    - p->data = idev;
    -
    idev->stats.proc_dir_entry = p;
    return 0;
    }
    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. [PATCH 6/12] vlan: assign PDE->data before gluing PDE into /proc tree

    Simply replace proc_create and further data assigned with proc_create_data.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    Cc: Patrick McHardy
    ---
    net/8021q/vlanproc.c | 7 +++----
    1 files changed, 3 insertions(+), 4 deletions(-)

    diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
    index daad006..08b54b5 100644
    --- a/net/8021q/vlanproc.c
    +++ b/net/8021q/vlanproc.c
    @@ -176,12 +176,11 @@ int vlan_proc_add_dev(struct net_device *vlandev)
    struct vlan_dev_info *dev_info = vlan_dev_info(vlandev);
    struct vlan_net *vn = net_generic(dev_net(vlandev), vlan_net_id);

    - dev_info->dent = proc_create(vlandev->name, S_IFREG|S_IRUSR|S_IWUSR,
    - vn->proc_vlan_dir, &vlandev_fops);
    + dev_info->dent =
    + proc_create_data(vlandev->name, S_IFREG|S_IRUSR|S_IWUSR,
    + vn->proc_vlan_dir, &vlandev_fops, vlandev);
    if (!dev_info->dent)
    return -ENOBUFS;
    -
    - dev_info->dent->data = vlandev;
    return 0;
    }

    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. [PATCH 1/12] sunrpc: assign PDE->data before gluing PDE into /proc tree

    Simply replace proc_create and further data assigned with proc_create_data.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    ---
    net/sunrpc/cache.c | 15 ++++++---------
    net/sunrpc/stats.c | 8 +-------
    2 files changed, 7 insertions(+), 16 deletions(-)

    diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
    index d75530f..c996671 100644
    --- a/net/sunrpc/cache.c
    +++ b/net/sunrpc/cache.c
    @@ -316,31 +316,28 @@ static int create_cache_proc_entries(struct cache_detail *cd)
    cd->proc_ent->owner = cd->owner;
    cd->channel_ent = cd->content_ent = NULL;

    - p = proc_create("flush", S_IFREG|S_IRUSR|S_IWUSR,
    - cd->proc_ent, &cache_flush_operations);
    + p = proc_create_data("flush", S_IFREG|S_IRUSR|S_IWUSR,
    + cd->proc_ent, &cache_flush_operations, cd);
    cd->flush_ent = p;
    if (p == NULL)
    goto out_nomem;
    p->owner = cd->owner;
    - p->data = cd;

    if (cd->cache_request || cd->cache_parse) {
    - p = proc_create("channel", S_IFREG|S_IRUSR|S_IWUSR,
    - cd->proc_ent, &cache_file_operations);
    + p = proc_create_data("channel", S_IFREG|S_IRUSR|S_IWUSR,
    + cd->proc_ent, &cache_file_operations, cd);
    cd->channel_ent = p;
    if (p == NULL)
    goto out_nomem;
    p->owner = cd->owner;
    - p->data = cd;
    }
    if (cd->cache_show) {
    - p = proc_create("content", S_IFREG|S_IRUSR|S_IWUSR,
    - cd->proc_ent, &content_file_operations);
    + p = proc_create_data("content", S_IFREG|S_IRUSR|S_IWUSR,
    + cd->proc_ent, &content_file_operations, cd);
    cd->content_ent = p;
    if (p == NULL)
    goto out_nomem;
    p->owner = cd->owner;
    - p->data = cd;
    }
    return 0;
    out_nomem:
    diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
    index c6061a4..50b049c 100644
    --- a/net/sunrpc/stats.c
    +++ b/net/sunrpc/stats.c
    @@ -224,16 +224,10 @@ EXPORT_SYMBOL_GPL(rpc_print_iostats);
    static inline struct proc_dir_entry *
    do_register(const char *name, void *data, const struct file_operations *fops)
    {
    - struct proc_dir_entry *ent;
    -
    rpc_proc_init();
    dprintk("RPC: registering /proc/net/rpc/%s\n", name);

    - ent = proc_create(name, 0, proc_net_rpc, fops);
    - if (ent) {
    - ent->data = data;
    - }
    - return ent;
    + return proc_create_data(name, 0, proc_net_rpc, fops, data);
    }

    struct proc_dir_entry *
    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. [PATCH 2/12] netfilter: assign PDE->data before gluing PDE into /proc tree

    Simply replace proc_create and further data assigned with proc_create_data.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    Cc: Patrick McHardy
    ---
    net/ipv4/netfilter/ipt_CLUSTERIP.c | 6 +++---
    net/netfilter/xt_hashlimit.c | 12 ++++++------
    2 files changed, 9 insertions(+), 9 deletions(-)

    diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
    index 22d8e7c..1819ad7 100644
    --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
    +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
    @@ -169,14 +169,14 @@ clusterip_config_init(const struct ipt_clusterip_tgt_info *i, __be32 ip,

    /* create proc dir entry */
    sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip));
    - c->pde = proc_create(buffer, S_IWUSR|S_IRUSR,
    - clusterip_procdir, &clusterip_proc_fops);
    + c->pde = proc_create_data(buffer, S_IWUSR|S_IRUSR,
    + clusterip_procdir,
    + &clusterip_proc_fops, c);
    if (!c->pde) {
    kfree(c);
    return NULL;
    }
    }
    - c->pde->data = c;
    #endif

    write_lock_bh(&clusterip_lock);
    diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
    index 40d344b..6809af5 100644
    --- a/net/netfilter/xt_hashlimit.c
    +++ b/net/netfilter/xt_hashlimit.c
    @@ -237,15 +237,15 @@ static int htable_create_v0(struct xt_hashlimit_info *minfo, int family)
    hinfo->family = family;
    hinfo->rnd_initialized = 0;
    spin_lock_init(&hinfo->lock);
    - hinfo->pde = proc_create(minfo->name, 0,
    + hinfo->pde =
    + proc_create_data(minfo->name, 0,
    family == AF_INET ? hashlimit_procdir4 :
    hashlimit_procdir6,
    - &dl_file_ops);
    + &dl_file_ops, hinfo);
    if (!hinfo->pde) {
    vfree(hinfo);
    return -1;
    }
    - hinfo->pde->data = hinfo;

    setup_timer(&hinfo->timer, htable_gc, (unsigned long )hinfo);
    hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval);
    @@ -301,15 +301,15 @@ static int htable_create(struct xt_hashlimit_mtinfo1 *minfo,
    hinfo->rnd_initialized = 0;
    spin_lock_init(&hinfo->lock);

    - hinfo->pde = proc_create(minfo->name, 0,
    + hinfo->pde =
    + proc_create_data(minfo->name, 0,
    family == AF_INET ? hashlimit_procdir4 :
    hashlimit_procdir6,
    - &dl_file_ops);
    + &dl_file_ops, hinfo);
    if (hinfo->pde == NULL) {
    vfree(hinfo);
    return -1;
    }
    - hinfo->pde->data = hinfo;

    setup_timer(&hinfo->timer, htable_gc, (unsigned long)hinfo);
    hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval);
    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  6. [PATCH 7/12] cciss: assign PDE->data before gluing PDE into /proc tree

    Simply replace proc_create and further data assigned with proc_create_data.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    Cc:
    Cc: Greg Kroah-Hartman
    ---
    drivers/block/cciss.c | 8 ++------
    1 files changed, 2 insertions(+), 6 deletions(-)

    diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
    index e539be5..e336b05 100644
    --- a/drivers/block/cciss.c
    +++ b/drivers/block/cciss.c
    @@ -428,13 +428,9 @@ static void __devinit cciss_procinit(int i)
    proc_cciss = proc_mkdir("driver/cciss", NULL);
    if (!proc_cciss)
    return;
    - pde = proc_create(hba[i]->devname, S_IWUSR | S_IRUSR | S_IRGRP |
    + pde = proc_create_data(hba[i]->devname, S_IWUSR | S_IRUSR | S_IRGRP |
    S_IROTH, proc_cciss,
    - &cciss_proc_fops);
    - if (!pde)
    - return;
    -
    - pde->data = hba[i];
    + &cciss_proc_fops, hba[i]);
    }
    #endif /* CONFIG_PROC_FS */

    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  7. [PATCH 12/12] netns: assign PDE->data before gluing entry into /proc tree

    In this unfortunate case, proc_mkdir_mode wrapper can't be used anymore and
    this is no way to reuse proc_create_data due to nlinks assignment. So,
    copy the code from proc_mkdir and assign PDE->data at the appropriate
    moment.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    ---
    fs/proc/generic.c | 17 +++++++++++++++++
    fs/proc/proc_net.c | 11 -----------
    2 files changed, 17 insertions(+), 11 deletions(-)

    diff --git a/fs/proc/generic.c b/fs/proc/generic.c
    index 9d53b39..43e54e8 100644
    --- a/fs/proc/generic.c
    +++ b/fs/proc/generic.c
    @@ -641,6 +641,23 @@ struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode,
    return ent;
    }

    +struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
    + struct proc_dir_entry *parent)
    +{
    + struct proc_dir_entry *ent;
    +
    + ent = __proc_create(&parent, name, S_IFDIR | S_IRUGO | S_IXUGO, 2);
    + if (ent) {
    + ent->data = net;
    + if (proc_register(parent, ent) < 0) {
    + kfree(ent);
    + ent = NULL;
    + }
    + }
    + return ent;
    +}
    +EXPORT_SYMBOL_GPL(proc_net_mkdir);
    +
    struct proc_dir_entry *proc_mkdir(const char *name,
    struct proc_dir_entry *parent)
    {
    diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
    index 13cd783..83f357b 100644
    --- a/fs/proc/proc_net.c
    +++ b/fs/proc/proc_net.c
    @@ -159,17 +159,6 @@ struct net *get_proc_net(const struct inode *inode)
    }
    EXPORT_SYMBOL_GPL(get_proc_net);

    -struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
    - struct proc_dir_entry *parent)
    -{
    - struct proc_dir_entry *pde;
    - pde = proc_mkdir_mode(name, S_IRUGO | S_IXUGO, parent);
    - if (pde != NULL)
    - pde->data = net;
    - return pde;
    -}
    -EXPORT_SYMBOL_GPL(proc_net_mkdir);
    -
    static __net_init int proc_net_ns_init(struct net *net)
    {
    struct proc_dir_entry *netd, *net_statd;
    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. [PATCH 11/12] netfilter: assign PDE->data before gluing PDE into /proc tree

    Replace proc_net_fops_create with proc_create_data.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    Cc: Patrick McHardy
    ---
    net/netfilter/x_tables.c | 13 ++++++-------
    1 files changed, 6 insertions(+), 7 deletions(-)

    diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
    index f52f7f8..c3aa45b 100644
    --- a/net/netfilter/x_tables.c
    +++ b/net/netfilter/x_tables.c
    @@ -936,25 +936,24 @@ int xt_proto_init(struct net *net, int af)
    #ifdef CONFIG_PROC_FS
    strlcpy(buf, xt_prefix[af], sizeof(buf));
    strlcat(buf, FORMAT_TABLES, sizeof(buf));
    - proc = proc_net_fops_create(net, buf, 0440, &xt_table_ops);
    + proc = proc_create_data(buf, 0440, net->proc_net, &xt_table_ops,
    + (void *)(unsigned long)af);
    if (!proc)
    goto out;
    - proc->data = (void *)(unsigned long)af;
    -

    strlcpy(buf, xt_prefix[af], sizeof(buf));
    strlcat(buf, FORMAT_MATCHES, sizeof(buf));
    - proc = proc_net_fops_create(net, buf, 0440, &xt_match_ops);
    + proc = proc_create_data(buf, 0440, net->proc_net, &xt_match_ops,
    + (void *)(unsigned long)af);
    if (!proc)
    goto out_remove_tables;
    - proc->data = (void *)(unsigned long)af;

    strlcpy(buf, xt_prefix[af], sizeof(buf));
    strlcat(buf, FORMAT_TARGETS, sizeof(buf));
    - proc = proc_net_fops_create(net, buf, 0440, &xt_target_ops);
    + proc = proc_create_data(buf, 0440, net->proc_net, &xt_target_ops,
    + (void *)(unsigned long)af);
    if (!proc)
    goto out_remove_matches;
    - proc->data = (void *)(unsigned long)af;
    #endif

    return 0;
    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  9. [PATCH 10/12] netfilter: assign PDE->fops before gluing PDE into /proc tree

    Replace create_proc_entry with specially created for this purpose proc_create.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    Cc: Patrick McHardy
    ---
    net/netfilter/nf_conntrack_standalone.c | 6 +++---
    1 files changed, 3 insertions(+), 3 deletions(-)

    diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
    index b59871f..46ea542 100644
    --- a/net/netfilter/nf_conntrack_standalone.c
    +++ b/net/netfilter/nf_conntrack_standalone.c
    @@ -296,11 +296,11 @@ static int nf_conntrack_standalone_init_proc(void)
    pde = proc_net_fops_create(&init_net, "nf_conntrack", 0440, &ct_file_ops);
    if (!pde)
    goto out_nf_conntrack;
    - pde = create_proc_entry("nf_conntrack", S_IRUGO, init_net.proc_net_stat);
    +
    + pde = proc_create("nf_conntrack", S_IRUGO, init_net.proc_net_stat,
    + &ct_cpu_seq_fops);
    if (!pde)
    goto out_stat_nf_conntrack;
    - pde->proc_fops = &ct_cpu_seq_fops;
    - pde->owner = THIS_MODULE;
    return 0;

    out_stat_nf_conntrack:
    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  10. [PATCH 5/12] atm: assign PDE->data before gluing PDE into /proc tree

    Simply replace proc_create and further data assigned with proc_create_data.
    proc_atm_dev_ops holds proper referrence.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    Cc: Chas Williams
    ---
    net/atm/proc.c | 6 ++----
    1 files changed, 2 insertions(+), 4 deletions(-)

    diff --git a/net/atm/proc.c b/net/atm/proc.c
    index 5c9f3d1..49487b3 100644
    --- a/net/atm/proc.c
    +++ b/net/atm/proc.c
    @@ -417,12 +417,10 @@ int atm_proc_dev_register(struct atm_dev *dev)
    goto err_out;
    sprintf(dev->proc_name,"%s:%d",dev->type, dev->number);

    - dev->proc_entry = proc_create(dev->proc_name, 0, atm_proc_root,
    - &proc_atm_dev_ops);
    + dev->proc_entry = proc_create_data(dev->proc_name, 0, atm_proc_root,
    + &proc_atm_dev_ops, dev);
    if (!dev->proc_entry)
    goto err_free_name;
    - dev->proc_entry->data = dev;
    - dev->proc_entry->owner = THIS_MODULE;
    return 0;
    err_free_name:
    kfree(dev->proc_name);
    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  11. [PATCH 3/12] net: assign PDE->data before gluing PDE into /proc tree

    Simply replace proc_create and further data assigned with proc_create_data.
    Additionally, there is no need to assign NULL to PDE->data after creation,
    /proc generic has already done this for us.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    Cc: David S. Miller
    ---
    net/core/neighbour.c | 5 ++---
    net/core/pktgen.c | 14 +++++---------
    2 files changed, 7 insertions(+), 12 deletions(-)

    diff --git a/net/core/neighbour.c b/net/core/neighbour.c
    index 75075c3..f4f9a63 100644
    --- a/net/core/neighbour.c
    +++ b/net/core/neighbour.c
    @@ -1430,11 +1430,10 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl)
    panic("cannot create neighbour cache statistics");

    #ifdef CONFIG_PROC_FS
    - tbl->pde = proc_create(tbl->id, 0, init_net.proc_net_stat,
    - &neigh_stat_seq_fops);
    + tbl->pde = proc_create_data(tbl->id, 0, init_net.proc_net_stat,
    + &neigh_stat_seq_fops, tbl);
    if (!tbl->pde)
    panic("cannot create neighbour proc dir entry");
    - tbl->pde->data = tbl;
    #endif

    tbl->hash_mask = 1;
    diff --git a/net/core/pktgen.c b/net/core/pktgen.c
    index a803b44..48a48c8 100644
    --- a/net/core/pktgen.c
    +++ b/net/core/pktgen.c
    @@ -3570,15 +3570,14 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
    if (err)
    goto out1;

    - pkt_dev->entry = proc_create(ifname, 0600,
    - pg_proc_dir, &pktgen_if_fops);
    + pkt_dev->entry = proc_create_data(ifname, 0600, pg_proc_dir,
    + &pktgen_if_fops, pkt_dev);
    if (!pkt_dev->entry) {
    printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n",
    PG_PROC_DIR, ifname);
    err = -EINVAL;
    goto out2;
    }
    - pkt_dev->entry->data = pkt_dev;
    #ifdef CONFIG_XFRM
    pkt_dev->ipsmode = XFRM_MODE_TRANSPORT;
    pkt_dev->ipsproto = IPPROTO_ESP;
    @@ -3628,7 +3627,8 @@ static int __init pktgen_create_thread(int cpu)
    kthread_bind(p, cpu);
    t->tsk = p;

    - pe = proc_create(t->tsk->comm, 0600, pg_proc_dir, &pktgen_thread_fops);
    + pe = proc_create_data(t->tsk->comm, 0600, pg_proc_dir,
    + &pktgen_thread_fops, t);
    if (!pe) {
    printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n",
    PG_PROC_DIR, t->tsk->comm);
    @@ -3638,8 +3638,6 @@ static int __init pktgen_create_thread(int cpu)
    return -EINVAL;
    }

    - pe->data = t;
    -
    wake_up_process(p);

    return 0;
    @@ -3716,8 +3714,6 @@ static int __init pg_init(void)
    return -EINVAL;
    }

    - pe->data = NULL;
    -
    /* Register us to receive netdevice events */
    register_netdevice_notifier(&pktgen_notifier_block);

    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  12. [PATCH 8/12] powerpc: assign PDE->data before gluing PDE into /proc tree

    Simply replace proc_create and further data assigned with proc_create_data.
    No need to check for data!=NULL after that.

    Signed-off-by: Denis V. Lunev
    Cc: Alexey Dobriyan
    Cc: Eric W. Biederman
    Cc: Paul Mackerras
    ---
    arch/powerpc/platforms/pseries/scanlog.c | 19 ++-----------------
    1 files changed, 2 insertions(+), 17 deletions(-)

    diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c
    index e5b0ea8..7a76f63 100644
    --- a/arch/powerpc/platforms/pseries/scanlog.c
    +++ b/arch/powerpc/platforms/pseries/scanlog.c
    @@ -57,11 +57,6 @@ static ssize_t scanlog_read(struct file *file, char __user *buf,
    dp = PDE(inode);
    data = (unsigned int *)dp->data;

    - if (!data) {
    - printk(KERN_ERR "scanlog: read failed no data\n");
    - return -EIO;
    - }
    -
    if (count > RTAS_DATA_BUF_SIZE)
    count = RTAS_DATA_BUF_SIZE;

    @@ -153,11 +148,6 @@ static int scanlog_open(struct inode * inode, struct file * file)
    struct proc_dir_entry *dp = PDE(inode);
    unsigned int *data = (unsigned int *)dp->data;

    - if (!data) {
    - printk(KERN_ERR "scanlog: open failed no data\n");
    - return -EIO;
    - }
    -
    if (data[0] != 0) {
    /* This imperfect test stops a second copy of the
    * data (or a reset while data is being copied)
    @@ -175,10 +165,6 @@ static int scanlog_release(struct inode * inode, struct file * file)
    struct proc_dir_entry *dp = PDE(inode);
    unsigned int *data = (unsigned int *)dp->data;

    - if (!data) {
    - printk(KERN_ERR "scanlog: release failed no data\n");
    - return -EIO;
    - }
    data[0] = 0;

    return 0;
    @@ -207,12 +193,11 @@ static int __init scanlog_init(void)
    if (!data)
    goto err;

    - ent = proc_create("ppc64/rtas/scan-log-dump", S_IRUSR, NULL,
    - &scanlog_fops);
    + ent = proc_create_data("ppc64/rtas/scan-log-dump", S_IRUSR, NULL,
    + &scanlog_fops, data);
    if (!ent)
    goto err;

    - ent->data = data;
    proc_ppc64_scan_log_dump = ent;

    return 0;
    --
    1.5.3.rc5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  13. Re: [PATCH 11/12] netfilter: assign PDE->data before gluing PDE into /proc tree

    Denis V. Lunev wrote:
    > Replace proc_net_fops_create with proc_create_data.
    >
    > Signed-off-by: Denis V. Lunev
    > Cc: Alexey Dobriyan
    > Cc: Eric W. Biederman
    > Cc: Patrick McHardy


    For the VLAN and netfilter patches:

    Acked-by: Patrick McHardy

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  14. RE: [PATCH 7/12] cciss: assign PDE->data before gluing PDE into /proc tree



    > -----Original Message-----
    > From: den@sw.ru [mailto:den@sw.ru] On Behalf Of Denis V. Lunev
    > Sent: Tuesday, April 29, 2008 6:13 AM
    > To: akpm@linux-foundation.org
    > Cc: linux-kernel@vger.kernel.org; Denis V. Lunev; Alexey
    > Dobriyan; Eric W. Biederman; ISS StorageDev; Greg Kroah-Hartman
    > Subject: [PATCH 7/12] cciss: assign PDE->data before gluing
    > PDE into /proc tree
    >
    > Simply replace proc_create and further data assigned with
    > proc_create_data.
    >
    > Signed-off-by: Denis V. Lunev
    > Cc: Alexey Dobriyan
    > Cc: Eric W. Biederman
    > Cc:
    > Cc: Greg Kroah-Hartman


    Acked-by: Mike Miller

    > ---
    > drivers/block/cciss.c | 8 ++------
    > 1 files changed, 2 insertions(+), 6 deletions(-)
    >
    > diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
    > index e539be5..e336b05 100644
    > --- a/drivers/block/cciss.c
    > +++ b/drivers/block/cciss.c
    > @@ -428,13 +428,9 @@ static void __devinit cciss_procinit(int i)
    > proc_cciss = proc_mkdir("driver/cciss", NULL);
    > if (!proc_cciss)
    > return;
    > - pde = proc_create(hba[i]->devname, S_IWUSR | S_IRUSR
    > | S_IRGRP |
    > + pde = proc_create_data(hba[i]->devname, S_IWUSR | S_IRUSR |
    > + S_IRGRP |
    > S_IROTH, proc_cciss,
    > - &cciss_proc_fops);
    > - if (!pde)
    > - return;
    > -
    > - pde->data = hba[i];
    > + &cciss_proc_fops, hba[i]);
    > }
    > #endif /* CONFIG_PROC_FS */
    >
    > --
    > 1.5.3.rc5
    >
    >

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  15. Re: [PATCH 2/12] netfilter: assign PDE->data before gluing PDE into /proc tree

    From: "Denis V. Lunev"
    Date: Tue, 29 Apr 2008 15:13:12 +0400

    > Simply replace proc_create and further data assigned with proc_create_data.
    >
    > Signed-off-by: Denis V. Lunev
    > Cc: Alexey Dobriyan
    > Cc: Eric W. Biederman
    > Cc: Patrick McHardy


    Applied, with Patrick's ACK.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  16. Re: [PATCH 4/12] ipv6: assign PDE->data before gluing PDE into /proc tree

    From: "Denis V. Lunev"
    Date: Tue, 29 Apr 2008 15:13:14 +0400

    > Simply replace proc_create and further data assigned with proc_create_data.
    >
    > Signed-off-by: Denis V. Lunev


    Applied, thanks.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  17. Re: [PATCH 1/12] sunrpc: assign PDE->data before gluing PDE into /proc tree

    From: "Denis V. Lunev"
    Date: Tue, 29 Apr 2008 15:13:11 +0400

    > Simply replace proc_create and further data assigned with proc_create_data.
    >
    > Signed-off-by: Denis V. Lunev


    Applied.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  18. Re: [PATCH 3/12] net: assign PDE->data before gluing PDE into /proc tree

    From: "Denis V. Lunev"
    Date: Tue, 29 Apr 2008 15:13:13 +0400

    > Simply replace proc_create and further data assigned with proc_create_data.
    > Additionally, there is no need to assign NULL to PDE->data after creation,
    > /proc generic has already done this for us.
    >
    > Signed-off-by: Denis V. Lunev


    Applied, thanks.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  19. Re: [PATCH 5/12] atm: assign PDE->data before gluing PDE into /proc tree

    From: "Denis V. Lunev"
    Date: Tue, 29 Apr 2008 15:13:15 +0400

    > Simply replace proc_create and further data assigned with proc_create_data.
    > proc_atm_dev_ops holds proper referrence.
    >
    > Signed-off-by: Denis V. Lunev


    Applied.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  20. Re: [PATCH 6/12] vlan: assign PDE->data before gluing PDE into /proc tree

    From: "Denis V. Lunev"
    Date: Tue, 29 Apr 2008 15:13:16 +0400

    > Simply replace proc_create and further data assigned with proc_create_data.
    >
    > Signed-off-by: Denis V. Lunev
    > Cc: Alexey Dobriyan
    > Cc: Eric W. Biederman
    > Cc: Patrick McHardy


    Applied, with Patrick's ACK.

    Thanks.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread
Page 1 of 2 1 2 LastLast