~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/isdn/divert/divert_procfs.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
#include <linux/module.h>
13
13
#include <linux/poll.h>
 
14
#include <linux/slab.h>
14
15
#ifdef CONFIG_PROC_FS
15
16
#include <linux/proc_fs.h>
16
17
#else
19
20
#include <linux/sched.h>
20
21
#include <linux/isdnif.h>
21
22
#include <net/net_namespace.h>
 
23
#include <linux/mutex.h>
22
24
#include "isdn_divert.h"
23
25
 
24
26
 
26
28
/* Variables for interface queue */
27
29
/*********************************/
28
30
ulong if_used = 0;              /* number of interface users */
 
31
static DEFINE_MUTEX(isdn_divert_mutex);
29
32
static struct divert_info *divert_info_head = NULL;     /* head of queue */
30
33
static struct divert_info *divert_info_tail = NULL;     /* pointer to last entry */
31
34
static DEFINE_SPINLOCK(divert_info_lock);/* lock for queue */
176
179
/*********/
177
180
/* IOCTL */
178
181
/*********/
179
 
static int
180
 
isdn_divert_ioctl(struct inode *inode, struct file *file,
181
 
                  uint cmd, ulong arg)
 
182
static int isdn_divert_ioctl_unlocked(struct file *file, uint cmd, ulong arg)
182
183
{
183
184
        divert_ioctl dioctl;
184
185
        int i;
257
258
        return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0;
258
259
}                               /* isdn_divert_ioctl */
259
260
 
 
261
static long isdn_divert_ioctl(struct file *file, uint cmd, ulong arg)
 
262
{
 
263
        long ret;
 
264
 
 
265
        mutex_lock(&isdn_divert_mutex);
 
266
        ret = isdn_divert_ioctl_unlocked(file, cmd, arg);
 
267
        mutex_unlock(&isdn_divert_mutex);
 
268
 
 
269
        return ret;
 
270
}
 
271
 
260
272
static const struct file_operations isdn_fops =
261
273
{
262
274
        .owner          = THIS_MODULE,
264
276
        .read           = isdn_divert_read,
265
277
        .write          = isdn_divert_write,
266
278
        .poll           = isdn_divert_poll,
267
 
        .ioctl          = isdn_divert_ioctl,
 
279
        .unlocked_ioctl = isdn_divert_ioctl,
268
280
        .open           = isdn_divert_open,
269
281
        .release        = isdn_divert_close,                                      
270
282
};