Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / sunrpc / cache.c
index 55024714f0010824cb85c3e5eea5efedcefa274f..25d58e766014bf751ba404cac60893b2cfc5ecf9 100644 (file)
@@ -670,13 +670,13 @@ static void cache_revisit_request(struct cache_head *item)
 {
        struct cache_deferred_req *dreq;
        struct list_head pending;
-       struct hlist_node *lp, *tmp;
+       struct hlist_node *tmp;
        int hash = DFR_HASH(item);
 
        INIT_LIST_HEAD(&pending);
        spin_lock(&cache_defer_lock);
 
-       hlist_for_each_entry_safe(dreq, lp, tmp, &cache_defer_hash[hash], hash)
+       hlist_for_each_entry_safe(dreq, tmp, &cache_defer_hash[hash], hash)
                if (dreq->item == item) {
                        __unhash_deferred_req(dreq);
                        list_add(&dreq->recent, &pending);
@@ -767,7 +767,7 @@ static ssize_t cache_read(struct file *filp, char __user *buf, size_t count,
 {
        struct cache_reader *rp = filp->private_data;
        struct cache_request *rq;
-       struct inode *inode = filp->f_path.dentry->d_inode;
+       struct inode *inode = file_inode(filp);
        int err;
 
        if (count == 0)
@@ -905,7 +905,7 @@ static ssize_t cache_write(struct file *filp, const char __user *buf,
                           struct cache_detail *cd)
 {
        struct address_space *mapping = filp->f_mapping;
-       struct inode *inode = filp->f_path.dentry->d_inode;
+       struct inode *inode = file_inode(filp);
        ssize_t ret = -EINVAL;
 
        if (!cd->cache_parse)
@@ -1461,7 +1461,7 @@ static ssize_t write_flush(struct file *file, const char __user *buf,
 static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
                                 size_t count, loff_t *ppos)
 {
-       struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data;
+       struct cache_detail *cd = PDE(file_inode(filp))->data;
 
        return cache_read(filp, buf, count, ppos, cd);
 }
@@ -1469,14 +1469,14 @@ static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
 static ssize_t cache_write_procfs(struct file *filp, const char __user *buf,
                                  size_t count, loff_t *ppos)
 {
-       struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data;
+       struct cache_detail *cd = PDE(file_inode(filp))->data;
 
        return cache_write(filp, buf, count, ppos, cd);
 }
 
 static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
 {
-       struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data;
+       struct cache_detail *cd = PDE(file_inode(filp))->data;
 
        return cache_poll(filp, wait, cd);
 }
@@ -1484,7 +1484,7 @@ static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
 static long cache_ioctl_procfs(struct file *filp,
                               unsigned int cmd, unsigned long arg)
 {
-       struct inode *inode = filp->f_path.dentry->d_inode;
+       struct inode *inode = file_inode(filp);
        struct cache_detail *cd = PDE(inode)->data;
 
        return cache_ioctl(inode, filp, cmd, arg, cd);
@@ -1553,7 +1553,7 @@ static int release_flush_procfs(struct inode *inode, struct file *filp)
 static ssize_t read_flush_procfs(struct file *filp, char __user *buf,
                            size_t count, loff_t *ppos)
 {
-       struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data;
+       struct cache_detail *cd = PDE(file_inode(filp))->data;
 
        return read_flush(filp, buf, count, ppos, cd);
 }
@@ -1562,7 +1562,7 @@ static ssize_t write_flush_procfs(struct file *filp,
                                  const char __user *buf,
                                  size_t count, loff_t *ppos)
 {
-       struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data;
+       struct cache_detail *cd = PDE(file_inode(filp))->data;
 
        return write_flush(filp, buf, count, ppos, cd);
 }
@@ -1693,7 +1693,7 @@ EXPORT_SYMBOL_GPL(cache_destroy_net);
 static ssize_t cache_read_pipefs(struct file *filp, char __user *buf,
                                 size_t count, loff_t *ppos)
 {
-       struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private;
+       struct cache_detail *cd = RPC_I(file_inode(filp))->private;
 
        return cache_read(filp, buf, count, ppos, cd);
 }
@@ -1701,14 +1701,14 @@ static ssize_t cache_read_pipefs(struct file *filp, char __user *buf,
 static ssize_t cache_write_pipefs(struct file *filp, const char __user *buf,
                                  size_t count, loff_t *ppos)
 {
-       struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private;
+       struct cache_detail *cd = RPC_I(file_inode(filp))->private;
 
        return cache_write(filp, buf, count, ppos, cd);
 }
 
 static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait)
 {
-       struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private;
+       struct cache_detail *cd = RPC_I(file_inode(filp))->private;
 
        return cache_poll(filp, wait, cd);
 }
@@ -1716,7 +1716,7 @@ static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait)
 static long cache_ioctl_pipefs(struct file *filp,
                              unsigned int cmd, unsigned long arg)
 {
-       struct inode *inode = filp->f_dentry->d_inode;
+       struct inode *inode = file_inode(filp);
        struct cache_detail *cd = RPC_I(inode)->private;
 
        return cache_ioctl(inode, filp, cmd, arg, cd);
@@ -1785,7 +1785,7 @@ static int release_flush_pipefs(struct inode *inode, struct file *filp)
 static ssize_t read_flush_pipefs(struct file *filp, char __user *buf,
                            size_t count, loff_t *ppos)
 {
-       struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private;
+       struct cache_detail *cd = RPC_I(file_inode(filp))->private;
 
        return read_flush(filp, buf, count, ppos, cd);
 }
@@ -1794,7 +1794,7 @@ static ssize_t write_flush_pipefs(struct file *filp,
                                  const char __user *buf,
                                  size_t count, loff_t *ppos)
 {
-       struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private;
+       struct cache_detail *cd = RPC_I(file_inode(filp))->private;
 
        return write_flush(filp, buf, count, ppos, cd);
 }