1 ext4 crypto: export ext4_empty_dir()
3 From: Michael Halcrow <mhalcrow@google.com>
5 Required for future encryption xattr changes.
7 Change-Id: Ib12fcceed8af6e2460bc387ec94434cf51b7befb
8 Signed-off-by: Michael Halcrow <mhalcrow@google.com>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 fs/ext4/namei.c | 11 ++++++-----
13 2 files changed, 7 insertions(+), 5 deletions(-)
15 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
16 index 1ac1da6..92a9bf6 100644
19 @@ -2187,6 +2187,7 @@ extern int ext4_generic_delete_entry(handle_t *handle,
23 +extern int ext4_empty_dir(struct inode *inode);
26 extern int ext4_group_add(struct super_block *sb,
27 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
28 index 4262118..55dc956 100644
31 @@ -2450,7 +2450,7 @@ out_stop:
33 * routine to check that the specified directory is empty (for rmdir)
35 -static int empty_dir(struct inode *inode)
36 +int ext4_empty_dir(struct inode *inode)
39 struct buffer_head *bh;
40 @@ -2718,7 +2718,7 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry)
44 - if (!empty_dir(inode))
45 + if (!ext4_empty_dir(inode))
48 handle = ext4_journal_start(dir, EXT4_HT_DIR,
49 @@ -3273,7 +3273,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
50 if (S_ISDIR(old.inode->i_mode)) {
53 - if (!empty_dir(new.inode))
54 + if (!ext4_empty_dir(new.inode))
58 @@ -3347,8 +3347,9 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
60 ext4_dec_count(handle, old.dir);
62 - /* checked empty_dir above, can't have another parent,
63 - * ext4_dec_count() won't work for many-linked dirs */
64 + /* checked ext4_empty_dir above, can't have another
65 + * parent, ext4_dec_count() won't work for many-linked
67 clear_nlink(new.inode);
69 ext4_inc_count(handle, new.dir);