Hi,

On 04/29/2014 09:06 PM, [email protected] wrote:
> Hi!
> +
> +     tst_sig(FORK, DEF_HANDLER, cleanup);
> +     tst_require_root(NULL);
> +
> +     device = getenv("LTP_BIG_DEV");
> +     if (device == NULL) {
> +             tst_brkm(TCONF, NULL,
> +                      "you must specify a big blockdevice(>1.2G)");
> What about we check free space in test temporary directory and proceed
> without mounting the device if there is enough space there?
>
> All that should be needed in the rest of the test is to set mount_flag
> only if we really mounted the device...
Got it and sorry for the delay.

Would you please review this patch set "[PATCH v3 1/2] lib/tst_fs_has_free.c: 
add
tst_fs_has_free() to determine filesystem's free space", I'd like to use the new
interface, thanks.

>
>> +    } else {
>> +            tst_mkfs(NULL, device, "ext3", NULL);
>> +    }
>> +
>> +    TEST_PAUSE;
>> +
>> +    tst_tmpdir();
>> +
>> +    SAFE_MKDIR(cleanup, MNT_POINT, DIR_MODE);
>> +
>> +    worker = SAFE_MALLOC(cleanup, workers * sizeof(worker_t));
>> +
>> +    for (j = 0; j < workers; j++)
>> +            worker[j].worker_number = j;
>> +
>> +    if (mount(device, MNT_POINT, "ext3", 0, NULL) < 0) {
>> +            tst_brkm(TBROK | TERRNO, cleanup,
>> +                     "mount device:%s failed", device);
>> +    }
>> +    mount_flag = 1;
>> +
>> +    for (n = 1; n <= FILECOUNT; n++) {
>> +            sprintf(filename, FILENAME, n);
>> +
>> +            if (tst_fill_file(filename, n, FILESIZE, 1)) {
>> +                    tst_brkm(TBROK, cleanup, "failed to create file: %s",
>> +                             filename);
>>              }
>>      }
>>  
>> -    return 0;
>> +    if (posix_memalign((void *)&buffer, PAGE_SIZE, READSIZE + align) != 0)
>> +            tst_brkm(TBROK, cleanup, "call posix_memalign failed");
> Is the void * cast to the buffer needed?
>
> Man page says that posix_memalign first parameter is void **, which
> should be correct just with &buffer, given that buffer is void *.
Here buffer is "static unsigned char *" type, so the correct case would be
"void **" :-) .

Regards,
Xiaoguang Wang
>
>
> The rest looks good.
>


------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to