~ubuntu-branches/ubuntu/lucid/linux-rt/lucid

« back to all changes in this revision

Viewing changes to net/rose/af_rose.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-08-05 23:00:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090805230052-7xedvqcyk9dnnxb2
Tags: 2.6.31-1.1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
356
356
                kfree_skb(skb);
357
357
        }
358
358
 
359
 
        if (atomic_read(&sk->sk_wmem_alloc) ||
360
 
            atomic_read(&sk->sk_rmem_alloc)) {
 
359
        if (sk_has_allocations(sk)) {
361
360
                /* Defer: outstanding buffers */
362
361
                setup_timer(&sk->sk_timer, rose_destroy_timer,
363
362
                                (unsigned long)sk);
1310
1309
        switch (cmd) {
1311
1310
        case TIOCOUTQ: {
1312
1311
                long amount;
1313
 
                amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
 
1312
 
 
1313
                amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
1314
1314
                if (amount < 0)
1315
1315
                        amount = 0;
1316
1316
                return put_user(amount, (unsigned int __user *) argp);
1481
1481
                        rose->hb / HZ,
1482
1482
                        ax25_display_timer(&rose->idletimer) / (60 * HZ),
1483
1483
                        rose->idle / (60 * HZ),
1484
 
                        atomic_read(&s->sk_wmem_alloc),
1485
 
                        atomic_read(&s->sk_rmem_alloc),
 
1484
                        sk_wmem_alloc_get(s),
 
1485
                        sk_rmem_alloc_get(s),
1486
1486
                        s->sk_socket ? SOCK_INODE(s->sk_socket)->i_ino : 0L);
1487
1487
        }
1488
1488
 
1581
1581
                char name[IFNAMSIZ];
1582
1582
 
1583
1583
                sprintf(name, "rose%d", i);
1584
 
                dev = alloc_netdev(sizeof(struct net_device_stats),
1585
 
                                   name, rose_setup);
 
1584
                dev = alloc_netdev(0, name, rose_setup);
1586
1585
                if (!dev) {
1587
1586
                        printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n");
1588
1587
                        rc = -ENOMEM;