static uint64_t num_files;
static uint64_t num_bytes;
+/* id of the device containing the base dir. */
+static dev_t device_id;
+
static int scan_dir(char *dirname, uint64_t *parent_dir_num)
{
DIR *dir;
if (!S_ISREG(m) && !S_ISDIR(m))
continue;
if (S_ISDIR(m)) {
+ if (conf.one_file_system_given && s.st_dev != device_id)
+ continue;
ret = scan_dir(entry->d_name, &this_dir_num);
if (ret < 0)
goto out;
static int com_create()
{
uint64_t zero = 0ULL;
- int ret = create_tables();
-
+ int ret;
+ struct stat statbuf;
+
+ if (lstat(conf.base_dir_arg, &statbuf) == -1)
+ return -ERRNO_TO_ERROR(errno);
+ if (!S_ISDIR(statbuf.st_mode))
+ return -ERRNO_TO_ERROR(ENOTDIR);
+ device_id = statbuf.st_dev;
+ ret = create_tables();
if (ret < 0)
return ret;
check_signals();
will be ignored when computing statistics.
"
+option "one-file-system" x
+#~~~~~~~~~~~~~~~~~~~~~~~~~
+"do not dive into other file systems"
+flag off
+dependon="create"
+details="
+ Skip directories that are on different filesystems from the
+ one that the argument being processed is on.
+"
##############################
section "Options for --select"