Commit 6d63079a authored by Josef Sipek's avatar Josef Sipek Committed by Linus Torvalds

[PATCH] struct path: convert ipc

Signed-off-by: default avatarJosef Sipek <jsipek@fsl.cs.sunysb.edu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1cfd6e64
...@@ -322,7 +322,7 @@ static int mqueue_unlink(struct inode *dir, struct dentry *dentry) ...@@ -322,7 +322,7 @@ static int mqueue_unlink(struct inode *dir, struct dentry *dentry)
static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, static ssize_t mqueue_read_file(struct file *filp, char __user *u_data,
size_t count, loff_t * off) size_t count, loff_t * off)
{ {
struct mqueue_inode_info *info = MQUEUE_I(filp->f_dentry->d_inode); struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode);
char buffer[FILENT_SIZE]; char buffer[FILENT_SIZE];
size_t slen; size_t slen;
loff_t o; loff_t o;
...@@ -354,13 +354,13 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, ...@@ -354,13 +354,13 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data,
return -EFAULT; return -EFAULT;
*off = o + count; *off = o + count;
filp->f_dentry->d_inode->i_atime = filp->f_dentry->d_inode->i_ctime = CURRENT_TIME; filp->f_path.dentry->d_inode->i_atime = filp->f_path.dentry->d_inode->i_ctime = CURRENT_TIME;
return count; return count;
} }
static int mqueue_flush_file(struct file *filp, fl_owner_t id) static int mqueue_flush_file(struct file *filp, fl_owner_t id)
{ {
struct mqueue_inode_info *info = MQUEUE_I(filp->f_dentry->d_inode); struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode);
spin_lock(&info->lock); spin_lock(&info->lock);
if (task_tgid(current) == info->notify_owner) if (task_tgid(current) == info->notify_owner)
...@@ -372,7 +372,7 @@ static int mqueue_flush_file(struct file *filp, fl_owner_t id) ...@@ -372,7 +372,7 @@ static int mqueue_flush_file(struct file *filp, fl_owner_t id)
static unsigned int mqueue_poll_file(struct file *filp, struct poll_table_struct *poll_tab) static unsigned int mqueue_poll_file(struct file *filp, struct poll_table_struct *poll_tab)
{ {
struct mqueue_inode_info *info = MQUEUE_I(filp->f_dentry->d_inode); struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode);
int retval = 0; int retval = 0;
poll_wait(filp, &info->wait_q, poll_tab); poll_wait(filp, &info->wait_q, poll_tab);
...@@ -836,7 +836,7 @@ asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, ...@@ -836,7 +836,7 @@ asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr,
if (unlikely(!filp)) if (unlikely(!filp))
goto out; goto out;
inode = filp->f_dentry->d_inode; inode = filp->f_path.dentry->d_inode;
if (unlikely(filp->f_op != &mqueue_file_operations)) if (unlikely(filp->f_op != &mqueue_file_operations))
goto out_fput; goto out_fput;
info = MQUEUE_I(inode); info = MQUEUE_I(inode);
...@@ -919,7 +919,7 @@ asmlinkage ssize_t sys_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, ...@@ -919,7 +919,7 @@ asmlinkage ssize_t sys_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr,
if (unlikely(!filp)) if (unlikely(!filp))
goto out; goto out;
inode = filp->f_dentry->d_inode; inode = filp->f_path.dentry->d_inode;
if (unlikely(filp->f_op != &mqueue_file_operations)) if (unlikely(filp->f_op != &mqueue_file_operations))
goto out_fput; goto out_fput;
info = MQUEUE_I(inode); info = MQUEUE_I(inode);
...@@ -1056,7 +1056,7 @@ asmlinkage long sys_mq_notify(mqd_t mqdes, ...@@ -1056,7 +1056,7 @@ asmlinkage long sys_mq_notify(mqd_t mqdes,
if (!filp) if (!filp)
goto out; goto out;
inode = filp->f_dentry->d_inode; inode = filp->f_path.dentry->d_inode;
if (unlikely(filp->f_op != &mqueue_file_operations)) if (unlikely(filp->f_op != &mqueue_file_operations))
goto out_fput; goto out_fput;
info = MQUEUE_I(inode); info = MQUEUE_I(inode);
...@@ -1126,7 +1126,7 @@ asmlinkage long sys_mq_getsetattr(mqd_t mqdes, ...@@ -1126,7 +1126,7 @@ asmlinkage long sys_mq_getsetattr(mqd_t mqdes,
if (!filp) if (!filp)
goto out; goto out;
inode = filp->f_dentry->d_inode; inode = filp->f_path.dentry->d_inode;
if (unlikely(filp->f_op != &mqueue_file_operations)) if (unlikely(filp->f_op != &mqueue_file_operations))
goto out_fput; goto out_fput;
info = MQUEUE_I(inode); info = MQUEUE_I(inode);
......
...@@ -168,7 +168,7 @@ static inline void shm_inc(struct ipc_namespace *ns, int id) ...@@ -168,7 +168,7 @@ static inline void shm_inc(struct ipc_namespace *ns, int id)
static void shm_open(struct vm_area_struct *shmd) static void shm_open(struct vm_area_struct *shmd)
{ {
shm_inc(shm_file_ns(shmd->vm_file), shm_inc(shm_file_ns(shmd->vm_file),
shmd->vm_file->f_dentry->d_inode->i_ino); shmd->vm_file->f_path.dentry->d_inode->i_ino);
} }
/* /*
...@@ -187,7 +187,7 @@ static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp) ...@@ -187,7 +187,7 @@ static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp)
if (!is_file_hugepages(shp->shm_file)) if (!is_file_hugepages(shp->shm_file))
shmem_lock(shp->shm_file, 0, shp->mlock_user); shmem_lock(shp->shm_file, 0, shp->mlock_user);
else else
user_shm_unlock(shp->shm_file->f_dentry->d_inode->i_size, user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size,
shp->mlock_user); shp->mlock_user);
fput (shp->shm_file); fput (shp->shm_file);
security_shm_free(shp); security_shm_free(shp);
...@@ -203,7 +203,7 @@ static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp) ...@@ -203,7 +203,7 @@ static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp)
static void shm_close (struct vm_area_struct *shmd) static void shm_close (struct vm_area_struct *shmd)
{ {
struct file * file = shmd->vm_file; struct file * file = shmd->vm_file;
int id = file->f_dentry->d_inode->i_ino; int id = file->f_path.dentry->d_inode->i_ino;
struct shmid_kernel *shp; struct shmid_kernel *shp;
struct ipc_namespace *ns; struct ipc_namespace *ns;
...@@ -233,7 +233,7 @@ static int shm_mmap(struct file * file, struct vm_area_struct * vma) ...@@ -233,7 +233,7 @@ static int shm_mmap(struct file * file, struct vm_area_struct * vma)
vma->vm_ops = &shm_vm_ops; vma->vm_ops = &shm_vm_ops;
if (!(vma->vm_flags & VM_WRITE)) if (!(vma->vm_flags & VM_WRITE))
vma->vm_flags &= ~VM_MAYWRITE; vma->vm_flags &= ~VM_MAYWRITE;
shm_inc(shm_file_ns(file), file->f_dentry->d_inode->i_ino); shm_inc(shm_file_ns(file), file->f_path.dentry->d_inode->i_ino);
} }
return ret; return ret;
...@@ -330,7 +330,7 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) ...@@ -330,7 +330,7 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size)
shp->shm_nattch = 0; shp->shm_nattch = 0;
shp->id = shm_buildid(ns, id, shp->shm_perm.seq); shp->id = shm_buildid(ns, id, shp->shm_perm.seq);
shp->shm_file = file; shp->shm_file = file;
file->f_dentry->d_inode->i_ino = shp->id; file->f_path.dentry->d_inode->i_ino = shp->id;
shm_file_ns(file) = get_ipc_ns(ns); shm_file_ns(file) = get_ipc_ns(ns);
...@@ -495,7 +495,7 @@ static void shm_get_stat(struct ipc_namespace *ns, unsigned long *rss, ...@@ -495,7 +495,7 @@ static void shm_get_stat(struct ipc_namespace *ns, unsigned long *rss,
if(!shp) if(!shp)
continue; continue;
inode = shp->shm_file->f_dentry->d_inode; inode = shp->shm_file->f_path.dentry->d_inode;
if (is_file_hugepages(shp->shm_file)) { if (is_file_hugepages(shp->shm_file)) {
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
...@@ -843,7 +843,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) ...@@ -843,7 +843,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
} }
file = shp->shm_file; file = shp->shm_file;
size = i_size_read(file->f_dentry->d_inode); size = i_size_read(file->f_path.dentry->d_inode);
shp->shm_nattch++; shp->shm_nattch++;
shm_unlock(shp); shm_unlock(shp);
...@@ -948,7 +948,7 @@ asmlinkage long sys_shmdt(char __user *shmaddr) ...@@ -948,7 +948,7 @@ asmlinkage long sys_shmdt(char __user *shmaddr)
(vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) { (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) {
size = vma->vm_file->f_dentry->d_inode->i_size; size = vma->vm_file->f_path.dentry->d_inode->i_size;
do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start);
/* /*
* We discovered the size of the shm segment, so * We discovered the size of the shm segment, so
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment