OSDN Git Service

libext2fs: stop iterating dirents when done linking
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 18 Oct 2013 04:49:01 +0000 (21:49 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 23 Oct 2013 23:29:20 +0000 (19:29 -0400)
When we've succesfully linked an inode into a directory, we can stop
iterating the directory.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/link.c

index 2f4f54a..bf3c859 100644 (file)
@@ -43,7 +43,7 @@ static int link_proc(struct ext2_dir_entry *dirent,
        int ret = 0;
 
        if (ls->done)
-               return 0;
+               return DIRENT_ABORT;
 
        rec_len = EXT2_DIR_REC_LEN(ls->namelen);