new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
57eccb830f
commit
496ad9aa8e
306 changed files with 696 additions and 717 deletions
|
@ -111,7 +111,7 @@ static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
srm_env_t *entry = PDE(file->f_path.dentry->d_inode)->data;
|
srm_env_t *entry = PDE(file_inode(file))->data;
|
||||||
char *buf = (char *) __get_free_page(GFP_USER);
|
char *buf = (char *) __get_free_page(GFP_USER);
|
||||||
unsigned long ret1, ret2;
|
unsigned long ret1, ret2;
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ static const struct seq_operations cplbinfo_sops = {
|
||||||
|
|
||||||
static int cplbinfo_open(struct inode *inode, struct file *file)
|
static int cplbinfo_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *pde = PDE(file_inode(file));
|
||||||
char cplb_type;
|
char cplb_type;
|
||||||
unsigned int cpu;
|
unsigned int cpu;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -654,7 +654,7 @@ static int sync_serial_release(struct inode *inode, struct file *file)
|
||||||
|
|
||||||
static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
|
static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
|
||||||
{
|
{
|
||||||
int dev = MINOR(file->f_dentry->d_inode->i_rdev);
|
int dev = MINOR(file_inode(file)->i_rdev);
|
||||||
unsigned int mask = 0;
|
unsigned int mask = 0;
|
||||||
struct sync_port *port;
|
struct sync_port *port;
|
||||||
DEBUGPOLL(static unsigned int prev_mask = 0);
|
DEBUGPOLL(static unsigned int prev_mask = 0);
|
||||||
|
@ -685,7 +685,7 @@ static int sync_serial_ioctl_unlocked(struct file *file,
|
||||||
int return_val = 0;
|
int return_val = 0;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
int dev = MINOR(file->f_dentry->d_inode->i_rdev);
|
int dev = MINOR(file_inode(file)->i_rdev);
|
||||||
struct sync_port *port;
|
struct sync_port *port;
|
||||||
|
|
||||||
if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
|
if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
|
||||||
|
@ -973,7 +973,7 @@ static long sync_serial_ioctl(struct file *file,
|
||||||
static ssize_t sync_serial_write(struct file *file, const char *buf,
|
static ssize_t sync_serial_write(struct file *file, const char *buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
int dev = MINOR(file->f_dentry->d_inode->i_rdev);
|
int dev = MINOR(file_inode(file)->i_rdev);
|
||||||
DECLARE_WAITQUEUE(wait, current);
|
DECLARE_WAITQUEUE(wait, current);
|
||||||
struct sync_port *port;
|
struct sync_port *port;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
@ -1097,7 +1097,7 @@ static ssize_t sync_serial_write(struct file *file, const char *buf,
|
||||||
static ssize_t sync_serial_read(struct file *file, char *buf,
|
static ssize_t sync_serial_read(struct file *file, char *buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
int dev = MINOR(file->f_dentry->d_inode->i_rdev);
|
int dev = MINOR(file_inode(file)->i_rdev);
|
||||||
int avail;
|
int avail;
|
||||||
struct sync_port *port;
|
struct sync_port *port;
|
||||||
unsigned char *start;
|
unsigned char *start;
|
||||||
|
|
|
@ -3135,11 +3135,10 @@ static long cryptocop_ioctl_unlocked(struct inode *inode,
|
||||||
static long
|
static long
|
||||||
cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
|
||||||
long ret;
|
long ret;
|
||||||
|
|
||||||
mutex_lock(&cryptocop_mutex);
|
mutex_lock(&cryptocop_mutex);
|
||||||
ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg);
|
ret = cryptocop_ioctl_unlocked(file_inode(filp), filp, cmd, arg);
|
||||||
mutex_unlock(&cryptocop_mutex);
|
mutex_unlock(&cryptocop_mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -609,7 +609,7 @@ static int sync_serial_release(struct inode *inode, struct file *file)
|
||||||
|
|
||||||
static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
|
static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
|
||||||
{
|
{
|
||||||
int dev = iminor(file->f_path.dentry->d_inode);
|
int dev = iminor(file_inode(file));
|
||||||
unsigned int mask = 0;
|
unsigned int mask = 0;
|
||||||
sync_port *port;
|
sync_port *port;
|
||||||
DEBUGPOLL( static unsigned int prev_mask = 0; );
|
DEBUGPOLL( static unsigned int prev_mask = 0; );
|
||||||
|
@ -657,7 +657,7 @@ static int sync_serial_ioctl(struct file *file,
|
||||||
{
|
{
|
||||||
int return_val = 0;
|
int return_val = 0;
|
||||||
int dma_w_size = regk_dma_set_w_size1;
|
int dma_w_size = regk_dma_set_w_size1;
|
||||||
int dev = iminor(file->f_path.dentry->d_inode);
|
int dev = iminor(file_inode(file));
|
||||||
sync_port *port;
|
sync_port *port;
|
||||||
reg_sser_rw_tr_cfg tr_cfg;
|
reg_sser_rw_tr_cfg tr_cfg;
|
||||||
reg_sser_rw_rec_cfg rec_cfg;
|
reg_sser_rw_rec_cfg rec_cfg;
|
||||||
|
@ -979,7 +979,7 @@ static long sync_serial_ioctl(struct file *file,
|
||||||
static ssize_t sync_serial_write(struct file *file, const char *buf,
|
static ssize_t sync_serial_write(struct file *file, const char *buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
int dev = iminor(file->f_path.dentry->d_inode);
|
int dev = iminor(file_inode(file));
|
||||||
DECLARE_WAITQUEUE(wait, current);
|
DECLARE_WAITQUEUE(wait, current);
|
||||||
struct sync_port *port;
|
struct sync_port *port;
|
||||||
int trunc_count;
|
int trunc_count;
|
||||||
|
@ -1102,7 +1102,7 @@ static ssize_t sync_serial_write(struct file *file, const char *buf,
|
||||||
static ssize_t sync_serial_read(struct file * file, char * buf,
|
static ssize_t sync_serial_read(struct file * file, char * buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
int dev = iminor(file->f_path.dentry->d_inode);
|
int dev = iminor(file_inode(file));
|
||||||
int avail;
|
int avail;
|
||||||
sync_port *port;
|
sync_port *port;
|
||||||
unsigned char* start;
|
unsigned char* start;
|
||||||
|
|
|
@ -301,7 +301,7 @@ salinfo_event_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t
|
static ssize_t
|
||||||
salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
|
salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
struct proc_dir_entry *entry = PDE(inode);
|
struct proc_dir_entry *entry = PDE(inode);
|
||||||
struct salinfo_data *data = entry->data;
|
struct salinfo_data *data = entry->data;
|
||||||
char cmd[32];
|
char cmd[32];
|
||||||
|
@ -463,7 +463,7 @@ salinfo_log_new_read(int cpu, struct salinfo_data *data)
|
||||||
static ssize_t
|
static ssize_t
|
||||||
salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
|
salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
struct proc_dir_entry *entry = PDE(inode);
|
struct proc_dir_entry *entry = PDE(inode);
|
||||||
struct salinfo_data *data = entry->data;
|
struct salinfo_data *data = entry->data;
|
||||||
u8 *buf;
|
u8 *buf;
|
||||||
|
@ -524,7 +524,7 @@ salinfo_log_clear(struct salinfo_data *data, int cpu)
|
||||||
static ssize_t
|
static ssize_t
|
||||||
salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
|
salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
struct proc_dir_entry *entry = PDE(inode);
|
struct proc_dir_entry *entry = PDE(inode);
|
||||||
struct salinfo_data *data = entry->data;
|
struct salinfo_data *data = entry->data;
|
||||||
char cmd[32];
|
char cmd[32];
|
||||||
|
|
|
@ -399,11 +399,9 @@ static int file_release(struct inode *inode, struct file *filp)
|
||||||
|
|
||||||
static unsigned int file_poll(struct file *file, poll_table * wait)
|
static unsigned int file_poll(struct file *file, poll_table * wait)
|
||||||
{
|
{
|
||||||
int minor;
|
int minor = iminor(file_inode(file));
|
||||||
unsigned int mask = 0;
|
unsigned int mask = 0;
|
||||||
|
|
||||||
minor = iminor(file->f_path.dentry->d_inode);
|
|
||||||
|
|
||||||
poll_wait(file, &channel_wqs[minor].rt_queue, wait);
|
poll_wait(file, &channel_wqs[minor].rt_queue, wait);
|
||||||
poll_wait(file, &channel_wqs[minor].lx_queue, wait);
|
poll_wait(file, &channel_wqs[minor].lx_queue, wait);
|
||||||
|
|
||||||
|
@ -424,7 +422,7 @@ static unsigned int file_poll(struct file *file, poll_table * wait)
|
||||||
static ssize_t file_read(struct file *file, char __user * buffer, size_t count,
|
static ssize_t file_read(struct file *file, char __user * buffer, size_t count,
|
||||||
loff_t * ppos)
|
loff_t * ppos)
|
||||||
{
|
{
|
||||||
int minor = iminor(file->f_path.dentry->d_inode);
|
int minor = iminor(file_inode(file));
|
||||||
|
|
||||||
/* data available? */
|
/* data available? */
|
||||||
if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) {
|
if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) {
|
||||||
|
@ -437,11 +435,8 @@ static ssize_t file_read(struct file *file, char __user * buffer, size_t count,
|
||||||
static ssize_t file_write(struct file *file, const char __user * buffer,
|
static ssize_t file_write(struct file *file, const char __user * buffer,
|
||||||
size_t count, loff_t * ppos)
|
size_t count, loff_t * ppos)
|
||||||
{
|
{
|
||||||
int minor;
|
int minor = iminor(file_inode(file));
|
||||||
struct rtlx_channel *rt;
|
struct rtlx_channel *rt = &rtlx->channel[minor];
|
||||||
|
|
||||||
minor = iminor(file->f_path.dentry->d_inode);
|
|
||||||
rt = &rtlx->channel[minor];
|
|
||||||
|
|
||||||
/* any space left... */
|
/* any space left... */
|
||||||
if (!rtlx_write_poll(minor)) {
|
if (!rtlx_write_poll(minor)) {
|
||||||
|
|
|
@ -1149,7 +1149,7 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer,
|
||||||
size_t ret = count;
|
size_t ret = count;
|
||||||
struct vpe *v;
|
struct vpe *v;
|
||||||
|
|
||||||
if (iminor(file->f_path.dentry->d_inode) != minor)
|
if (iminor(file_inode(file)) != minor)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
v = get_vpe(tclimit);
|
v = get_vpe(tclimit);
|
||||||
|
|
|
@ -64,7 +64,7 @@ static int pvc_line_proc_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf,
|
static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
int lineno = *(int *)PDE(file->f_path.dentry->d_inode)->data;
|
int lineno = *(int *)PDE(file_inode(file))->data;
|
||||||
char kbuf[PVC_LINELEN];
|
char kbuf[PVC_LINELEN];
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
static loff_t page_map_seek( struct file *file, loff_t off, int whence)
|
static loff_t page_map_seek( struct file *file, loff_t off, int whence)
|
||||||
{
|
{
|
||||||
loff_t new;
|
loff_t new;
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
|
|
||||||
switch(whence) {
|
switch(whence) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -55,13 +55,13 @@ static loff_t page_map_seek( struct file *file, loff_t off, int whence)
|
||||||
static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes,
|
static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes,
|
||||||
loff_t *ppos)
|
loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size);
|
return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int page_map_mmap( struct file *file, struct vm_area_struct *vma )
|
static int page_map_mmap( struct file *file, struct vm_area_struct *vma )
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
|
|
||||||
if ((vma->vm_end - vma->vm_start) > dp->size)
|
if ((vma->vm_end - vma->vm_start) > dp->size)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
@ -191,7 +191,7 @@ static void free_flash_list(struct flash_block_list *f)
|
||||||
|
|
||||||
static int rtas_flash_release(struct inode *inode, struct file *file)
|
static int rtas_flash_release(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
struct rtas_update_flash_t *uf;
|
struct rtas_update_flash_t *uf;
|
||||||
|
|
||||||
uf = (struct rtas_update_flash_t *) dp->data;
|
uf = (struct rtas_update_flash_t *) dp->data;
|
||||||
|
@ -253,7 +253,7 @@ static void get_flash_status_msg(int status, char *buf)
|
||||||
static ssize_t rtas_flash_read(struct file *file, char __user *buf,
|
static ssize_t rtas_flash_read(struct file *file, char __user *buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
struct rtas_update_flash_t *uf;
|
struct rtas_update_flash_t *uf;
|
||||||
char msg[RTAS_MSG_MAXLEN];
|
char msg[RTAS_MSG_MAXLEN];
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ void rtas_block_ctor(void *ptr)
|
||||||
static ssize_t rtas_flash_write(struct file *file, const char __user *buffer,
|
static ssize_t rtas_flash_write(struct file *file, const char __user *buffer,
|
||||||
size_t count, loff_t *off)
|
size_t count, loff_t *off)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
struct rtas_update_flash_t *uf;
|
struct rtas_update_flash_t *uf;
|
||||||
char *p;
|
char *p;
|
||||||
int next_free;
|
int next_free;
|
||||||
|
@ -374,7 +374,7 @@ static void manage_flash(struct rtas_manage_flash_t *args_buf)
|
||||||
static ssize_t manage_flash_read(struct file *file, char __user *buf,
|
static ssize_t manage_flash_read(struct file *file, char __user *buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
struct rtas_manage_flash_t *args_buf;
|
struct rtas_manage_flash_t *args_buf;
|
||||||
char msg[RTAS_MSG_MAXLEN];
|
char msg[RTAS_MSG_MAXLEN];
|
||||||
int msglen;
|
int msglen;
|
||||||
|
@ -391,7 +391,7 @@ static ssize_t manage_flash_read(struct file *file, char __user *buf,
|
||||||
static ssize_t manage_flash_write(struct file *file, const char __user *buf,
|
static ssize_t manage_flash_write(struct file *file, const char __user *buf,
|
||||||
size_t count, loff_t *off)
|
size_t count, loff_t *off)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
struct rtas_manage_flash_t *args_buf;
|
struct rtas_manage_flash_t *args_buf;
|
||||||
const char reject_str[] = "0";
|
const char reject_str[] = "0";
|
||||||
const char commit_str[] = "1";
|
const char commit_str[] = "1";
|
||||||
|
@ -462,7 +462,7 @@ static int get_validate_flash_msg(struct rtas_validate_flash_t *args_buf,
|
||||||
static ssize_t validate_flash_read(struct file *file, char __user *buf,
|
static ssize_t validate_flash_read(struct file *file, char __user *buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
struct rtas_validate_flash_t *args_buf;
|
struct rtas_validate_flash_t *args_buf;
|
||||||
char msg[RTAS_MSG_MAXLEN];
|
char msg[RTAS_MSG_MAXLEN];
|
||||||
int msglen;
|
int msglen;
|
||||||
|
@ -477,7 +477,7 @@ static ssize_t validate_flash_read(struct file *file, char __user *buf,
|
||||||
static ssize_t validate_flash_write(struct file *file, const char __user *buf,
|
static ssize_t validate_flash_write(struct file *file, const char __user *buf,
|
||||||
size_t count, loff_t *off)
|
size_t count, loff_t *off)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
struct rtas_validate_flash_t *args_buf;
|
struct rtas_validate_flash_t *args_buf;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ static ssize_t validate_flash_write(struct file *file, const char __user *buf,
|
||||||
|
|
||||||
static int validate_flash_release(struct inode *inode, struct file *file)
|
static int validate_flash_release(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
struct rtas_validate_flash_t *args_buf;
|
struct rtas_validate_flash_t *args_buf;
|
||||||
|
|
||||||
args_buf = (struct rtas_validate_flash_t *) dp->data;
|
args_buf = (struct rtas_validate_flash_t *) dp->data;
|
||||||
|
|
|
@ -111,7 +111,7 @@ static int match_context(const void *v, struct file *file, unsigned fd)
|
||||||
struct spu_context *ctx;
|
struct spu_context *ctx;
|
||||||
if (file->f_op != &spufs_context_fops)
|
if (file->f_op != &spufs_context_fops)
|
||||||
return 0;
|
return 0;
|
||||||
ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx;
|
ctx = SPUFS_I(file_inode(file))->i_ctx;
|
||||||
if (ctx->flags & SPU_CREATE_NOSCHED)
|
if (ctx->flags & SPU_CREATE_NOSCHED)
|
||||||
return 0;
|
return 0;
|
||||||
return fd + 1;
|
return fd + 1;
|
||||||
|
@ -137,7 +137,7 @@ static struct spu_context *coredump_next_context(int *fd)
|
||||||
return NULL;
|
return NULL;
|
||||||
*fd = n - 1;
|
*fd = n - 1;
|
||||||
file = fcheck(*fd);
|
file = fcheck(*fd);
|
||||||
return SPUFS_I(file->f_dentry->d_inode)->i_ctx;
|
return SPUFS_I(file_inode(file))->i_ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
int spufs_coredump_extra_notes_size(void)
|
int spufs_coredump_extra_notes_size(void)
|
||||||
|
|
|
@ -1852,7 +1852,7 @@ static int spufs_mfc_flush(struct file *file, fl_owner_t id)
|
||||||
|
|
||||||
static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
int err = filemap_write_and_wait_range(inode->i_mapping, start, end);
|
int err = filemap_write_and_wait_range(inode->i_mapping, start, end);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
mutex_lock(&inode->i_mutex);
|
mutex_lock(&inode->i_mutex);
|
||||||
|
@ -2501,7 +2501,7 @@ static int switch_log_sprint(struct spu_context *ctx, char *tbuf, int n)
|
||||||
static ssize_t spufs_switch_log_read(struct file *file, char __user *buf,
|
static ssize_t spufs_switch_log_read(struct file *file, char __user *buf,
|
||||||
size_t len, loff_t *ppos)
|
size_t len, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
struct spu_context *ctx = SPUFS_I(inode)->i_ctx;
|
struct spu_context *ctx = SPUFS_I(inode)->i_ctx;
|
||||||
int error = 0, cnt = 0;
|
int error = 0, cnt = 0;
|
||||||
|
|
||||||
|
@ -2571,7 +2571,7 @@ static ssize_t spufs_switch_log_read(struct file *file, char __user *buf,
|
||||||
|
|
||||||
static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait)
|
static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
struct spu_context *ctx = SPUFS_I(inode)->i_ctx;
|
struct spu_context *ctx = SPUFS_I(inode)->i_ctx;
|
||||||
unsigned int mask = 0;
|
unsigned int mask = 0;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
|
@ -368,7 +368,7 @@ spufs_assert_affinity(unsigned int flags, struct spu_gang *gang,
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
neighbor = get_spu_context(
|
neighbor = get_spu_context(
|
||||||
SPUFS_I(filp->f_dentry->d_inode)->i_ctx);
|
SPUFS_I(file_inode(filp))->i_ctx);
|
||||||
|
|
||||||
if (!list_empty(&neighbor->aff_list) && !(neighbor->aff_head) &&
|
if (!list_empty(&neighbor->aff_list) && !(neighbor->aff_head) &&
|
||||||
!list_is_last(&neighbor->aff_list, &gang->aff_list_head) &&
|
!list_is_last(&neighbor->aff_list, &gang->aff_list_head) &&
|
||||||
|
|
|
@ -47,7 +47,7 @@ static long do_spu_run(struct file *filp,
|
||||||
if (filp->f_op != &spufs_context_fops)
|
if (filp->f_op != &spufs_context_fops)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
i = SPUFS_I(filp->f_path.dentry->d_inode);
|
i = SPUFS_I(file_inode(filp));
|
||||||
ret = spufs_run_spu(i->i_ctx, &npc, &status);
|
ret = spufs_run_spu(i->i_ctx, &npc, &status);
|
||||||
|
|
||||||
if (put_user(npc, unpc))
|
if (put_user(npc, unpc))
|
||||||
|
|
|
@ -86,7 +86,7 @@ static int hcall_inst_seq_open(struct inode *inode, struct file *file)
|
||||||
|
|
||||||
rc = seq_open(file, &hcall_inst_seq_ops);
|
rc = seq_open(file, &hcall_inst_seq_ops);
|
||||||
seq = file->private_data;
|
seq = file->private_data;
|
||||||
seq->private = file->f_path.dentry->d_inode->i_private;
|
seq->private = file_inode(file)->i_private;
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,16 +46,12 @@ static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */
|
||||||
static ssize_t scanlog_read(struct file *file, char __user *buf,
|
static ssize_t scanlog_read(struct file *file, char __user *buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode * inode = file->f_path.dentry->d_inode;
|
struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
struct proc_dir_entry *dp;
|
unsigned int *data = (unsigned int *)dp->data;
|
||||||
unsigned int *data;
|
|
||||||
int status;
|
int status;
|
||||||
unsigned long len, off;
|
unsigned long len, off;
|
||||||
unsigned int wait_time;
|
unsigned int wait_time;
|
||||||
|
|
||||||
dp = PDE(inode);
|
|
||||||
data = (unsigned int *)dp->data;
|
|
||||||
|
|
||||||
if (count > RTAS_DATA_BUF_SIZE)
|
if (count > RTAS_DATA_BUF_SIZE)
|
||||||
count = RTAS_DATA_BUF_SIZE;
|
count = RTAS_DATA_BUF_SIZE;
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ static ssize_t dbfs_read(struct file *file, char __user *buf,
|
||||||
if (*ppos != 0)
|
if (*ppos != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
df = file->f_path.dentry->d_inode->i_private;
|
df = file_inode(file)->i_private;
|
||||||
mutex_lock(&df->lock);
|
mutex_lock(&df->lock);
|
||||||
if (!df->data) {
|
if (!df->data) {
|
||||||
data = hypfs_dbfs_data_alloc(df);
|
data = hypfs_dbfs_data_alloc(df);
|
||||||
|
|
|
@ -119,7 +119,7 @@ static void hypfs_evict_inode(struct inode *inode)
|
||||||
|
|
||||||
static int hypfs_open(struct inode *inode, struct file *filp)
|
static int hypfs_open(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
char *data = filp->f_path.dentry->d_inode->i_private;
|
char *data = file_inode(filp)->i_private;
|
||||||
struct hypfs_sb_info *fs_info;
|
struct hypfs_sb_info *fs_info;
|
||||||
|
|
||||||
if (filp->f_mode & FMODE_WRITE) {
|
if (filp->f_mode & FMODE_WRITE) {
|
||||||
|
|
|
@ -611,7 +611,7 @@ debug_open(struct inode *inode, struct file *file)
|
||||||
debug_info_t *debug_info, *debug_info_snapshot;
|
debug_info_t *debug_info, *debug_info_snapshot;
|
||||||
|
|
||||||
mutex_lock(&debug_mutex);
|
mutex_lock(&debug_mutex);
|
||||||
debug_info = file->f_path.dentry->d_inode->i_private;
|
debug_info = file_inode(file)->i_private;
|
||||||
/* find debug view */
|
/* find debug view */
|
||||||
for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
|
for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
|
||||||
if (!debug_info->views[i])
|
if (!debug_info->views[i])
|
||||||
|
|
|
@ -99,7 +99,7 @@ static ssize_t pci_perf_seq_write(struct file *file, const char __user *ubuf,
|
||||||
static int pci_perf_seq_open(struct inode *inode, struct file *filp)
|
static int pci_perf_seq_open(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
return single_open(filp, pci_perf_show,
|
return single_open(filp, pci_perf_show,
|
||||||
filp->f_path.dentry->d_inode->i_private);
|
file_inode(filp)->i_private);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations debugfs_pci_perf_fops = {
|
static const struct file_operations debugfs_pci_perf_fops = {
|
||||||
|
@ -121,7 +121,7 @@ static int pci_debug_show(struct seq_file *m, void *v)
|
||||||
static int pci_debug_seq_open(struct inode *inode, struct file *filp)
|
static int pci_debug_seq_open(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
return single_open(filp, pci_debug_show,
|
return single_open(filp, pci_debug_show,
|
||||||
filp->f_path.dentry->d_inode->i_private);
|
file_inode(filp)->i_private);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations debugfs_pci_debug_fops = {
|
static const struct file_operations debugfs_pci_debug_fops = {
|
||||||
|
|
|
@ -140,7 +140,7 @@ static int alignment_proc_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t alignment_proc_write(struct file *file,
|
static ssize_t alignment_proc_write(struct file *file,
|
||||||
const char __user *buffer, size_t count, loff_t *pos)
|
const char __user *buffer, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
int *data = PDE(file->f_path.dentry->d_inode)->data;
|
int *data = PDE(file_inode(file))->data;
|
||||||
char mode;
|
char mode;
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
|
|
@ -271,7 +271,7 @@ static int load_aout_binary(struct linux_binprm *bprm)
|
||||||
if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC &&
|
if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC &&
|
||||||
N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) ||
|
N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) ||
|
||||||
N_TRSIZE(ex) || N_DRSIZE(ex) ||
|
N_TRSIZE(ex) || N_DRSIZE(ex) ||
|
||||||
i_size_read(bprm->file->f_path.dentry->d_inode) <
|
i_size_read(file_inode(bprm->file)) <
|
||||||
ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
|
ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
|
||||||
return -ENOEXEC;
|
return -ENOEXEC;
|
||||||
}
|
}
|
||||||
|
@ -425,12 +425,10 @@ static int load_aout_binary(struct linux_binprm *bprm)
|
||||||
|
|
||||||
static int load_aout_library(struct file *file)
|
static int load_aout_library(struct file *file)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
|
||||||
unsigned long bss, start_addr, len, error;
|
unsigned long bss, start_addr, len, error;
|
||||||
int retval;
|
int retval;
|
||||||
struct exec ex;
|
struct exec ex;
|
||||||
|
|
||||||
inode = file->f_path.dentry->d_inode;
|
|
||||||
|
|
||||||
retval = -ENOEXEC;
|
retval = -ENOEXEC;
|
||||||
error = kernel_read(file, 0, (char *) &ex, sizeof(ex));
|
error = kernel_read(file, 0, (char *) &ex, sizeof(ex));
|
||||||
|
@ -440,7 +438,7 @@ static int load_aout_library(struct file *file)
|
||||||
/* We come in here for the regular a.out style of shared libraries */
|
/* We come in here for the regular a.out style of shared libraries */
|
||||||
if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) ||
|
if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) ||
|
||||||
N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) ||
|
N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) ||
|
||||||
i_size_read(inode) <
|
i_size_read(file_inode(file)) <
|
||||||
ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
|
ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ static ssize_t cpuid_read(struct file *file, char __user *buf,
|
||||||
{
|
{
|
||||||
char __user *tmp = buf;
|
char __user *tmp = buf;
|
||||||
struct cpuid_regs cmd;
|
struct cpuid_regs cmd;
|
||||||
int cpu = iminor(file->f_path.dentry->d_inode);
|
int cpu = iminor(file_inode(file));
|
||||||
u64 pos = *ppos;
|
u64 pos = *ppos;
|
||||||
ssize_t bytes = 0;
|
ssize_t bytes = 0;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
@ -116,7 +116,7 @@ static int cpuid_open(struct inode *inode, struct file *file)
|
||||||
unsigned int cpu;
|
unsigned int cpu;
|
||||||
struct cpuinfo_x86 *c;
|
struct cpuinfo_x86 *c;
|
||||||
|
|
||||||
cpu = iminor(file->f_path.dentry->d_inode);
|
cpu = iminor(file_inode(file));
|
||||||
if (cpu >= nr_cpu_ids || !cpu_online(cpu))
|
if (cpu >= nr_cpu_ids || !cpu_online(cpu))
|
||||||
return -ENXIO; /* No such CPU */
|
return -ENXIO; /* No such CPU */
|
||||||
|
|
||||||
|
|
|
@ -6547,7 +6547,7 @@ static ssize_t dac960_user_command_proc_write(struct file *file,
|
||||||
const char __user *Buffer,
|
const char __user *Buffer,
|
||||||
size_t Count, loff_t *pos)
|
size_t Count, loff_t *pos)
|
||||||
{
|
{
|
||||||
DAC960_Controller_T *Controller = (DAC960_Controller_T *) PDE(file->f_path.dentry->d_inode)->data;
|
DAC960_Controller_T *Controller = (DAC960_Controller_T *) PDE(file_inode(file))->data;
|
||||||
unsigned char CommandBuffer[80];
|
unsigned char CommandBuffer[80];
|
||||||
int Length;
|
int Length;
|
||||||
if (Count > sizeof(CommandBuffer)-1) return -EINVAL;
|
if (Count > sizeof(CommandBuffer)-1) return -EINVAL;
|
||||||
|
|
|
@ -625,7 +625,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
file = fget(arg);
|
file = fget(arg);
|
||||||
if (file) {
|
if (file) {
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
if (S_ISSOCK(inode->i_mode)) {
|
if (S_ISSOCK(inode->i_mode)) {
|
||||||
nbd->file = file;
|
nbd->file = file;
|
||||||
nbd->sock = SOCKET_I(inode);
|
nbd->sock = SOCKET_I(inode);
|
||||||
|
|
|
@ -181,7 +181,7 @@ static int dsp56k_upload(u_char __user *bin, int len)
|
||||||
static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
|
static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
|
||||||
loff_t *ppos)
|
loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
int dev = iminor(inode) & 0x0f;
|
int dev = iminor(inode) & 0x0f;
|
||||||
|
|
||||||
switch(dev)
|
switch(dev)
|
||||||
|
@ -244,7 +244,7 @@ static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
|
||||||
static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count,
|
static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count,
|
||||||
loff_t *ppos)
|
loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
int dev = iminor(inode) & 0x0f;
|
int dev = iminor(inode) & 0x0f;
|
||||||
|
|
||||||
switch(dev)
|
switch(dev)
|
||||||
|
@ -306,7 +306,7 @@ static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t co
|
||||||
static long dsp56k_ioctl(struct file *file, unsigned int cmd,
|
static long dsp56k_ioctl(struct file *file, unsigned int cmd,
|
||||||
unsigned long arg)
|
unsigned long arg)
|
||||||
{
|
{
|
||||||
int dev = iminor(file->f_path.dentry->d_inode) & 0x0f;
|
int dev = iminor(file_inode(file)) & 0x0f;
|
||||||
void __user *argp = (void __user *)arg;
|
void __user *argp = (void __user *)arg;
|
||||||
|
|
||||||
switch(dev)
|
switch(dev)
|
||||||
|
@ -408,7 +408,7 @@ static long dsp56k_ioctl(struct file *file, unsigned int cmd,
|
||||||
#if 0
|
#if 0
|
||||||
static unsigned int dsp56k_poll(struct file *file, poll_table *wait)
|
static unsigned int dsp56k_poll(struct file *file, poll_table *wait)
|
||||||
{
|
{
|
||||||
int dev = iminor(file->f_path.dentry->d_inode) & 0x0f;
|
int dev = iminor(file_inode(file)) & 0x0f;
|
||||||
|
|
||||||
switch(dev)
|
switch(dev)
|
||||||
{
|
{
|
||||||
|
|
|
@ -125,7 +125,7 @@ static char dtlk_write_tts(char);
|
||||||
static ssize_t dtlk_read(struct file *file, char __user *buf,
|
static ssize_t dtlk_read(struct file *file, char __user *buf,
|
||||||
size_t count, loff_t * ppos)
|
size_t count, loff_t * ppos)
|
||||||
{
|
{
|
||||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
unsigned int minor = iminor(file_inode(file));
|
||||||
char ch;
|
char ch;
|
||||||
int i = 0, retries;
|
int i = 0, retries;
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ static ssize_t dtlk_write(struct file *file, const char __user *buf,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (iminor(file->f_path.dentry->d_inode) != DTLK_MINOR)
|
if (iminor(file_inode(file)) != DTLK_MINOR)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
|
@ -294,7 +294,7 @@ static int lp_wait_ready(int minor, int nonblock)
|
||||||
static ssize_t lp_write(struct file * file, const char __user * buf,
|
static ssize_t lp_write(struct file * file, const char __user * buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
unsigned int minor = iminor(file_inode(file));
|
||||||
struct parport *port = lp_table[minor].dev->port;
|
struct parport *port = lp_table[minor].dev->port;
|
||||||
char *kbuf = lp_table[minor].lp_buffer;
|
char *kbuf = lp_table[minor].lp_buffer;
|
||||||
ssize_t retv = 0;
|
ssize_t retv = 0;
|
||||||
|
@ -413,7 +413,7 @@ static ssize_t lp_read(struct file * file, char __user * buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
DEFINE_WAIT(wait);
|
DEFINE_WAIT(wait);
|
||||||
unsigned int minor=iminor(file->f_path.dentry->d_inode);
|
unsigned int minor=iminor(file_inode(file));
|
||||||
struct parport *port = lp_table[minor].dev->port;
|
struct parport *port = lp_table[minor].dev->port;
|
||||||
ssize_t retval = 0;
|
ssize_t retval = 0;
|
||||||
char *kbuf = lp_table[minor].lp_buffer;
|
char *kbuf = lp_table[minor].lp_buffer;
|
||||||
|
@ -679,7 +679,7 @@ static long lp_ioctl(struct file *file, unsigned int cmd,
|
||||||
struct timeval par_timeout;
|
struct timeval par_timeout;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
minor = iminor(file->f_path.dentry->d_inode);
|
minor = iminor(file_inode(file));
|
||||||
mutex_lock(&lp_mutex);
|
mutex_lock(&lp_mutex);
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case LPSETTIMEOUT:
|
case LPSETTIMEOUT:
|
||||||
|
@ -707,7 +707,7 @@ static long lp_compat_ioctl(struct file *file, unsigned int cmd,
|
||||||
struct timeval par_timeout;
|
struct timeval par_timeout;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
minor = iminor(file->f_path.dentry->d_inode);
|
minor = iminor(file_inode(file));
|
||||||
mutex_lock(&lp_mutex);
|
mutex_lock(&lp_mutex);
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case LPSETTIMEOUT:
|
case LPSETTIMEOUT:
|
||||||
|
|
|
@ -708,7 +708,7 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
|
||||||
{
|
{
|
||||||
loff_t ret;
|
loff_t ret;
|
||||||
|
|
||||||
mutex_lock(&file->f_path.dentry->d_inode->i_mutex);
|
mutex_lock(&file_inode(file)->i_mutex);
|
||||||
switch (orig) {
|
switch (orig) {
|
||||||
case SEEK_CUR:
|
case SEEK_CUR:
|
||||||
offset += file->f_pos;
|
offset += file->f_pos;
|
||||||
|
@ -725,7 +725,7 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
|
||||||
default:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
}
|
}
|
||||||
mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
|
mutex_unlock(&file_inode(file)->i_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ void nsc_gpio_dump(struct nsc_gpio_ops *amp, unsigned index)
|
||||||
ssize_t nsc_gpio_write(struct file *file, const char __user *data,
|
ssize_t nsc_gpio_write(struct file *file, const char __user *data,
|
||||||
size_t len, loff_t *ppos)
|
size_t len, loff_t *ppos)
|
||||||
{
|
{
|
||||||
unsigned m = iminor(file->f_path.dentry->d_inode);
|
unsigned m = iminor(file_inode(file));
|
||||||
struct nsc_gpio_ops *amp = file->private_data;
|
struct nsc_gpio_ops *amp = file->private_data;
|
||||||
struct device *dev = amp->dev;
|
struct device *dev = amp->dev;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -104,7 +104,7 @@ ssize_t nsc_gpio_write(struct file *file, const char __user *data,
|
||||||
ssize_t nsc_gpio_read(struct file *file, char __user * buf,
|
ssize_t nsc_gpio_read(struct file *file, char __user * buf,
|
||||||
size_t len, loff_t * ppos)
|
size_t len, loff_t * ppos)
|
||||||
{
|
{
|
||||||
unsigned m = iminor(file->f_path.dentry->d_inode);
|
unsigned m = iminor(file_inode(file));
|
||||||
int value;
|
int value;
|
||||||
struct nsc_gpio_ops *amp = file->private_data;
|
struct nsc_gpio_ops *amp = file->private_data;
|
||||||
|
|
||||||
|
|
|
@ -1400,7 +1400,7 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct cm4000_dev *dev = filp->private_data;
|
struct cm4000_dev *dev = filp->private_data;
|
||||||
unsigned int iobase = dev->p_dev->resource[0]->start;
|
unsigned int iobase = dev->p_dev->resource[0]->start;
|
||||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(filp);
|
||||||
struct pcmcia_device *link;
|
struct pcmcia_device *link;
|
||||||
int size;
|
int size;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
|
@ -107,7 +107,7 @@ static inline void pp_enable_irq (struct pp_struct *pp)
|
||||||
static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
|
static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
|
||||||
loff_t * ppos)
|
loff_t * ppos)
|
||||||
{
|
{
|
||||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
unsigned int minor = iminor(file_inode(file));
|
||||||
struct pp_struct *pp = file->private_data;
|
struct pp_struct *pp = file->private_data;
|
||||||
char * kbuffer;
|
char * kbuffer;
|
||||||
ssize_t bytes_read = 0;
|
ssize_t bytes_read = 0;
|
||||||
|
@ -189,7 +189,7 @@ static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
|
||||||
static ssize_t pp_write (struct file * file, const char __user * buf,
|
static ssize_t pp_write (struct file * file, const char __user * buf,
|
||||||
size_t count, loff_t * ppos)
|
size_t count, loff_t * ppos)
|
||||||
{
|
{
|
||||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
unsigned int minor = iminor(file_inode(file));
|
||||||
struct pp_struct *pp = file->private_data;
|
struct pp_struct *pp = file->private_data;
|
||||||
char * kbuffer;
|
char * kbuffer;
|
||||||
ssize_t bytes_written = 0;
|
ssize_t bytes_written = 0;
|
||||||
|
@ -324,7 +324,7 @@ static enum ieee1284_phase init_phase (int mode)
|
||||||
|
|
||||||
static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
unsigned int minor = iminor(file_inode(file));
|
||||||
struct pp_struct *pp = file->private_data;
|
struct pp_struct *pp = file->private_data;
|
||||||
struct parport * port;
|
struct parport * port;
|
||||||
void __user *argp = (void __user *)arg;
|
void __user *argp = (void __user *)arg;
|
||||||
|
|
|
@ -312,7 +312,7 @@ static int ps3flash_flush(struct file *file, fl_owner_t id)
|
||||||
|
|
||||||
static int ps3flash_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
static int ps3flash_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
int err;
|
int err;
|
||||||
mutex_lock(&inode->i_mutex);
|
mutex_lock(&inode->i_mutex);
|
||||||
err = ps3flash_writeback(ps3flash_dev);
|
err = ps3flash_writeback(ps3flash_dev);
|
||||||
|
|
|
@ -80,7 +80,7 @@ static int raw_open(struct inode *inode, struct file *filp)
|
||||||
filp->f_flags |= O_DIRECT;
|
filp->f_flags |= O_DIRECT;
|
||||||
filp->f_mapping = bdev->bd_inode->i_mapping;
|
filp->f_mapping = bdev->bd_inode->i_mapping;
|
||||||
if (++raw_devices[minor].inuse == 1)
|
if (++raw_devices[minor].inuse == 1)
|
||||||
filp->f_path.dentry->d_inode->i_mapping =
|
file_inode(filp)->i_mapping =
|
||||||
bdev->bd_inode->i_mapping;
|
bdev->bd_inode->i_mapping;
|
||||||
filp->private_data = bdev;
|
filp->private_data = bdev;
|
||||||
mutex_unlock(&raw_mutex);
|
mutex_unlock(&raw_mutex);
|
||||||
|
|
|
@ -938,7 +938,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
inode->i_atime = current_fs_time(inode->i_sb);
|
inode->i_atime = current_fs_time(inode->i_sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ static ssize_t tanbac_tb0219_read(struct file *file, char __user *buf, size_t le
|
||||||
unsigned int minor;
|
unsigned int minor;
|
||||||
char value;
|
char value;
|
||||||
|
|
||||||
minor = iminor(file->f_path.dentry->d_inode);
|
minor = iminor(file_inode(file));
|
||||||
switch (minor) {
|
switch (minor) {
|
||||||
case 0:
|
case 0:
|
||||||
value = get_led();
|
value = get_led();
|
||||||
|
@ -200,7 +200,7 @@ static ssize_t tanbac_tb0219_write(struct file *file, const char __user *data,
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
minor = iminor(file->f_path.dentry->d_inode);
|
minor = iminor(file_inode(file));
|
||||||
switch (minor) {
|
switch (minor) {
|
||||||
case 0:
|
case 0:
|
||||||
type = TYPE_LED;
|
type = TYPE_LED;
|
||||||
|
|
|
@ -202,7 +202,7 @@ static int psb_gtt_attach_pages(struct gtt_range *gt)
|
||||||
WARN_ON(gt->pages);
|
WARN_ON(gt->pages);
|
||||||
|
|
||||||
/* This is the shared memory object that backs the GEM resource */
|
/* This is the shared memory object that backs the GEM resource */
|
||||||
inode = gt->gem.filp->f_path.dentry->d_inode;
|
inode = file_inode(gt->gem.filp);
|
||||||
mapping = inode->i_mapping;
|
mapping = inode->i_mapping;
|
||||||
|
|
||||||
gt->pages = kmalloc(pages * sizeof(struct page *), GFP_KERNEL);
|
gt->pages = kmalloc(pages * sizeof(struct page *), GFP_KERNEL);
|
||||||
|
|
|
@ -1635,7 +1635,7 @@ i915_gem_object_truncate(struct drm_i915_gem_object *obj)
|
||||||
* To do this we must instruct the shmfs to drop all of its
|
* To do this we must instruct the shmfs to drop all of its
|
||||||
* backing pages, *now*.
|
* backing pages, *now*.
|
||||||
*/
|
*/
|
||||||
inode = obj->base.filp->f_path.dentry->d_inode;
|
inode = file_inode(obj->base.filp);
|
||||||
shmem_truncate_range(inode, 0, (loff_t)-1);
|
shmem_truncate_range(inode, 0, (loff_t)-1);
|
||||||
|
|
||||||
obj->madv = __I915_MADV_PURGED;
|
obj->madv = __I915_MADV_PURGED;
|
||||||
|
@ -1800,7 +1800,7 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
|
||||||
*
|
*
|
||||||
* Fail silently without starting the shrinker
|
* Fail silently without starting the shrinker
|
||||||
*/
|
*/
|
||||||
mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping;
|
mapping = file_inode(obj->base.filp)->i_mapping;
|
||||||
gfp = mapping_gfp_mask(mapping);
|
gfp = mapping_gfp_mask(mapping);
|
||||||
gfp |= __GFP_NORETRY | __GFP_NOWARN | __GFP_NO_KSWAPD;
|
gfp |= __GFP_NORETRY | __GFP_NOWARN | __GFP_NO_KSWAPD;
|
||||||
gfp &= ~(__GFP_IO | __GFP_WAIT);
|
gfp &= ~(__GFP_IO | __GFP_WAIT);
|
||||||
|
@ -3724,7 +3724,7 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
|
||||||
mask |= __GFP_DMA32;
|
mask |= __GFP_DMA32;
|
||||||
}
|
}
|
||||||
|
|
||||||
mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping;
|
mapping = file_inode(obj->base.filp)->i_mapping;
|
||||||
mapping_set_gfp_mask(mapping, mask);
|
mapping_set_gfp_mask(mapping, mask);
|
||||||
|
|
||||||
i915_gem_object_init(obj, &i915_gem_object_ops);
|
i915_gem_object_init(obj, &i915_gem_object_ops);
|
||||||
|
@ -4228,7 +4228,7 @@ void i915_gem_free_all_phys_object(struct drm_device *dev)
|
||||||
void i915_gem_detach_phys_object(struct drm_device *dev,
|
void i915_gem_detach_phys_object(struct drm_device *dev,
|
||||||
struct drm_i915_gem_object *obj)
|
struct drm_i915_gem_object *obj)
|
||||||
{
|
{
|
||||||
struct address_space *mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping;
|
struct address_space *mapping = file_inode(obj->base.filp)->i_mapping;
|
||||||
char *vaddr;
|
char *vaddr;
|
||||||
int i;
|
int i;
|
||||||
int page_count;
|
int page_count;
|
||||||
|
@ -4264,7 +4264,7 @@ i915_gem_attach_phys_object(struct drm_device *dev,
|
||||||
int id,
|
int id,
|
||||||
int align)
|
int align)
|
||||||
{
|
{
|
||||||
struct address_space *mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping;
|
struct address_space *mapping = file_inode(obj->base.filp)->i_mapping;
|
||||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int page_count;
|
int page_count;
|
||||||
|
|
|
@ -296,7 +296,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm)
|
||||||
swap_storage = ttm->swap_storage;
|
swap_storage = ttm->swap_storage;
|
||||||
BUG_ON(swap_storage == NULL);
|
BUG_ON(swap_storage == NULL);
|
||||||
|
|
||||||
swap_space = swap_storage->f_path.dentry->d_inode->i_mapping;
|
swap_space = file_inode(swap_storage)->i_mapping;
|
||||||
|
|
||||||
for (i = 0; i < ttm->num_pages; ++i) {
|
for (i = 0; i < ttm->num_pages; ++i) {
|
||||||
from_page = shmem_read_mapping_page(swap_space, i);
|
from_page = shmem_read_mapping_page(swap_space, i);
|
||||||
|
@ -345,7 +345,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage)
|
||||||
} else
|
} else
|
||||||
swap_storage = persistent_swap_storage;
|
swap_storage = persistent_swap_storage;
|
||||||
|
|
||||||
swap_space = swap_storage->f_path.dentry->d_inode->i_mapping;
|
swap_space = file_inode(swap_storage)->i_mapping;
|
||||||
|
|
||||||
for (i = 0; i < ttm->num_pages; ++i) {
|
for (i = 0; i < ttm->num_pages; ++i) {
|
||||||
from_page = ttm->pages[i];
|
from_page = ttm->pages[i];
|
||||||
|
|
|
@ -137,7 +137,7 @@ static int udl_gem_get_pages(struct udl_gem_object *obj, gfp_t gfpmask)
|
||||||
if (obj->pages == NULL)
|
if (obj->pages == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
inode = obj->base.filp->f_path.dentry->d_inode;
|
inode = file_inode(obj->base.filp);
|
||||||
mapping = inode->i_mapping;
|
mapping = inode->i_mapping;
|
||||||
gfpmask |= mapping_gfp_mask(mapping);
|
gfpmask |= mapping_gfp_mask(mapping);
|
||||||
|
|
||||||
|
|
|
@ -378,7 +378,7 @@ EXPORT_SYMBOL_GPL(roccat_disconnect);
|
||||||
|
|
||||||
static long roccat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
static long roccat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
struct roccat_device *device;
|
struct roccat_device *device;
|
||||||
unsigned int minor = iminor(inode);
|
unsigned int minor = iminor(inode);
|
||||||
long retval = 0;
|
long retval = 0;
|
||||||
|
|
|
@ -108,7 +108,7 @@ static ssize_t hidraw_read(struct file *file, char __user *buffer, size_t count,
|
||||||
* This function is to be called with the minors_lock mutex held */
|
* This function is to be called with the minors_lock mutex held */
|
||||||
static ssize_t hidraw_send_report(struct file *file, const char __user *buffer, size_t count, unsigned char report_type)
|
static ssize_t hidraw_send_report(struct file *file, const char __user *buffer, size_t count, unsigned char report_type)
|
||||||
{
|
{
|
||||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
unsigned int minor = iminor(file_inode(file));
|
||||||
struct hid_device *dev;
|
struct hid_device *dev;
|
||||||
__u8 *buf;
|
__u8 *buf;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -176,7 +176,7 @@ static ssize_t hidraw_write(struct file *file, const char __user *buffer, size_t
|
||||||
* mutex held. */
|
* mutex held. */
|
||||||
static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t count, unsigned char report_type)
|
static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t count, unsigned char report_type)
|
||||||
{
|
{
|
||||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
unsigned int minor = iminor(file_inode(file));
|
||||||
struct hid_device *dev;
|
struct hid_device *dev;
|
||||||
__u8 *buf;
|
__u8 *buf;
|
||||||
int ret = 0, len;
|
int ret = 0, len;
|
||||||
|
@ -340,7 +340,7 @@ static int hidraw_release(struct inode * inode, struct file * file)
|
||||||
static long hidraw_ioctl(struct file *file, unsigned int cmd,
|
static long hidraw_ioctl(struct file *file, unsigned int cmd,
|
||||||
unsigned long arg)
|
unsigned long arg)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
unsigned int minor = iminor(inode);
|
unsigned int minor = iminor(inode);
|
||||||
long ret = 0;
|
long ret = 0;
|
||||||
struct hidraw *dev;
|
struct hidraw *dev;
|
||||||
|
|
|
@ -148,7 +148,7 @@ static ssize_t i2cdev_read(struct file *file, char __user *buf, size_t count,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
pr_debug("i2c-dev: i2c-%d reading %zu bytes.\n",
|
pr_debug("i2c-dev: i2c-%d reading %zu bytes.\n",
|
||||||
iminor(file->f_path.dentry->d_inode), count);
|
iminor(file_inode(file)), count);
|
||||||
|
|
||||||
ret = i2c_master_recv(client, tmp, count);
|
ret = i2c_master_recv(client, tmp, count);
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
|
@ -172,7 +172,7 @@ static ssize_t i2cdev_write(struct file *file, const char __user *buf,
|
||||||
return PTR_ERR(tmp);
|
return PTR_ERR(tmp);
|
||||||
|
|
||||||
pr_debug("i2c-dev: i2c-%d writing %zu bytes.\n",
|
pr_debug("i2c-dev: i2c-%d writing %zu bytes.\n",
|
||||||
iminor(file->f_path.dentry->d_inode), count);
|
iminor(file_inode(file)), count);
|
||||||
|
|
||||||
ret = i2c_master_send(client, tmp, count);
|
ret = i2c_master_send(client, tmp, count);
|
||||||
kfree(tmp);
|
kfree(tmp);
|
||||||
|
|
|
@ -333,7 +333,7 @@ static int ide_settings_proc_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t ide_settings_proc_write(struct file *file, const char __user *buffer,
|
static ssize_t ide_settings_proc_write(struct file *file, const char __user *buffer,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
ide_drive_t *drive = (ide_drive_t *) PDE(file->f_path.dentry->d_inode)->data;
|
ide_drive_t *drive = (ide_drive_t *) PDE(file_inode(file))->data;
|
||||||
char name[MAX_LEN + 1];
|
char name[MAX_LEN + 1];
|
||||||
int for_real = 0, mul_factor, div_factor;
|
int for_real = 0, mul_factor, div_factor;
|
||||||
unsigned long n;
|
unsigned long n;
|
||||||
|
@ -558,7 +558,7 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
|
||||||
static ssize_t ide_driver_proc_write(struct file *file, const char __user *buffer,
|
static ssize_t ide_driver_proc_write(struct file *file, const char __user *buffer,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
ide_drive_t *drive = (ide_drive_t *) PDE(file->f_path.dentry->d_inode)->data;
|
ide_drive_t *drive = (ide_drive_t *) PDE(file_inode(file))->data;
|
||||||
char name[32];
|
char name[32];
|
||||||
|
|
||||||
if (!capable(CAP_SYS_ADMIN))
|
if (!capable(CAP_SYS_ADMIN))
|
||||||
|
|
|
@ -730,7 +730,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
|
||||||
goto err_tree_mutex_unlock;
|
goto err_tree_mutex_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
inode = f.file->f_path.dentry->d_inode;
|
inode = file_inode(f.file);
|
||||||
xrcd = find_xrcd(file->device, inode);
|
xrcd = find_xrcd(file->device, inode);
|
||||||
if (!xrcd && !(cmd.oflags & O_CREAT)) {
|
if (!xrcd && !(cmd.oflags & O_CREAT)) {
|
||||||
/* no file descriptor. Need CREATE flag */
|
/* no file descriptor. Need CREATE flag */
|
||||||
|
|
|
@ -1864,9 +1864,9 @@ static int ipath_assign_port(struct file *fp,
|
||||||
goto done_chk_sdma;
|
goto done_chk_sdma;
|
||||||
}
|
}
|
||||||
|
|
||||||
i_minor = iminor(fp->f_path.dentry->d_inode) - IPATH_USER_MINOR_BASE;
|
i_minor = iminor(file_inode(fp)) - IPATH_USER_MINOR_BASE;
|
||||||
ipath_cdbg(VERBOSE, "open on dev %lx (minor %d)\n",
|
ipath_cdbg(VERBOSE, "open on dev %lx (minor %d)\n",
|
||||||
(long)fp->f_path.dentry->d_inode->i_rdev, i_minor);
|
(long)file_inode(fp)->i_rdev, i_minor);
|
||||||
|
|
||||||
if (i_minor)
|
if (i_minor)
|
||||||
ret = find_free_port(i_minor - 1, fp, uinfo);
|
ret = find_free_port(i_minor - 1, fp, uinfo);
|
||||||
|
|
|
@ -113,7 +113,7 @@ static ssize_t atomic_counters_read(struct file *file, char __user *buf,
|
||||||
struct infinipath_counters counters;
|
struct infinipath_counters counters;
|
||||||
struct ipath_devdata *dd;
|
struct ipath_devdata *dd;
|
||||||
|
|
||||||
dd = file->f_path.dentry->d_inode->i_private;
|
dd = file_inode(file)->i_private;
|
||||||
dd->ipath_f_read_counters(dd, &counters);
|
dd->ipath_f_read_counters(dd, &counters);
|
||||||
|
|
||||||
return simple_read_from_buffer(buf, count, ppos, &counters,
|
return simple_read_from_buffer(buf, count, ppos, &counters,
|
||||||
|
@ -154,7 +154,7 @@ static ssize_t flash_read(struct file *file, char __user *buf,
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
|
||||||
dd = file->f_path.dentry->d_inode->i_private;
|
dd = file_inode(file)->i_private;
|
||||||
if (ipath_eeprom_read(dd, pos, tmp, count)) {
|
if (ipath_eeprom_read(dd, pos, tmp, count)) {
|
||||||
ipath_dev_err(dd, "failed to read from flash\n");
|
ipath_dev_err(dd, "failed to read from flash\n");
|
||||||
ret = -ENXIO;
|
ret = -ENXIO;
|
||||||
|
@ -207,7 +207,7 @@ static ssize_t flash_write(struct file *file, const char __user *buf,
|
||||||
goto bail_tmp;
|
goto bail_tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
dd = file->f_path.dentry->d_inode->i_private;
|
dd = file_inode(file)->i_private;
|
||||||
if (ipath_eeprom_write(dd, pos, tmp, count)) {
|
if (ipath_eeprom_write(dd, pos, tmp, count)) {
|
||||||
ret = -ENXIO;
|
ret = -ENXIO;
|
||||||
ipath_dev_err(dd, "failed to write to flash\n");
|
ipath_dev_err(dd, "failed to write to flash\n");
|
||||||
|
|
|
@ -1524,7 +1524,7 @@ static int qib_assign_ctxt(struct file *fp, const struct qib_user_info *uinfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i_minor = iminor(fp->f_dentry->d_inode) - QIB_USER_MINOR_BASE;
|
i_minor = iminor(file_inode(fp)) - QIB_USER_MINOR_BASE;
|
||||||
if (i_minor)
|
if (i_minor)
|
||||||
ret = find_free_ctxt(i_minor - 1, fp, uinfo);
|
ret = find_free_ctxt(i_minor - 1, fp, uinfo);
|
||||||
else
|
else
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
static struct super_block *qib_super;
|
static struct super_block *qib_super;
|
||||||
|
|
||||||
#define private2dd(file) ((file)->f_dentry->d_inode->i_private)
|
#define private2dd(file) (file_inode(file)->i_private)
|
||||||
|
|
||||||
static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
|
static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
|
||||||
umode_t mode, const struct file_operations *fops,
|
umode_t mode, const struct file_operations *fops,
|
||||||
|
@ -171,7 +171,7 @@ static const struct file_operations cntr_ops[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Could use file->f_dentry->d_inode->i_ino to figure out which file,
|
* Could use file_inode(file)->i_ino to figure out which file,
|
||||||
* instead of separate routine for each, but for now, this works...
|
* instead of separate routine for each, but for now, this works...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -964,7 +964,6 @@ static ssize_t smmu_debugfs_stats_write(struct file *file,
|
||||||
{
|
{
|
||||||
struct smmu_debugfs_info *info;
|
struct smmu_debugfs_info *info;
|
||||||
struct smmu_device *smmu;
|
struct smmu_device *smmu;
|
||||||
struct dentry *dent;
|
|
||||||
int i;
|
int i;
|
||||||
enum {
|
enum {
|
||||||
_OFF = 0,
|
_OFF = 0,
|
||||||
|
@ -992,8 +991,7 @@ static ssize_t smmu_debugfs_stats_write(struct file *file,
|
||||||
if (i == ARRAY_SIZE(command))
|
if (i == ARRAY_SIZE(command))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
dent = file->f_dentry;
|
info = file_inode(file)->i_private;
|
||||||
info = dent->d_inode->i_private;
|
|
||||||
smmu = info->smmu;
|
smmu = info->smmu;
|
||||||
|
|
||||||
offs = SMMU_CACHE_CONFIG(info->cache);
|
offs = SMMU_CACHE_CONFIG(info->cache);
|
||||||
|
|
|
@ -145,7 +145,7 @@ void remove_divas_proc(void)
|
||||||
static ssize_t grp_opt_proc_write(struct file *file, const char __user *buffer,
|
static ssize_t grp_opt_proc_write(struct file *file, const char __user *buffer,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
diva_os_xdi_adapter_t *a = PDE(file->f_path.dentry->d_inode)->data;
|
diva_os_xdi_adapter_t *a = PDE(file_inode(file))->data;
|
||||||
PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
|
PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
|
||||||
|
|
||||||
if ((count == 1) || (count == 2)) {
|
if ((count == 1) || (count == 2)) {
|
||||||
|
@ -172,7 +172,7 @@ static ssize_t grp_opt_proc_write(struct file *file, const char __user *buffer,
|
||||||
static ssize_t d_l1_down_proc_write(struct file *file, const char __user *buffer,
|
static ssize_t d_l1_down_proc_write(struct file *file, const char __user *buffer,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
diva_os_xdi_adapter_t *a = PDE(file->f_path.dentry->d_inode)->data;
|
diva_os_xdi_adapter_t *a = PDE(file_inode(file))->data;
|
||||||
PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
|
PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
|
||||||
|
|
||||||
if ((count == 1) || (count == 2)) {
|
if ((count == 1) || (count == 2)) {
|
||||||
|
@ -251,7 +251,7 @@ static const struct file_operations grp_opt_proc_fops = {
|
||||||
static ssize_t info_proc_write(struct file *file, const char __user *buffer,
|
static ssize_t info_proc_write(struct file *file, const char __user *buffer,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
diva_os_xdi_adapter_t *a = PDE(file->f_path.dentry->d_inode)->data;
|
diva_os_xdi_adapter_t *a = PDE(file_inode(file))->data;
|
||||||
PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
|
PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
|
||||||
char c[4];
|
char c[4];
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,7 @@ hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t *off)
|
||||||
{
|
{
|
||||||
struct log_data *inf;
|
struct log_data *inf;
|
||||||
int len;
|
int len;
|
||||||
struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *pde = PDE(file_inode(file));
|
||||||
struct procdata *pd = NULL;
|
struct procdata *pd = NULL;
|
||||||
hysdn_card *card;
|
hysdn_card *card;
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ static unsigned int
|
||||||
hysdn_log_poll(struct file *file, poll_table *wait)
|
hysdn_log_poll(struct file *file, poll_table *wait)
|
||||||
{
|
{
|
||||||
unsigned int mask = 0;
|
unsigned int mask = 0;
|
||||||
struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
|
struct proc_dir_entry *pde = PDE(file_inode(file));
|
||||||
hysdn_card *card;
|
hysdn_card *card;
|
||||||
struct procdata *pd = NULL;
|
struct procdata *pd = NULL;
|
||||||
|
|
||||||
|
|
|
@ -1058,7 +1058,7 @@ isdn_info_update(void)
|
||||||
static ssize_t
|
static ssize_t
|
||||||
isdn_read(struct file *file, char __user *buf, size_t count, loff_t *off)
|
isdn_read(struct file *file, char __user *buf, size_t count, loff_t *off)
|
||||||
{
|
{
|
||||||
uint minor = iminor(file->f_path.dentry->d_inode);
|
uint minor = iminor(file_inode(file));
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int drvidx;
|
int drvidx;
|
||||||
int chidx;
|
int chidx;
|
||||||
|
@ -1165,7 +1165,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t *off)
|
||||||
static ssize_t
|
static ssize_t
|
||||||
isdn_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
|
isdn_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
|
||||||
{
|
{
|
||||||
uint minor = iminor(file->f_path.dentry->d_inode);
|
uint minor = iminor(file_inode(file));
|
||||||
int drvidx;
|
int drvidx;
|
||||||
int chidx;
|
int chidx;
|
||||||
int retval;
|
int retval;
|
||||||
|
@ -1228,7 +1228,7 @@ static unsigned int
|
||||||
isdn_poll(struct file *file, poll_table *wait)
|
isdn_poll(struct file *file, poll_table *wait)
|
||||||
{
|
{
|
||||||
unsigned int mask = 0;
|
unsigned int mask = 0;
|
||||||
unsigned int minor = iminor(file->f_path.dentry->d_inode);
|
unsigned int minor = iminor(file_inode(file));
|
||||||
int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
|
int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
|
||||||
|
|
||||||
mutex_lock(&isdn_mutex);
|
mutex_lock(&isdn_mutex);
|
||||||
|
@ -1269,7 +1269,7 @@ isdn_poll(struct file *file, poll_table *wait)
|
||||||
static int
|
static int
|
||||||
isdn_ioctl(struct file *file, uint cmd, ulong arg)
|
isdn_ioctl(struct file *file, uint cmd, ulong arg)
|
||||||
{
|
{
|
||||||
uint minor = iminor(file->f_path.dentry->d_inode);
|
uint minor = iminor(file_inode(file));
|
||||||
isdn_ctrl c;
|
isdn_ctrl c;
|
||||||
int drvidx;
|
int drvidx;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -668,7 +668,7 @@ isdn_ppp_poll(struct file *file, poll_table *wait)
|
||||||
|
|
||||||
if (is->debug & 0x2)
|
if (is->debug & 0x2)
|
||||||
printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n",
|
printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n",
|
||||||
iminor(file->f_path.dentry->d_inode));
|
iminor(file_inode(file)));
|
||||||
|
|
||||||
/* just registers wait_queue hook. This doesn't really wait. */
|
/* just registers wait_queue hook. This doesn't really wait. */
|
||||||
poll_wait(file, &is->wq, wait);
|
poll_wait(file, &is->wq, wait);
|
||||||
|
|
|
@ -337,7 +337,7 @@ static int read_page(struct file *file, unsigned long index,
|
||||||
struct page *page)
|
struct page *page)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
struct buffer_head *bh;
|
struct buffer_head *bh;
|
||||||
sector_t block;
|
sector_t block;
|
||||||
|
|
||||||
|
@ -755,7 +755,7 @@ static void bitmap_file_unmap(struct bitmap_storage *store)
|
||||||
free_buffers(sb_page);
|
free_buffers(sb_page);
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
invalidate_mapping_pages(inode->i_mapping, 0, -1);
|
invalidate_mapping_pages(inode->i_mapping, 0, -1);
|
||||||
fput(file);
|
fput(file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ static int zoran_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t zoran_write(struct file *file, const char __user *buffer,
|
static ssize_t zoran_write(struct file *file, const char __user *buffer,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct zoran *zr = PDE(file->f_path.dentry->d_inode)->data;
|
struct zoran *zr = PDE(file_inode(file))->data;
|
||||||
char *string, *sp;
|
char *string, *sp;
|
||||||
char *line, *ldelim, *varname, *svar, *tdelim;
|
char *line, *ldelim, *varname, *svar, *tdelim;
|
||||||
|
|
||||||
|
|
|
@ -531,7 +531,7 @@ EXPORT_SYMBOL(lirc_dev_fop_close);
|
||||||
|
|
||||||
unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait)
|
unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait)
|
||||||
{
|
{
|
||||||
struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)];
|
struct irctl *ir = irctls[iminor(file_inode(file))];
|
||||||
unsigned int ret;
|
unsigned int ret;
|
||||||
|
|
||||||
if (!ir) {
|
if (!ir) {
|
||||||
|
@ -565,7 +565,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
__u32 mode;
|
__u32 mode;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)];
|
struct irctl *ir = irctls[iminor(file_inode(file))];
|
||||||
|
|
||||||
if (!ir) {
|
if (!ir) {
|
||||||
printk(KERN_ERR "lirc_dev: %s: no irctl found!\n", __func__);
|
printk(KERN_ERR "lirc_dev: %s: no irctl found!\n", __func__);
|
||||||
|
@ -650,7 +650,7 @@ ssize_t lirc_dev_fop_read(struct file *file,
|
||||||
size_t length,
|
size_t length,
|
||||||
loff_t *ppos)
|
loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)];
|
struct irctl *ir = irctls[iminor(file_inode(file))];
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
int ret = 0, written = 0;
|
int ret = 0, written = 0;
|
||||||
DECLARE_WAITQUEUE(wait, current);
|
DECLARE_WAITQUEUE(wait, current);
|
||||||
|
@ -754,10 +754,10 @@ void *lirc_get_pdata(struct file *file)
|
||||||
{
|
{
|
||||||
void *data = NULL;
|
void *data = NULL;
|
||||||
|
|
||||||
if (file && file->f_dentry && file->f_dentry->d_inode &&
|
if (file && file->f_dentry && file_inode(file) &&
|
||||||
file->f_dentry->d_inode->i_rdev) {
|
file_inode(file)->i_rdev) {
|
||||||
struct irctl *ir;
|
struct irctl *ir;
|
||||||
ir = irctls[iminor(file->f_dentry->d_inode)];
|
ir = irctls[iminor(file_inode(file))];
|
||||||
data = ir->d.data;
|
data = ir->d.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -769,7 +769,7 @@ EXPORT_SYMBOL(lirc_get_pdata);
|
||||||
ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
|
ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
|
||||||
size_t length, loff_t *ppos)
|
size_t length, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)];
|
struct irctl *ir = irctls[iminor(file_inode(file))];
|
||||||
|
|
||||||
if (!ir) {
|
if (!ir) {
|
||||||
printk(KERN_ERR "%s: called with invalid irctl\n", __func__);
|
printk(KERN_ERR "%s: called with invalid irctl\n", __func__);
|
||||||
|
|
|
@ -222,7 +222,7 @@ static struct class video_class = {
|
||||||
|
|
||||||
struct video_device *video_devdata(struct file *file)
|
struct video_device *video_devdata(struct file *file)
|
||||||
{
|
{
|
||||||
return video_device[iminor(file->f_path.dentry->d_inode)];
|
return video_device[iminor(file_inode(file))];
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(video_devdata);
|
EXPORT_SYMBOL(video_devdata);
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ static int vol_cdev_fsync(struct file *file, loff_t start, loff_t end,
|
||||||
{
|
{
|
||||||
struct ubi_volume_desc *desc = file->private_data;
|
struct ubi_volume_desc *desc = file->private_data;
|
||||||
struct ubi_device *ubi = desc->vol->ubi;
|
struct ubi_device *ubi = desc->vol->ubi;
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
int err;
|
int err;
|
||||||
mutex_lock(&inode->i_mutex);
|
mutex_lock(&inode->i_mutex);
|
||||||
err = ubi_sync(ubi->ubi_num);
|
err = ubi_sync(ubi->ubi_num);
|
||||||
|
|
|
@ -2336,7 +2336,7 @@ static ssize_t mem_read(struct file *file, char __user *buf, size_t count,
|
||||||
loff_t *ppos)
|
loff_t *ppos)
|
||||||
{
|
{
|
||||||
loff_t pos = *ppos;
|
loff_t pos = *ppos;
|
||||||
loff_t avail = file->f_path.dentry->d_inode->i_size;
|
loff_t avail = file_inode(file)->i_size;
|
||||||
unsigned int mem = (uintptr_t)file->private_data & 3;
|
unsigned int mem = (uintptr_t)file->private_data & 3;
|
||||||
struct adapter *adap = file->private_data - mem;
|
struct adapter *adap = file->private_data - mem;
|
||||||
|
|
||||||
|
|
|
@ -939,14 +939,14 @@ static int cosa_open(struct inode *inode, struct file *file)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
mutex_lock(&cosa_chardev_mutex);
|
mutex_lock(&cosa_chardev_mutex);
|
||||||
if ((n=iminor(file->f_path.dentry->d_inode)>>CARD_MINOR_BITS)
|
if ((n=iminor(file_inode(file))>>CARD_MINOR_BITS)
|
||||||
>= nr_cards) {
|
>= nr_cards) {
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
cosa = cosa_cards+n;
|
cosa = cosa_cards+n;
|
||||||
|
|
||||||
if ((n=iminor(file->f_path.dentry->d_inode)
|
if ((n=iminor(file_inode(file))
|
||||||
& ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) {
|
& ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) {
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -2769,7 +2769,7 @@ static ssize_t int_proc_write(struct file *file, const char __user *buffer,
|
||||||
nr = nr * 10 + c;
|
nr = nr * 10 + c;
|
||||||
p++;
|
p++;
|
||||||
} while (--len);
|
} while (--len);
|
||||||
*(int *)PDE(file->f_path.dentry->d_inode)->data = nr;
|
*(int *)PDE(file_inode(file))->data = nr;
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ static int led_proc_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t led_proc_write(struct file *file, const char *buf,
|
static ssize_t led_proc_write(struct file *file, const char *buf,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
void *data = PDE(file->f_path.dentry->d_inode)->data;
|
void *data = PDE(file_inode(file))->data;
|
||||||
char *cur, lbuf[32];
|
char *cur, lbuf[32];
|
||||||
int d;
|
int d;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ static loff_t
|
||||||
proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
|
proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
|
||||||
{
|
{
|
||||||
loff_t new = -1;
|
loff_t new = -1;
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
|
|
||||||
mutex_lock(&inode->i_mutex);
|
mutex_lock(&inode->i_mutex);
|
||||||
switch (whence) {
|
switch (whence) {
|
||||||
|
@ -46,7 +46,7 @@ proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
|
||||||
static ssize_t
|
static ssize_t
|
||||||
proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
||||||
{
|
{
|
||||||
const struct inode *ino = file->f_path.dentry->d_inode;
|
const struct inode *ino = file_inode(file);
|
||||||
const struct proc_dir_entry *dp = PDE(ino);
|
const struct proc_dir_entry *dp = PDE(ino);
|
||||||
struct pci_dev *dev = dp->data;
|
struct pci_dev *dev = dp->data;
|
||||||
unsigned int pos = *ppos;
|
unsigned int pos = *ppos;
|
||||||
|
@ -132,7 +132,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
|
||||||
static ssize_t
|
static ssize_t
|
||||||
proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos)
|
proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode *ino = file->f_path.dentry->d_inode;
|
struct inode *ino = file_inode(file);
|
||||||
const struct proc_dir_entry *dp = PDE(ino);
|
const struct proc_dir_entry *dp = PDE(ino);
|
||||||
struct pci_dev *dev = dp->data;
|
struct pci_dev *dev = dp->data;
|
||||||
int pos = *ppos;
|
int pos = *ppos;
|
||||||
|
@ -212,7 +212,7 @@ struct pci_filp_private {
|
||||||
static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
|
static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
|
||||||
unsigned long arg)
|
unsigned long arg)
|
||||||
{
|
{
|
||||||
const struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
|
const struct proc_dir_entry *dp = PDE(file_inode(file));
|
||||||
struct pci_dev *dev = dp->data;
|
struct pci_dev *dev = dp->data;
|
||||||
#ifdef HAVE_PCI_MMAP
|
#ifdef HAVE_PCI_MMAP
|
||||||
struct pci_filp_private *fpriv = file->private_data;
|
struct pci_filp_private *fpriv = file->private_data;
|
||||||
|
@ -253,7 +253,7 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
|
||||||
#ifdef HAVE_PCI_MMAP
|
#ifdef HAVE_PCI_MMAP
|
||||||
static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma)
|
static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
const struct proc_dir_entry *dp = PDE(inode);
|
const struct proc_dir_entry *dp = PDE(inode);
|
||||||
struct pci_dev *dev = dp->data;
|
struct pci_dev *dev = dp->data;
|
||||||
struct pci_filp_private *fpriv = file->private_data;
|
struct pci_filp_private *fpriv = file->private_data;
|
||||||
|
|
|
@ -3566,7 +3566,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
inode->i_atime = current_fs_time(inode->i_sb);
|
inode->i_atime = current_fs_time(inode->i_sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -852,7 +852,7 @@ static ssize_t dispatch_proc_write(struct file *file,
|
||||||
const char __user *userbuf,
|
const char __user *userbuf,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
struct ibm_struct *ibm = PDE(file->f_path.dentry->d_inode)->data;
|
struct ibm_struct *ibm = PDE(file_inode(file))->data;
|
||||||
char *kernbuf;
|
char *kernbuf;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
|
@ -583,7 +583,7 @@ static int set_lcd_status(struct backlight_device *bd)
|
||||||
static ssize_t lcd_proc_write(struct file *file, const char __user *buf,
|
static ssize_t lcd_proc_write(struct file *file, const char __user *buf,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data;
|
struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data;
|
||||||
char cmd[42];
|
char cmd[42];
|
||||||
size_t len;
|
size_t len;
|
||||||
int value;
|
int value;
|
||||||
|
@ -650,7 +650,7 @@ static int video_proc_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t video_proc_write(struct file *file, const char __user *buf,
|
static ssize_t video_proc_write(struct file *file, const char __user *buf,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data;
|
struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data;
|
||||||
char *cmd, *buffer;
|
char *cmd, *buffer;
|
||||||
int ret;
|
int ret;
|
||||||
int value;
|
int value;
|
||||||
|
@ -750,7 +750,7 @@ static int fan_proc_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t fan_proc_write(struct file *file, const char __user *buf,
|
static ssize_t fan_proc_write(struct file *file, const char __user *buf,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data;
|
struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data;
|
||||||
char cmd[42];
|
char cmd[42];
|
||||||
size_t len;
|
size_t len;
|
||||||
int value;
|
int value;
|
||||||
|
@ -822,7 +822,7 @@ static int keys_proc_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t keys_proc_write(struct file *file, const char __user *buf,
|
static ssize_t keys_proc_write(struct file *file, const char __user *buf,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data;
|
struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data;
|
||||||
char cmd[42];
|
char cmd[42];
|
||||||
size_t len;
|
size_t len;
|
||||||
int value;
|
int value;
|
||||||
|
|
|
@ -30,7 +30,7 @@ static struct proc_dir_entry *isapnp_proc_bus_dir = NULL;
|
||||||
static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
|
static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
|
||||||
{
|
{
|
||||||
loff_t new = -1;
|
loff_t new = -1;
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
|
|
||||||
mutex_lock(&inode->i_mutex);
|
mutex_lock(&inode->i_mutex);
|
||||||
switch (whence) {
|
switch (whence) {
|
||||||
|
@ -55,7 +55,7 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
|
||||||
static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,
|
static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,
|
||||||
size_t nbytes, loff_t * ppos)
|
size_t nbytes, loff_t * ppos)
|
||||||
{
|
{
|
||||||
struct inode *ino = file->f_path.dentry->d_inode;
|
struct inode *ino = file_inode(file);
|
||||||
struct proc_dir_entry *dp = PDE(ino);
|
struct proc_dir_entry *dp = PDE(ino);
|
||||||
struct pnp_dev *dev = dp->data;
|
struct pnp_dev *dev = dp->data;
|
||||||
int pos = *ppos;
|
int pos = *ppos;
|
||||||
|
|
|
@ -244,7 +244,7 @@ static int pnpbios_proc_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t pnpbios_proc_write(struct file *file, const char __user *buf,
|
static ssize_t pnpbios_proc_write(struct file *file, const char __user *buf,
|
||||||
size_t count, loff_t *pos)
|
size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
void *data = PDE(file->f_path.dentry->d_inode)->data;
|
void *data = PDE(file_inode(file))->data;
|
||||||
struct pnp_bios_node *node;
|
struct pnp_bios_node *node;
|
||||||
int boot = (long)data >> 8;
|
int boot = (long)data >> 8;
|
||||||
u8 nodenum = (long)data;
|
u8 nodenum = (long)data;
|
||||||
|
|
|
@ -433,9 +433,9 @@ fs3270_open(struct inode *inode, struct file *filp)
|
||||||
struct idal_buffer *ib;
|
struct idal_buffer *ib;
|
||||||
int minor, rc = 0;
|
int minor, rc = 0;
|
||||||
|
|
||||||
if (imajor(filp->f_path.dentry->d_inode) != IBM_FS3270_MAJOR)
|
if (imajor(file_inode(filp)) != IBM_FS3270_MAJOR)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
minor = iminor(filp->f_path.dentry->d_inode);
|
minor = iminor(file_inode(filp));
|
||||||
/* Check for minor 0 multiplexer. */
|
/* Check for minor 0 multiplexer. */
|
||||||
if (minor == 0) {
|
if (minor == 0) {
|
||||||
struct tty_struct *tty = get_current_tty();
|
struct tty_struct *tty = get_current_tty();
|
||||||
|
|
|
@ -273,13 +273,13 @@ tapechar_open (struct inode *inode, struct file *filp)
|
||||||
int minor, rc;
|
int minor, rc;
|
||||||
|
|
||||||
DBF_EVENT(6, "TCHAR:open: %i:%i\n",
|
DBF_EVENT(6, "TCHAR:open: %i:%i\n",
|
||||||
imajor(filp->f_path.dentry->d_inode),
|
imajor(file_inode(filp)),
|
||||||
iminor(filp->f_path.dentry->d_inode));
|
iminor(file_inode(filp)));
|
||||||
|
|
||||||
if (imajor(filp->f_path.dentry->d_inode) != tapechar_major)
|
if (imajor(file_inode(filp)) != tapechar_major)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
minor = iminor(filp->f_path.dentry->d_inode);
|
minor = iminor(file_inode(filp));
|
||||||
device = tape_find_device(minor / TAPE_MINORS_PER_DEV);
|
device = tape_find_device(minor / TAPE_MINORS_PER_DEV);
|
||||||
if (IS_ERR(device)) {
|
if (IS_ERR(device)) {
|
||||||
DBF_EVENT(3, "TCHAR:open: tape_find_device() failed\n");
|
DBF_EVENT(3, "TCHAR:open: tape_find_device() failed\n");
|
||||||
|
|
|
@ -703,7 +703,7 @@ static int ur_open(struct inode *inode, struct file *file)
|
||||||
* We treat the minor number as the devno of the ur device
|
* We treat the minor number as the devno of the ur device
|
||||||
* to find in the driver tree.
|
* to find in the driver tree.
|
||||||
*/
|
*/
|
||||||
devno = MINOR(file->f_dentry->d_inode->i_rdev);
|
devno = MINOR(file_inode(file)->i_rdev);
|
||||||
|
|
||||||
urd = urdev_get_from_devno(devno);
|
urd = urdev_get_from_devno(devno);
|
||||||
if (!urd) {
|
if (!urd) {
|
||||||
|
|
|
@ -128,7 +128,7 @@ static int qstat_show(struct seq_file *m, void *v)
|
||||||
static int qstat_seq_open(struct inode *inode, struct file *filp)
|
static int qstat_seq_open(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
return single_open(filp, qstat_show,
|
return single_open(filp, qstat_show,
|
||||||
filp->f_path.dentry->d_inode->i_private);
|
file_inode(filp)->i_private);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations debugfs_fops = {
|
static const struct file_operations debugfs_fops = {
|
||||||
|
@ -221,7 +221,7 @@ static ssize_t qperf_seq_write(struct file *file, const char __user *ubuf,
|
||||||
static int qperf_seq_open(struct inode *inode, struct file *filp)
|
static int qperf_seq_open(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
return single_open(filp, qperf_show,
|
return single_open(filp, qperf_show,
|
||||||
filp->f_path.dentry->d_inode->i_private);
|
file_inode(filp)->i_private);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct file_operations debugfs_perf_fops = {
|
static struct file_operations debugfs_perf_fops = {
|
||||||
|
|
|
@ -107,7 +107,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
int error = 0;
|
int error = 0;
|
||||||
u8 ireg = 0;
|
u8 ireg = 0;
|
||||||
|
|
||||||
if (D7S_MINOR != iminor(file->f_path.dentry->d_inode))
|
if (D7S_MINOR != iminor(file_inode(file)))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
mutex_lock(&d7s_mutex);
|
mutex_lock(&d7s_mutex);
|
||||||
|
|
|
@ -640,7 +640,7 @@ static int twa_check_srl(TW_Device_Extension *tw_dev, int *flashed)
|
||||||
/* This function handles ioctl for the character device */
|
/* This function handles ioctl for the character device */
|
||||||
static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
long timeout;
|
long timeout;
|
||||||
unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0;
|
unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0;
|
||||||
dma_addr_t dma_handle;
|
dma_addr_t dma_handle;
|
||||||
|
|
|
@ -757,7 +757,7 @@ static long twl_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long
|
||||||
dma_addr_t dma_handle;
|
dma_addr_t dma_handle;
|
||||||
int request_id = 0;
|
int request_id = 0;
|
||||||
TW_Ioctl_Driver_Command driver_command;
|
TW_Ioctl_Driver_Command driver_command;
|
||||||
struct inode *inode = file->f_dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
TW_Ioctl_Buf_Apache *tw_ioctl;
|
TW_Ioctl_Buf_Apache *tw_ioctl;
|
||||||
TW_Command_Full *full_command_packet;
|
TW_Command_Full *full_command_packet;
|
||||||
TW_Device_Extension *tw_dev = twl_device_extension_list[iminor(inode)];
|
TW_Device_Extension *tw_dev = twl_device_extension_list[iminor(inode)];
|
||||||
|
|
|
@ -889,7 +889,7 @@ static long tw_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long a
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned int data_buffer_length = 0;
|
unsigned int data_buffer_length = 0;
|
||||||
unsigned long data_buffer_length_adjusted = 0;
|
unsigned long data_buffer_length_adjusted = 0;
|
||||||
struct inode *inode = file->f_dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
unsigned long *cpu_addr;
|
unsigned long *cpu_addr;
|
||||||
long timeout;
|
long timeout;
|
||||||
TW_New_Ioctl *tw_ioctl;
|
TW_New_Ioctl *tw_ioctl;
|
||||||
|
|
|
@ -71,7 +71,7 @@ static ssize_t
|
||||||
csio_mem_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
csio_mem_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
loff_t pos = *ppos;
|
loff_t pos = *ppos;
|
||||||
loff_t avail = file->f_path.dentry->d_inode->i_size;
|
loff_t avail = file_inode(file)->i_size;
|
||||||
unsigned int mem = (uintptr_t)file->private_data & 3;
|
unsigned int mem = (uintptr_t)file->private_data & 3;
|
||||||
struct csio_hw *hw = file->private_data - mem;
|
struct csio_hw *hw = file->private_data - mem;
|
||||||
|
|
||||||
|
|
|
@ -2161,7 +2161,7 @@ static long adpt_unlocked_ioctl(struct file *file, uint cmd, ulong arg)
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
long ret;
|
long ret;
|
||||||
|
|
||||||
inode = file->f_dentry->d_inode;
|
inode = file_inode(file);
|
||||||
|
|
||||||
mutex_lock(&adpt_mutex);
|
mutex_lock(&adpt_mutex);
|
||||||
ret = adpt_ioctl(inode, file, cmd, arg);
|
ret = adpt_ioctl(inode, file, cmd, arg);
|
||||||
|
@ -2177,7 +2177,7 @@ static long compat_adpt_ioctl(struct file *file,
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
long ret;
|
long ret;
|
||||||
|
|
||||||
inode = file->f_dentry->d_inode;
|
inode = file_inode(file);
|
||||||
|
|
||||||
mutex_lock(&adpt_mutex);
|
mutex_lock(&adpt_mutex);
|
||||||
|
|
||||||
|
|
|
@ -977,7 +977,7 @@ static int check_tape(struct scsi_tape *STp, struct file *filp)
|
||||||
struct st_modedef *STm;
|
struct st_modedef *STm;
|
||||||
struct st_partstat *STps;
|
struct st_partstat *STps;
|
||||||
char *name = tape_name(STp);
|
char *name = tape_name(STp);
|
||||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(filp);
|
||||||
int mode = TAPE_MODE(inode);
|
int mode = TAPE_MODE(inode);
|
||||||
|
|
||||||
STp->ready = ST_READY;
|
STp->ready = ST_READY;
|
||||||
|
|
|
@ -185,7 +185,7 @@ static int BcmFileDownload(struct bcm_mini_adapter *Adapter, const char *path, u
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Unable to Open %s\n", path);
|
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Unable to Open %s\n", path);
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Opened file is = %s and length =0x%lx to be downloaded at =0x%x", path, (unsigned long)flp->f_dentry->d_inode->i_size, loc);
|
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Opened file is = %s and length =0x%lx to be downloaded at =0x%x", path, (unsigned long)file_inode(flp)->i_size, loc);
|
||||||
do_gettimeofday(&tv);
|
do_gettimeofday(&tv);
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "download start %lx", ((tv.tv_sec * 1000) + (tv.tv_usec / 1000)));
|
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "download start %lx", ((tv.tv_sec * 1000) + (tv.tv_usec / 1000)));
|
||||||
|
|
|
@ -998,7 +998,7 @@ static int do_synchronize_cache(struct fsg_common *common)
|
||||||
static void invalidate_sub(struct fsg_lun *curlun)
|
static void invalidate_sub(struct fsg_lun *curlun)
|
||||||
{
|
{
|
||||||
struct file *filp = curlun->filp;
|
struct file *filp = curlun->filp;
|
||||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(filp);
|
||||||
unsigned long rc;
|
unsigned long rc;
|
||||||
|
|
||||||
rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
|
rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
|
||||||
|
|
|
@ -1065,7 +1065,7 @@ static int rndis_proc_show(struct seq_file *m, void *v)
|
||||||
static ssize_t rndis_proc_write(struct file *file, const char __user *buffer,
|
static ssize_t rndis_proc_write(struct file *file, const char __user *buffer,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
rndis_params *p = PDE(file->f_path.dentry->d_inode)->data;
|
rndis_params *p = PDE(file_inode(file))->data;
|
||||||
u32 speed = 0;
|
u32 speed = 0;
|
||||||
int i, fl_speed = 0;
|
int i, fl_speed = 0;
|
||||||
|
|
||||||
|
|
|
@ -656,7 +656,7 @@ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
|
||||||
if (!(filp->f_mode & FMODE_WRITE))
|
if (!(filp->f_mode & FMODE_WRITE))
|
||||||
ro = 1;
|
ro = 1;
|
||||||
|
|
||||||
inode = filp->f_path.dentry->d_inode;
|
inode = file_inode(filp);
|
||||||
if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) {
|
if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) {
|
||||||
LINFO(curlun, "invalid file type: %s\n", filename);
|
LINFO(curlun, "invalid file type: %s\n", filename);
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -354,7 +354,7 @@ static int dgrp_gen_proc_open(struct inode *inode, struct file *file)
|
||||||
struct dgrp_proc_entry *entry;
|
struct dgrp_proc_entry *entry;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
de = (struct proc_dir_entry *) PDE(file->f_dentry->d_inode);
|
de = (struct proc_dir_entry *) PDE(file_inode(file));
|
||||||
if (!de || !de->data) {
|
if (!de || !de->data) {
|
||||||
ret = -ENXIO;
|
ret = -ENXIO;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -384,7 +384,7 @@ static int dgrp_gen_proc_close(struct inode *inode, struct file *file)
|
||||||
struct proc_dir_entry *de;
|
struct proc_dir_entry *de;
|
||||||
struct dgrp_proc_entry *entry;
|
struct dgrp_proc_entry *entry;
|
||||||
|
|
||||||
de = (struct proc_dir_entry *) PDE(file->f_dentry->d_inode);
|
de = (struct proc_dir_entry *) PDE(file_inode(file));
|
||||||
if (!de || !de->data)
|
if (!de || !de->data)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ struct page **_drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask)
|
||||||
int i, npages;
|
int i, npages;
|
||||||
|
|
||||||
/* This is the shared memory object that backs the GEM resource */
|
/* This is the shared memory object that backs the GEM resource */
|
||||||
inode = obj->filp->f_path.dentry->d_inode;
|
inode = file_inode(obj->filp);
|
||||||
mapping = inode->i_mapping;
|
mapping = inode->i_mapping;
|
||||||
|
|
||||||
npages = obj->size >> PAGE_SHIFT;
|
npages = obj->size >> PAGE_SHIFT;
|
||||||
|
|
|
@ -411,7 +411,7 @@ struct socket *sockfd_to_socket(unsigned int sockfd)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inode = file->f_dentry->d_inode;
|
inode = file_inode(file);
|
||||||
|
|
||||||
if (!inode || !S_ISSOCK(inode->i_mode)) {
|
if (!inode || !S_ISSOCK(inode->i_mode)) {
|
||||||
fput(file);
|
fput(file);
|
||||||
|
|
|
@ -318,7 +318,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char __user *buf,
|
||||||
static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
|
static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
|
||||||
loff_t *ppos)
|
loff_t *ppos)
|
||||||
{
|
{
|
||||||
unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
|
unsigned int minor = MINOR(file_inode(file)->i_rdev);
|
||||||
ssize_t retval;
|
ssize_t retval;
|
||||||
size_t image_size;
|
size_t image_size;
|
||||||
size_t okcount;
|
size_t okcount;
|
||||||
|
@ -364,7 +364,7 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
|
||||||
static ssize_t vme_user_write(struct file *file, const char __user *buf,
|
static ssize_t vme_user_write(struct file *file, const char __user *buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
|
unsigned int minor = MINOR(file_inode(file)->i_rdev);
|
||||||
ssize_t retval;
|
ssize_t retval;
|
||||||
size_t image_size;
|
size_t image_size;
|
||||||
size_t okcount;
|
size_t okcount;
|
||||||
|
@ -410,7 +410,7 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
|
||||||
static loff_t vme_user_llseek(struct file *file, loff_t off, int whence)
|
static loff_t vme_user_llseek(struct file *file, loff_t off, int whence)
|
||||||
{
|
{
|
||||||
loff_t absolute = -1;
|
loff_t absolute = -1;
|
||||||
unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
|
unsigned int minor = MINOR(file_inode(file)->i_rdev);
|
||||||
size_t image_size;
|
size_t image_size;
|
||||||
|
|
||||||
if (minor == CONTROL_MINOR)
|
if (minor == CONTROL_MINOR)
|
||||||
|
@ -583,7 +583,7 @@ vme_user_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
mutex_lock(&vme_user_mutex);
|
mutex_lock(&vme_user_mutex);
|
||||||
ret = vme_user_ioctl(file->f_path.dentry->d_inode, file, cmd, arg);
|
ret = vme_user_ioctl(file_inode(file), file, cmd, arg);
|
||||||
mutex_unlock(&vme_user_mutex);
|
mutex_unlock(&vme_user_mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -265,7 +265,7 @@ static int fd_do_rw(struct se_cmd *cmd, struct scatterlist *sgl,
|
||||||
* the expected virt_size for struct file w/o a backing struct
|
* the expected virt_size for struct file w/o a backing struct
|
||||||
* block_device.
|
* block_device.
|
||||||
*/
|
*/
|
||||||
if (S_ISBLK(fd->f_dentry->d_inode->i_mode)) {
|
if (S_ISBLK(file_inode(fd)->i_mode)) {
|
||||||
if (ret < 0 || ret != cmd->data_length) {
|
if (ret < 0 || ret != cmd->data_length) {
|
||||||
pr_err("%s() returned %d, expecting %u for "
|
pr_err("%s() returned %d, expecting %u for "
|
||||||
"S_ISBLK\n", __func__, ret,
|
"S_ISBLK\n", __func__, ret,
|
||||||
|
|
|
@ -101,7 +101,7 @@ vcs_poll_data_get(struct file *file)
|
||||||
poll = kzalloc(sizeof(*poll), GFP_KERNEL);
|
poll = kzalloc(sizeof(*poll), GFP_KERNEL);
|
||||||
if (!poll)
|
if (!poll)
|
||||||
return NULL;
|
return NULL;
|
||||||
poll->cons_num = iminor(file->f_path.dentry->d_inode) & 127;
|
poll->cons_num = iminor(file_inode(file)) & 127;
|
||||||
init_waitqueue_head(&poll->waitq);
|
init_waitqueue_head(&poll->waitq);
|
||||||
poll->notifier.notifier_call = vcs_notifier;
|
poll->notifier.notifier_call = vcs_notifier;
|
||||||
if (register_vt_notifier(&poll->notifier) != 0) {
|
if (register_vt_notifier(&poll->notifier) != 0) {
|
||||||
|
@ -182,7 +182,7 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
console_lock();
|
console_lock();
|
||||||
size = vcs_size(file->f_path.dentry->d_inode);
|
size = vcs_size(file_inode(file));
|
||||||
console_unlock();
|
console_unlock();
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
return size;
|
return size;
|
||||||
|
@ -208,7 +208,7 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
|
||||||
static ssize_t
|
static ssize_t
|
||||||
vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
unsigned int currcons = iminor(inode);
|
unsigned int currcons = iminor(inode);
|
||||||
struct vc_data *vc;
|
struct vc_data *vc;
|
||||||
struct vcs_poll_data *poll;
|
struct vcs_poll_data *poll;
|
||||||
|
@ -386,7 +386,7 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||||
static ssize_t
|
static ssize_t
|
||||||
vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
|
vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
unsigned int currcons = iminor(inode);
|
unsigned int currcons = iminor(inode);
|
||||||
struct vc_data *vc;
|
struct vc_data *vc;
|
||||||
long pos;
|
long pos;
|
||||||
|
|
|
@ -658,7 +658,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig)
|
||||||
{
|
{
|
||||||
loff_t ret;
|
loff_t ret;
|
||||||
|
|
||||||
mutex_lock(&file->f_dentry->d_inode->i_mutex);
|
mutex_lock(&file_inode(file)->i_mutex);
|
||||||
|
|
||||||
switch (orig) {
|
switch (orig) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -674,7 +674,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig)
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_unlock(&file->f_dentry->d_inode->i_mutex);
|
mutex_unlock(&file_inode(file)->i_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig)
|
||||||
{
|
{
|
||||||
loff_t ret;
|
loff_t ret;
|
||||||
|
|
||||||
mutex_lock(&file->f_dentry->d_inode->i_mutex);
|
mutex_lock(&file_inode(file)->i_mutex);
|
||||||
|
|
||||||
switch (orig) {
|
switch (orig) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -176,7 +176,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig)
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_unlock(&file->f_dentry->d_inode->i_mutex);
|
mutex_unlock(&file_inode(file)->i_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1970,7 +1970,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
|
||||||
void __user *p)
|
void __user *p)
|
||||||
{
|
{
|
||||||
struct dev_state *ps = file->private_data;
|
struct dev_state *ps = file->private_data;
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
struct usb_device *dev = ps->dev;
|
struct usb_device *dev = ps->dev;
|
||||||
int ret = -ENOTTY;
|
int ret = -ENOTTY;
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ static ssize_t queue_dbg_read(struct file *file, char __user *buf,
|
||||||
if (!access_ok(VERIFY_WRITE, buf, nbytes))
|
if (!access_ok(VERIFY_WRITE, buf, nbytes))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
mutex_lock(&file->f_dentry->d_inode->i_mutex);
|
mutex_lock(&file_inode(file)->i_mutex);
|
||||||
list_for_each_entry_safe(req, tmp_req, queue, queue) {
|
list_for_each_entry_safe(req, tmp_req, queue, queue) {
|
||||||
len = snprintf(tmpbuf, sizeof(tmpbuf),
|
len = snprintf(tmpbuf, sizeof(tmpbuf),
|
||||||
"%8p %08x %c%c%c %5d %c%c%c\n",
|
"%8p %08x %c%c%c %5d %c%c%c\n",
|
||||||
|
@ -120,7 +120,7 @@ static ssize_t queue_dbg_read(struct file *file, char __user *buf,
|
||||||
nbytes -= len;
|
nbytes -= len;
|
||||||
buf += len;
|
buf += len;
|
||||||
}
|
}
|
||||||
mutex_unlock(&file->f_dentry->d_inode->i_mutex);
|
mutex_unlock(&file_inode(file)->i_mutex);
|
||||||
|
|
||||||
return actual;
|
return actual;
|
||||||
}
|
}
|
||||||
|
@ -168,13 +168,13 @@ static int regs_dbg_open(struct inode *inode, struct file *file)
|
||||||
static ssize_t regs_dbg_read(struct file *file, char __user *buf,
|
static ssize_t regs_dbg_read(struct file *file, char __user *buf,
|
||||||
size_t nbytes, loff_t *ppos)
|
size_t nbytes, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
mutex_lock(&inode->i_mutex);
|
mutex_lock(&inode->i_mutex);
|
||||||
ret = simple_read_from_buffer(buf, nbytes, ppos,
|
ret = simple_read_from_buffer(buf, nbytes, ppos,
|
||||||
file->private_data,
|
file->private_data,
|
||||||
file->f_dentry->d_inode->i_size);
|
file_inode(file)->i_size);
|
||||||
mutex_unlock(&inode->i_mutex);
|
mutex_unlock(&inode->i_mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -992,7 +992,7 @@ static int do_synchronize_cache(struct fsg_common *common)
|
||||||
static void invalidate_sub(struct fsg_lun *curlun)
|
static void invalidate_sub(struct fsg_lun *curlun)
|
||||||
{
|
{
|
||||||
struct file *filp = curlun->filp;
|
struct file *filp = curlun->filp;
|
||||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(filp);
|
||||||
unsigned long rc;
|
unsigned long rc;
|
||||||
|
|
||||||
rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
|
rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
|
||||||
|
|
|
@ -688,7 +688,7 @@ static int
|
||||||
printer_fsync(struct file *fd, loff_t start, loff_t end, int datasync)
|
printer_fsync(struct file *fd, loff_t start, loff_t end, int datasync)
|
||||||
{
|
{
|
||||||
struct printer_dev *dev = fd->private_data;
|
struct printer_dev *dev = fd->private_data;
|
||||||
struct inode *inode = fd->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(fd);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int tx_list_empty;
|
int tx_list_empty;
|
||||||
|
|
||||||
|
|
|
@ -1065,7 +1065,7 @@ static int rndis_proc_show(struct seq_file *m, void *v)
|
||||||
static ssize_t rndis_proc_write(struct file *file, const char __user *buffer,
|
static ssize_t rndis_proc_write(struct file *file, const char __user *buffer,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
rndis_params *p = PDE(file->f_path.dentry->d_inode)->data;
|
rndis_params *p = PDE(file_inode(file))->data;
|
||||||
u32 speed = 0;
|
u32 speed = 0;
|
||||||
int i, fl_speed = 0;
|
int i, fl_speed = 0;
|
||||||
|
|
||||||
|
|
|
@ -501,7 +501,7 @@ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
|
||||||
if (!(filp->f_mode & FMODE_WRITE))
|
if (!(filp->f_mode & FMODE_WRITE))
|
||||||
ro = 1;
|
ro = 1;
|
||||||
|
|
||||||
inode = filp->f_path.dentry->d_inode;
|
inode = file_inode(filp);
|
||||||
if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) {
|
if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) {
|
||||||
LINFO(curlun, "invalid file type: %s\n", filename);
|
LINFO(curlun, "invalid file type: %s\n", filename);
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -69,7 +69,7 @@ static int fb_deferred_io_fault(struct vm_area_struct *vma,
|
||||||
int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
||||||
{
|
{
|
||||||
struct fb_info *info = file->private_data;
|
struct fb_info *info = file->private_data;
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
int err = filemap_write_and_wait_range(inode->i_mapping, start, end);
|
int err = filemap_write_and_wait_range(inode->i_mapping, start, end);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -727,7 +727,7 @@ static const struct file_operations fb_proc_fops = {
|
||||||
*/
|
*/
|
||||||
static struct fb_info *file_fb_info(struct file *file)
|
static struct fb_info *file_fb_info(struct file *file)
|
||||||
{
|
{
|
||||||
struct inode *inode = file->f_path.dentry->d_inode;
|
struct inode *inode = file_inode(file);
|
||||||
int fbidx = iminor(inode);
|
int fbidx = iminor(inode);
|
||||||
struct fb_info *info = registered_fb[fbidx];
|
struct fb_info *info = registered_fb[fbidx];
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue