ext4 crypto: migrate into vfs's crypto engine
This patch removes the most parts of internal crypto codes. And then, it modifies and adds some ext4-specific crypt codes to use the generic facility. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:

committed by
Theodore Ts'o

parent
ff0031d848
commit
a7550b30ab
@@ -1326,7 +1326,7 @@ int htree_inlinedir_to_tree(struct file *dir_file,
|
||||
struct ext4_iloc iloc;
|
||||
void *dir_buf = NULL;
|
||||
struct ext4_dir_entry_2 fake;
|
||||
struct ext4_str tmp_str;
|
||||
struct fscrypt_str tmp_str;
|
||||
|
||||
ret = ext4_get_inode_loc(inode, &iloc);
|
||||
if (ret)
|
||||
@@ -1739,20 +1739,20 @@ ext4_get_inline_entry(struct inode *inode,
|
||||
return (struct ext4_dir_entry_2 *)(inline_pos + offset);
|
||||
}
|
||||
|
||||
int empty_inline_dir(struct inode *dir, int *has_inline_data)
|
||||
bool empty_inline_dir(struct inode *dir, int *has_inline_data)
|
||||
{
|
||||
int err, inline_size;
|
||||
struct ext4_iloc iloc;
|
||||
void *inline_pos;
|
||||
unsigned int offset;
|
||||
struct ext4_dir_entry_2 *de;
|
||||
int ret = 1;
|
||||
bool ret = true;
|
||||
|
||||
err = ext4_get_inode_loc(dir, &iloc);
|
||||
if (err) {
|
||||
EXT4_ERROR_INODE(dir, "error %d getting inode %lu block",
|
||||
err, dir->i_ino);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
down_read(&EXT4_I(dir)->xattr_sem);
|
||||
@@ -1766,7 +1766,7 @@ int empty_inline_dir(struct inode *dir, int *has_inline_data)
|
||||
ext4_warning(dir->i_sb,
|
||||
"bad inline directory (dir #%lu) - no `..'",
|
||||
dir->i_ino);
|
||||
ret = 1;
|
||||
ret = true;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1784,11 +1784,11 @@ int empty_inline_dir(struct inode *dir, int *has_inline_data)
|
||||
dir->i_ino, le32_to_cpu(de->inode),
|
||||
le16_to_cpu(de->rec_len), de->name_len,
|
||||
inline_size);
|
||||
ret = 1;
|
||||
ret = true;
|
||||
goto out;
|
||||
}
|
||||
if (le32_to_cpu(de->inode)) {
|
||||
ret = 0;
|
||||
ret = false;
|
||||
goto out;
|
||||
}
|
||||
offset += ext4_rec_len_from_disk(de->rec_len, inline_size);
|
||||
|
Reference in New Issue
Block a user