FreeBSD Bugzilla – Attachment 143502 Details for
Bug 190765
[patch] Added posix_fallocate support and tests to tools/regression/pjdfstest
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Added posix_fallocate support to pjdfstest
allocate_diff.txt (text/plain), 3.79 KB, created by
Kirk Russell
on 2014-06-07 23:36:47 UTC
(
hide
)
Description:
Added posix_fallocate support to pjdfstest
Filename:
MIME Type:
Creator:
Kirk Russell
Created:
2014-06-07 23:36:47 UTC
Size:
3.79 KB
patch
obsolete
>Index: regression/pjdfstest/pjdfstest.c >=================================================================== >--- regression/pjdfstest/pjdfstest.c (revision 266442) >+++ regression/pjdfstest/pjdfstest.c (working copy) >@@ -113,6 +113,7 @@ > #endif > ACTION_TRUNCATE, > ACTION_FTRUNCATE, >+ ACTION_POSIX_FALLOCATE, > ACTION_STAT, > ACTION_FSTAT, > ACTION_LSTAT, >@@ -194,6 +195,7 @@ > #endif > { "truncate", ACTION_TRUNCATE, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, > { "ftruncate", ACTION_FTRUNCATE, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NONE } }, >+ { "posix_fallocate", ACTION_POSIX_FALLOCATE, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } }, > { "stat", ACTION_STAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, > { "fstat", ACTION_FSTAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } }, > { "lstat", ACTION_LSTAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, >@@ -868,6 +870,9 @@ > case ACTION_FTRUNCATE: > rval = ftruncate64(NUM(0), NUM(1)); > break; >+ case ACTION_POSIX_FALLOCATE: >+ rval = posix_fallocate(NUM(0), NUM(1), NUM(2)); >+ break; > case ACTION_STAT: > rval = stat64(STR(0), &sb); > if (rval == 0) { >Index: regression/pjdfstest/tests/ftruncate/00.t >=================================================================== >--- regression/pjdfstest/tests/ftruncate/00.t (revision 266442) >+++ regression/pjdfstest/tests/ftruncate/00.t (working copy) >@@ -6,7 +6,7 @@ > dir=`dirname $0` > . ${dir}/../misc.sh > >-echo "1..21" >+echo "1..26" > > n0=`namegen` > n1=`namegen` >Index: regression/pjdfstest/tests/posix_fallocate/00.t >=================================================================== >--- regression/pjdfstest/tests/posix_fallocate/00.t (revision 266442) >+++ regression/pjdfstest/tests/posix_fallocate/00.t (working copy) >@@ -1,12 +1,12 @@ > #!/bin/sh > # $FreeBSD$ > >-desc="ftruncate descrease/increase file size" >+desc="posix_fallocate increase file size" > > dir=`dirname $0` > . ${dir}/../misc.sh > >-echo "1..21" >+echo "1..26" > > n0=`namegen` > n1=`namegen` >@@ -16,42 +16,42 @@ > cd ${n1} > > expect 0 create ${n0} 0644 >-expect 0 open ${n0} O_RDWR : ftruncate 0 1234567 >+expect 0 open ${n0} O_RDWR : posix_fallocate 0 0 567 >+expect 567 lstat ${n0} size >+expect 0 open ${n0} O_WRONLY : posix_fallocate 0 0 1234567 > expect 1234567 lstat ${n0} size >-expect 0 open ${n0} O_WRONLY : ftruncate 0 567 >-expect 567 lstat ${n0} size > expect 0 unlink ${n0} > > dd if=/dev/random of=${n0} bs=12345 count=1 >/dev/null 2>&1 >-expect 0 open ${n0} O_RDWR : ftruncate 0 23456 >+expect 0 open ${n0} O_RDWR : posix_fallocate 0 20000 3456 > expect 23456 lstat ${n0} size >-expect 0 open ${n0} O_WRONLY : ftruncate 0 1 >-expect 1 lstat ${n0} size >+expect 0 open ${n0} O_WRONLY : posix_fallocate 0 0 23456 >+expect 23456 lstat ${n0} size > expect 0 unlink ${n0} > >-# successful ftruncate(2) updates ctime. >+# successful posix_fallocate(2) updates ctime. > expect 0 create ${n0} 0644 > ctime1=`${fstest} stat ${n0} ctime` > sleep 1 >-expect 0 open ${n0} O_RDWR : ftruncate 0 123 >+expect 0 open ${n0} O_RDWR : posix_fallocate 0 0 123 > ctime2=`${fstest} stat ${n0} ctime` > test_check $ctime1 -lt $ctime2 > expect 0 unlink ${n0} > >-# unsuccessful ftruncate(2) does not update ctime. >+# unsuccessful posix_fallocate(2) does not update ctime. > expect 0 create ${n0} 0644 > ctime1=`${fstest} stat ${n0} ctime` > sleep 1 >-expect EINVAL -u 65534 open ${n0} O_RDONLY : ftruncate 0 123 >+expect EINVAL open ${n0} O_WRONLY : posix_fallocate 0 0 0 > ctime2=`${fstest} stat ${n0} ctime` > test_check $ctime1 -eq $ctime2 > expect 0 unlink ${n0} > > # third argument should not affect permission. >-expect 0 open ${n0} O_CREAT,O_RDWR 0 : ftruncate 0 0 >+expect 0 open ${n0} O_CREAT,O_RDWR 0 : posix_fallocate 0 0 1 > expect 0 unlink ${n0} > expect 0 chmod . 0777 >-expect 0 -u 65534 open ${n0} O_CREAT,O_RDWR 0 : ftruncate 0 0 >+expect 0 -u 65534 open ${n0} O_CREAT,O_RDWR 0 : posix_fallocate 0 0 1 > expect 0 unlink ${n0} > > cd ${cdir}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 190765
: 143502