Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / fs / sysv / dir.c
index d42291d08215abd016d4e3b5aac03fa753ce70b6..63c1bcb224ee886e5261b5b3a9867a581f872f01 100644 (file)
@@ -33,11 +33,6 @@ static inline void dir_put_page(struct page *page)
        page_cache_release(page);
 }
 
-static inline unsigned long dir_pages(struct inode *inode)
-{
-       return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
-}
-
 static int dir_commit_chunk(struct page *page, loff_t pos, unsigned len)
 {
        struct address_space *mapping = page->mapping;
@@ -132,7 +127,7 @@ struct sysv_dir_entry *sysv_find_entry(struct dentry *dentry, struct page **res_
 {
        const char * name = dentry->d_name.name;
        int namelen = dentry->d_name.len;
-       struct inode * dir = dentry->d_parent->d_inode;
+       struct inode * dir = d_inode(dentry->d_parent);
        unsigned long start, n;
        unsigned long npages = dir_pages(dir);
        struct page *page = NULL;
@@ -176,7 +171,7 @@ found:
 
 int sysv_add_link(struct dentry *dentry, struct inode *inode)
 {
-       struct inode *dir = dentry->d_parent->d_inode;
+       struct inode *dir = d_inode(dentry->d_parent);
        const char * name = dentry->d_name.name;
        int namelen = dentry->d_name.len;
        struct page *page = NULL;