These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / fs / ext4 / inline.c
index 095c7a2..d884989 100644 (file)
@@ -434,8 +434,7 @@ static int ext4_destroy_inline_data_nolock(handle_t *handle,
        memset((void *)ext4_raw_inode(&is.iloc)->i_block,
                0, EXT4_MIN_INLINE_DATA_SIZE);
 
-       if (EXT4_HAS_INCOMPAT_FEATURE(inode->i_sb,
-                                     EXT4_FEATURE_INCOMPAT_EXTENTS)) {
+       if (ext4_has_feature_extents(inode->i_sb)) {
                if (S_ISDIR(inode->i_mode) ||
                    S_ISREG(inode->i_mode) || S_ISLNK(inode->i_mode)) {
                        ext4_set_inode_flag(inode, EXT4_INODE_EXTENTS);
@@ -995,20 +994,18 @@ void ext4_show_inline_dir(struct inode *dir, struct buffer_head *bh,
  * and -EEXIST if directory entry already exists.
  */
 static int ext4_add_dirent_to_inline(handle_t *handle,
+                                    struct ext4_filename *fname,
                                     struct dentry *dentry,
                                     struct inode *inode,
                                     struct ext4_iloc *iloc,
                                     void *inline_start, int inline_size)
 {
        struct inode    *dir = d_inode(dentry->d_parent);
-       const char      *name = dentry->d_name.name;
-       int             namelen = dentry->d_name.len;
        int             err;
        struct ext4_dir_entry_2 *de;
 
-       err = ext4_find_dest_de(dir, inode, iloc->bh,
-                               inline_start, inline_size,
-                               name, namelen, &de);
+       err = ext4_find_dest_de(dir, inode, iloc->bh, inline_start,
+                               inline_size, fname, &de);
        if (err)
                return err;
 
@@ -1016,8 +1013,7 @@ static int ext4_add_dirent_to_inline(handle_t *handle,
        err = ext4_journal_get_write_access(handle, iloc->bh);
        if (err)
                return err;
-       ext4_insert_dentry(dir, inode, de, inline_size, &dentry->d_name,
-                          name, namelen);
+       ext4_insert_dentry(dir, inode, de, inline_size, fname);
 
        ext4_show_inline_dir(dir, iloc->bh, inline_start, inline_size);
 
@@ -1248,8 +1244,8 @@ out:
  * If succeeds, return 0. If not, extended the inline dir and copied data to
  * the new created block.
  */
-int ext4_try_add_inline_entry(handle_t *handle, struct dentry *dentry,
-                             struct inode *inode)
+int ext4_try_add_inline_entry(handle_t *handle, struct ext4_filename *fname,
+                             struct dentry *dentry, struct inode *inode)
 {
        int ret, inline_size;
        void *inline_start;
@@ -1268,7 +1264,7 @@ int ext4_try_add_inline_entry(handle_t *handle, struct dentry *dentry,
                                                 EXT4_INLINE_DOTDOT_SIZE;
        inline_size = EXT4_MIN_INLINE_DATA_SIZE - EXT4_INLINE_DOTDOT_SIZE;
 
-       ret = ext4_add_dirent_to_inline(handle, dentry, inode, &iloc,
+       ret = ext4_add_dirent_to_inline(handle, fname, dentry, inode, &iloc,
                                        inline_start, inline_size);
        if (ret != -ENOSPC)
                goto out;
@@ -1289,8 +1285,9 @@ int ext4_try_add_inline_entry(handle_t *handle, struct dentry *dentry,
        if (inline_size) {
                inline_start = ext4_get_inline_xattr_pos(dir, &iloc);
 
-               ret = ext4_add_dirent_to_inline(handle, dentry, inode, &iloc,
-                                               inline_start, inline_size);
+               ret = ext4_add_dirent_to_inline(handle, fname, dentry,
+                                               inode, &iloc, inline_start,
+                                               inline_size);
 
                if (ret != -ENOSPC)
                        goto out;
@@ -1611,6 +1608,7 @@ out:
 }
 
 struct buffer_head *ext4_find_inline_entry(struct inode *dir,
+                                       struct ext4_filename *fname,
                                        const struct qstr *d_name,
                                        struct ext4_dir_entry_2 **res_dir,
                                        int *has_inline_data)
@@ -1632,8 +1630,8 @@ struct buffer_head *ext4_find_inline_entry(struct inode *dir,
        inline_start = (void *)ext4_raw_inode(&iloc)->i_block +
                                                EXT4_INLINE_DOTDOT_SIZE;
        inline_size = EXT4_MIN_INLINE_DATA_SIZE - EXT4_INLINE_DOTDOT_SIZE;
-       ret = search_dir(iloc.bh, inline_start, inline_size,
-                        dir, d_name, 0, res_dir);
+       ret = ext4_search_dir(iloc.bh, inline_start, inline_size,
+                             dir, fname, d_name, 0, res_dir);
        if (ret == 1)
                goto out_find;
        if (ret < 0)
@@ -1645,8 +1643,8 @@ struct buffer_head *ext4_find_inline_entry(struct inode *dir,
        inline_start = ext4_get_inline_xattr_pos(dir, &iloc);
        inline_size = ext4_get_inline_size(dir) - EXT4_MIN_INLINE_DATA_SIZE;
 
-       ret = search_dir(iloc.bh, inline_start, inline_size,
-                        dir, d_name, 0, res_dir);
+       ret = ext4_search_dir(iloc.bh, inline_start, inline_size,
+                             dir, fname, d_name, 0, res_dir);
        if (ret == 1)
                goto out_find;