Whamcloud - gitweb
b=21665 a small fix for "lfs osts"
authorAndrew Perepechko <Andrew.Perepechko@Sun.COM>
Wed, 10 Feb 2010 16:34:14 +0000 (19:34 +0300)
committerJohann Lombardi <johann@sun.com>
Wed, 10 Feb 2010 18:25:16 +0000 (19:25 +0100)
a=Joseph Herring
i=Andreas Dilger
i=Andrew Perepechko

Actually, we don't want to traverse the directory tree,
so return a positive value from sem_init to terminate
the traversal before it starts.

lustre/utils/liblustreapi.c

index 39daf55..d8a35ae 100644 (file)
@@ -1325,11 +1325,18 @@ static int cb_ostlist(char *path, DIR *parent, DIR *d, void *data,
                        struct dirent64 *de)
 {
         struct find_param *param = (struct find_param *)data;
+        int ret;
 
         LASSERT(parent != NULL || d != NULL);
 
         /* Prepare odb. */
-        return setup_obd_uuid(d ? d : parent, path, param);
+        ret = setup_obd_uuid(d ? d : parent, path, param);
+
+        /* We don't want to actually traverse the directory tree,
+         * so return a positive value from sem_init to terminate
+         * the traversal before it starts.
+         */
+        return ret == 0 ? 1 : ret;
 }
 
 int llapi_ostlist(char *path, struct find_param *param)