MNTPOINT macro cleanup
cover MNTPOINT macro cleanup
Hi,
I understand that we don't need minor cleanups like this, thus feel free to ignore.
Kind regards,
Petr
Petr Vorel (5):
hugemmap: Move MNTPOINT definition to header
tree: Define MNTPOINT in include/tst_fs.h
tree: Reuse MNTPOINT definition
tree: Use MNTPOINT macro instead of string
doc/C-API: Update MNTPOINT related examples
doc/C-Test-API.asciidoc | 5 ++-- include/tst_fs.h | 3 ++- testcases/kernel/fs/fs_fill/fs_fill.c | 1 - .../kernel/io/direct_io/dma_thread_diotest.c | 9 +++---- .../hugetlb/hugefallocate/hugefallocate01.c | 1 - .../hugetlb/hugefallocate/hugefallocate02.c | 1 - .../kernel/mem/hugetlb/hugefork/hugefork01.c | 1 - .../kernel/mem/hugetlb/hugefork/hugefork02.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap07.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap08.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap09.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap10.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap11.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap12.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap13.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap14.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap15.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap16.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap17.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap18.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap19.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap20.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap21.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap22.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap23.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap24.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap25.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap26.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap27.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap28.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap29.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap30.c | 1 - .../kernel/mem/hugetlb/hugemmap/hugemmap31.c | 1 - testcases/kernel/syscalls/access/access04.c | 5 ++-- testcases/kernel/syscalls/chdir/chdir01.c | 1 - testcases/kernel/syscalls/chmod/chmod06.c | 5 ++-- testcases/kernel/syscalls/chown/chown04.c | 6 ++--- testcases/kernel/syscalls/creat/creat06.c | 4 +-- testcases/kernel/syscalls/creat/creat09.c | 1 - .../kernel/syscalls/fallocate/fallocate05.c | 1 - .../kernel/syscalls/fallocate/fallocate06.c | 1 - .../kernel/syscalls/fanotify/fanotify14.c | 1 - testcases/kernel/syscalls/fchmod/fchmod06.c | 5 ++-- testcases/kernel/syscalls/fchown/fchown04.c | 5 ++-- .../kernel/syscalls/fgetxattr/fgetxattr01.c | 1 - .../kernel/syscalls/fgetxattr/fgetxattr02.c | 1 - .../syscalls/fremovexattr/fremovexattr01.c | 1 - .../syscalls/fremovexattr/fremovexattr02.c | 1 - .../kernel/syscalls/fsconfig/fsconfig01.c | 1 - .../kernel/syscalls/fsconfig/fsconfig03.c | 1 - .../kernel/syscalls/fsetxattr/fsetxattr01.c | 1 - .../kernel/syscalls/fsetxattr/fsetxattr02.c | 1 - testcases/kernel/syscalls/fsmount/fsmount01.c | 1 - testcases/kernel/syscalls/fsmount/fsmount02.c | 1 - testcases/kernel/syscalls/fsopen/fsopen01.c | 1 - testcases/kernel/syscalls/fspick/fspick01.c | 1 - testcases/kernel/syscalls/fspick/fspick02.c | 1 - testcases/kernel/syscalls/fstatfs/fstatfs01.c | 5 ++-- testcases/kernel/syscalls/fsync/fsync01.c | 4 +-- .../kernel/syscalls/ftruncate/ftruncate04.c | 1 - .../kernel/syscalls/getxattr/getxattr02.c | 1 - .../kernel/syscalls/getxattr/getxattr03.c | 1 - .../kernel/syscalls/getxattr/getxattr04.c | 1 - testcases/kernel/syscalls/inotify/inotify03.c | 25 ++++++++----------- testcases/kernel/syscalls/ioctl/ioctl04.c | 10 ++++---- testcases/kernel/syscalls/link/link08.c | 3 +-- .../syscalls/lremovexattr/lremovexattr01.c | 1 - testcases/kernel/syscalls/mkdir/mkdir03.c | 3 +-- testcases/kernel/syscalls/mkdir/mkdir09.c | 1 - testcases/kernel/syscalls/mkdirat/mkdirat02.c | 3 +-- testcases/kernel/syscalls/mknod/mknod07.c | 7 +++--- testcases/kernel/syscalls/mknodat/mknodat02.c | 9 +++---- testcases/kernel/syscalls/mmap/mmap16.c | 1 - testcases/kernel/syscalls/mount/mount01.c | 1 - testcases/kernel/syscalls/mount/mount03.c | 1 - testcases/kernel/syscalls/mount/mount04.c | 1 - testcases/kernel/syscalls/mount/mount07.c | 1 - .../syscalls/mount_setattr/mount_setattr01.c | 1 - .../kernel/syscalls/move_mount/move_mount01.c | 1 - .../kernel/syscalls/move_mount/move_mount02.c | 1 - testcases/kernel/syscalls/open/open11.c | 1 - testcases/kernel/syscalls/open/open12.c | 1 - .../kernel/syscalls/open_tree/open_tree01.c | 1 - .../kernel/syscalls/open_tree/open_tree02.c | 1 - testcases/kernel/syscalls/openat/openat04.c | 1 - testcases/kernel/syscalls/prctl/prctl06.h | 1 - testcases/kernel/syscalls/preadv/preadv03.c | 1 - testcases/kernel/syscalls/preadv2/preadv203.c | 1 - testcases/kernel/syscalls/pwritev/pwritev03.c | 1 - .../kernel/syscalls/quotactl/quotactl01.c | 1 - .../kernel/syscalls/quotactl/quotactl06.c | 1 - .../kernel/syscalls/quotactl/quotactl08.c | 1 - .../syscalls/quotactl/quotactl_syscall_var.h | 1 - testcases/kernel/syscalls/rename/rename01.c | 5 ++-- testcases/kernel/syscalls/rename/rename03.c | 11 ++++---- testcases/kernel/syscalls/rename/rename04.c | 5 ++-- testcases/kernel/syscalls/rename/rename05.c | 5 ++-- testcases/kernel/syscalls/rename/rename06.c | 5 ++-- testcases/kernel/syscalls/rename/rename07.c | 5 ++-- testcases/kernel/syscalls/rename/rename08.c | 5 ++-- testcases/kernel/syscalls/rename/rename10.c | 5 ++-- testcases/kernel/syscalls/rename/rename11.c | 1 - testcases/kernel/syscalls/rename/rename12.c | 5 ++-- testcases/kernel/syscalls/rename/rename13.c | 7 +++--- .../kernel/syscalls/renameat/renameat01.c | 1 - testcases/kernel/syscalls/rmdir/rmdir02.c | 5 ++-- .../syscalls/set_mempolicy/set_mempolicy03.c | 1 - .../syscalls/set_mempolicy/set_mempolicy04.c | 1 - .../kernel/syscalls/setxattr/setxattr01.c | 1 - testcases/kernel/syscalls/statfs/statfs01.c | 5 ++-- testcases/kernel/syscalls/statvfs/statvfs01.c | 5 ++-- testcases/kernel/syscalls/statx/statx01.c | 3 +-- testcases/kernel/syscalls/statx/statx04.c | 5 ++-- testcases/kernel/syscalls/statx/statx05.c | 1 - testcases/kernel/syscalls/statx/statx06.c | 5 ++-- testcases/kernel/syscalls/statx/statx08.c | 7 +++--- testcases/kernel/syscalls/statx/statx09.c | 1 - testcases/kernel/syscalls/statx/statx10.c | 1 - testcases/kernel/syscalls/statx/statx12.c | 1 - testcases/kernel/syscalls/umount/umount01.c | 1 - testcases/kernel/syscalls/umount/umount02.c | 1 - testcases/kernel/syscalls/umount/umount03.c | 1 - .../kernel/syscalls/umount2/umount2_01.c | 1 - .../kernel/syscalls/umount2/umount2_02.c | 1 - testcases/kernel/syscalls/utime/utime01.c | 5 ++-- testcases/kernel/syscalls/utime/utime02.c | 5 ++-- testcases/kernel/syscalls/utime/utime03.c | 1 - testcases/kernel/syscalls/utime/utime04.c | 5 ++-- testcases/kernel/syscalls/utime/utime05.c | 7 +++--- testcases/kernel/syscalls/utime/utime06.c | 5 ++-- .../kernel/syscalls/utimensat/utimensat01.c | 1 - testcases/kernel/syscalls/utimes/utimes01.c | 3 +-- testcases/kernel/syscalls/writev/writev03.c | 1 - 133 files changed, 99 insertions(+), 232 deletions(-)
Signature · 5 lines
2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 1/5 hugemmap: Move MNTPOINT definition to header
Also, change it from "hugetlbfs/" to the usual "mntpoint".
--- testcases/kernel/mem/hugetlb/hugefallocate/hugefallocate01.c | 1 - testcases/kernel/mem/hugetlb/hugefallocate/hugefallocate02.c | 1 - testcases/kernel/mem/hugetlb/hugefork/hugefork01.c | 1 - testcases/kernel/mem/hugetlb/hugefork/hugefork02.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap07.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap08.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap09.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap11.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap12.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap13.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap14.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap16.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap17.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap18.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap19.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap20.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap21.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap22.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap23.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap24.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap25.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap26.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap27.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap28.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap29.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap30.c | 1 - testcases/kernel/mem/hugetlb/hugemmap/hugemmap31.c | 1 - testcases/kernel/mem/hugetlb/lib/hugetlb.h | 2 ++ 30 files changed, 2 insertions(+), 29 deletions(-)
testcases/kernel/mem/hugetlb/hugefallocate/hugefallocate01.c +0 -1
@@ -23,7 +23,6 @@#include "hugetlb.h" #include "lapi/fallocate.h" -#define MNTPOINT "hugetlbfs/"static int fd =-1 ;static long hpage_size;
testcases/kernel/mem/hugetlb/hugefallocate/hugefallocate02.c +0 -1
@@ -22,7 +22,6 @@#include "lapi/fallocate.h" #define MAX_PAGES_TO_USE 5 -#define MNTPOINT "hugetlbfs/"static int fd =-1 ;static long hpage_size;
testcases/kernel/mem/hugetlb/hugefork/hugefork01.c +0 -1
@@ -26,7 +26,6 @@#define C1 0x1234ABCD#define C2 ~0x1234ABCD#define C3 0xfeef5678 -#define MNTPOINT "hugetlbfs/"static int fd =-1 ;static long hpage_size;
testcases/kernel/mem/hugetlb/hugefork/hugefork02.c +0 -1
@@ -19,7 +19,6 @@ static int shmid = -1;#define NR_HUGEPAGES 5#define NUMPROCS MIN(50L, tst_ncpus_available()) -#define MNTPOINT "hugetlbfs/"static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap07.c +0 -1
@@ -23,7 +23,6 @@#include "hugetlb.h" #include "tst_safe_stdio.h" -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int huge_fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap08.c +0 -1
@@ -30,7 +30,6 @@#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"#define WITH_OVERCOMMIT 0#define WITHOUT_OVERCOMMIT 1
testcases/kernel/mem/hugetlb/hugemmap/hugemmap09.c +0 -1
@@ -22,7 +22,6 @@#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int huge_fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c +0 -1
@@ -24,7 +24,6 @@#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int private_resv;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap11.c +0 -1
@@ -24,7 +24,6 @@#define P0 "ffffffff"#define IOSZ 4096#define NORMAL_PATH "" -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int fd =-1 , nfd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap12.c +0 -1
@@ -24,7 +24,6 @@#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap13.c +0 -1
@@ -26,7 +26,6 @@#include "hugetlb.h" #define FOURGB (1ULL << 32) -#define MNTPOINT "hugetlbfs/"static int fd =-1 ;static unsigned long hpage_size;static int page_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap14.c +0 -1
@@ -25,7 +25,6 @@#include "hugetlb.h" #define FOURGB (1ULL << 32) -#define MNTPOINT "hugetlbfs/"static int fd =-1 ;static unsigned long long hpage_size;static int page_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c +0 -1
@@ -39,7 +39,6 @@/* Seems to be enough to trigger reliably */ #define NUM_REPETITIONS 64 -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap16.c +0 -1
@@ -24,7 +24,6 @@#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"static int fd =-1 ;static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap17.c +0 -1
@@ -31,7 +31,6 @@#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"#define MAP_LENGTH (4UL * hpage_size)#if defined(__s390__) && __WORDSIZE ==32 #define TRUNCATE_POINT 0x20000000UL
testcases/kernel/mem/hugetlb/hugemmap/hugemmap18.c +0 -1
@@ -30,7 +30,6 @@#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int fd =-1 ;static long page_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap19.c +0 -1
@@ -30,7 +30,6 @@#include "hugetlb.h" #define RANDOM_CONSTANT 0x1234ABCD -#define MNTPOINT "hugetlbfs/"static int page_size;static long hpage_size;static int fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap20.c +0 -1
@@ -13,7 +13,6 @@#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"#define FLAGS_DESC (x) .flags = x, .flags_str = #xstatic int fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap21.c +0 -1
@@ -17,7 +17,6 @@#define THREADS 5#define NR_HUGEPAGES 6 -#define MNTPOINT "hugetlbfs/"static int fd =-1 ;static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap22.c +0 -1
@@ -17,7 +17,6 @@#include "hugetlb.h" #define NR_HUGEPAGES 2 -#define MNTPOINT "hugetlbfs/"static unsigned long hpage_size;static int fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap23.c +0 -1
@@ -16,7 +16,6 @@#include <setjmp.h> #include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"#define RANDOM_CONSTANT 0x1234ABCD#define FLAGS_DESC (x) x, #x
testcases/kernel/mem/hugetlb/hugemmap/hugemmap24.c +0 -1
@@ -19,7 +19,6 @@#include "hugetlb.h" #define RANDOM_CONSTANT 0x1234ABCD -#define MNTPOINT "hugetlbfs/"static int fd =-1 ;static unsigned long slice_boundary;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap25.c +0 -1
@@ -18,7 +18,6 @@#define _GNU_SOURCE#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"static int fd =-1 ;static long hpage_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap26.c +0 -1
@@ -18,7 +18,6 @@#define _GNU_SOURCE#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"static int fd =-1 ;static long hpage_size, page_size;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap27.c +0 -1
@@ -16,7 +16,6 @@#include <setjmp.h> #include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int fd1 =-1 , fd2 =-1 ;static sigjmp_buf sig_escape;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap28.c +0 -1
@@ -14,7 +14,6 @@#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap29.c +0 -1
@@ -19,7 +19,6 @@#define C1 0x1234ABCD#define C2 0xFEDC9876 -#define MNTPOINT "hugetlbfs/"static unsigned long hpage_size;static int fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap30.c +0 -1
@@ -18,7 +18,6 @@#define _GNU_SOURCE#include "hugetlb.h" -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int fd =-1 ;
testcases/kernel/mem/hugetlb/hugemmap/hugemmap31.c +0 -1
@@ -15,7 +15,6 @@#include "hugetlb.h" #define RANDOM_CONSTANT 0x1234ABCD -#define MNTPOINT "hugetlbfs/"static long hpage_size;static int fd =-1 ;
testcases/kernel/mem/hugetlb/lib/hugetlb.h +2 -0
@@ -20,6 +20,8 @@#include "old_tmpdir.h" #include "mem.h" +#define MNTPOINT "mntpoint" +#define PALIGN (p, a) ((void *)LTP_ALIGN((unsigned long)(p), (a)))#define SHM_RD 0400
Signature · 5 lines
2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/5] hugemmap: Move MNTPOINT definition to header
Hi!
Quoted 1 line
Also, change it from "hugetlbfs/" to the usual "mntpoint".
Isn't that actually a regression? The name was more descriptive when it was hugetlbfs/...
I guess that it makes sense to move the MNTPOINT to the hugetlb.h but I would keep the actual directory name the same...
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/5] hugemmap: Move MNTPOINT definition to header
Hi Cyril,
first, thanks a lot for looking into this.
Quoted 5 lines
Hi!
Quoted 1 line
Also, change it from "hugetlbfs/" to the usual "mntpoint".
Isn't that actually a regression? The name was more descriptive when it was hugetlbfs/...
I agree with a readability point.
From following library code in lib/tst_test.c I expect we mount only once:
if (!!tst_test->needs_rofs + !!tst_test->needs_devfs +
!!tst_test->needs_device + !!tst_test->needs_hugetlbfs > 1) {
tst_brk(TBROK,
"Two or more of needs_{rofs, devfs, device, hugetlbfs} are set");
}Therefore it's really only readability point due .needs_hugetlbfs (but again, I agree with it, I guess you want to see the path in the test output and dmesg logs or when directory is not umounted due bug, right?)
Is there any other .mntpoint value which should be preserved as a different (I suppose no, but maybe I overlooked)?
BTW without this specific hugetlbfs case I would even suggest to use always MNTPOINT in whole source tree and remove tst_test->mntpoint (but that might be also step back - readability might suffer).
Quoted 2 lines
I guess that it makes sense to move the MNTPOINT to the
hugetlb.hbut I would keep the actual directory name the same...
E.g. in hugetlb.h:
#define MNTPOINT "hugetlbfs/"
nit: IMHO it can be just "hugetlbfs"? tst_creat_unlinked calls:
snprintf(template, PATH_MAX, "%s/ltp_%.3sXXXXXX", path, tid);
=> there is / after %s which is path parameter.
... and in tst_test.h:
#ifndef MNTPOINT
# define MNTPOINT "mntpoint" #endif
This should be safe, because hugetlb.h includes tst_test.h.
Quoted 1 line
I would have defined MNTPOINT in the
tst_test.hrather than intst_fs.h.
(from your other email)
But what about OVL_BASE_MNTPOINT in tst_fs.h? I guess all of these should be on the same place, right? (in 1st commit)
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 2/5 tree: Define MNTPOINT in include/tst_fs.h
In reply to Petr Voreland therefore remove it in all tests.
--- include/tst_fs.h | 3 ++- testcases/kernel/fs/fs_fill/fs_fill.c | 1 - testcases/kernel/mem/hugetlb/lib/hugetlb.h | 2 -- testcases/kernel/syscalls/chdir/chdir01.c | 1 - testcases/kernel/syscalls/creat/creat09.c | 1 - testcases/kernel/syscalls/fallocate/fallocate05.c | 1 - testcases/kernel/syscalls/fallocate/fallocate06.c | 1 - testcases/kernel/syscalls/fanotify/fanotify14.c | 1 - testcases/kernel/syscalls/fgetxattr/fgetxattr01.c | 1 - testcases/kernel/syscalls/fgetxattr/fgetxattr02.c | 1 - testcases/kernel/syscalls/fremovexattr/fremovexattr01.c | 1 - testcases/kernel/syscalls/fremovexattr/fremovexattr02.c | 1 - testcases/kernel/syscalls/fsconfig/fsconfig01.c | 1 - testcases/kernel/syscalls/fsconfig/fsconfig03.c | 1 - testcases/kernel/syscalls/fsetxattr/fsetxattr01.c | 1 - testcases/kernel/syscalls/fsetxattr/fsetxattr02.c | 1 - testcases/kernel/syscalls/fsmount/fsmount01.c | 1 - testcases/kernel/syscalls/fsmount/fsmount02.c | 1 - testcases/kernel/syscalls/fsopen/fsopen01.c | 1 - testcases/kernel/syscalls/fspick/fspick01.c | 1 - testcases/kernel/syscalls/fspick/fspick02.c | 1 - testcases/kernel/syscalls/ftruncate/ftruncate04.c | 1 - testcases/kernel/syscalls/getxattr/getxattr02.c | 1 - testcases/kernel/syscalls/getxattr/getxattr03.c | 1 - testcases/kernel/syscalls/getxattr/getxattr04.c | 1 - testcases/kernel/syscalls/lremovexattr/lremovexattr01.c | 1 - testcases/kernel/syscalls/mkdir/mkdir09.c | 1 - testcases/kernel/syscalls/mmap/mmap16.c | 1 - testcases/kernel/syscalls/mount/mount01.c | 1 - testcases/kernel/syscalls/mount/mount03.c | 1 - testcases/kernel/syscalls/mount/mount04.c | 1 - testcases/kernel/syscalls/mount/mount07.c | 1 - testcases/kernel/syscalls/mount_setattr/mount_setattr01.c | 1 - testcases/kernel/syscalls/move_mount/move_mount01.c | 1 - testcases/kernel/syscalls/move_mount/move_mount02.c | 1 - testcases/kernel/syscalls/open/open11.c | 1 - testcases/kernel/syscalls/open/open12.c | 1 - testcases/kernel/syscalls/open_tree/open_tree01.c | 1 - testcases/kernel/syscalls/open_tree/open_tree02.c | 1 - testcases/kernel/syscalls/openat/openat04.c | 1 - testcases/kernel/syscalls/prctl/prctl06.h | 1 - testcases/kernel/syscalls/preadv/preadv03.c | 1 - testcases/kernel/syscalls/preadv2/preadv203.c | 1 - testcases/kernel/syscalls/pwritev/pwritev03.c | 1 - testcases/kernel/syscalls/quotactl/quotactl01.c | 1 - testcases/kernel/syscalls/quotactl/quotactl06.c | 1 - testcases/kernel/syscalls/quotactl/quotactl08.c | 1 - testcases/kernel/syscalls/quotactl/quotactl_syscall_var.h | 1 - testcases/kernel/syscalls/rename/rename11.c | 1 - testcases/kernel/syscalls/renameat/renameat01.c | 1 - testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c | 1 - testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 1 - testcases/kernel/syscalls/setxattr/setxattr01.c | 1 - testcases/kernel/syscalls/statx/statx12.c | 1 - testcases/kernel/syscalls/umount/umount01.c | 1 - testcases/kernel/syscalls/umount/umount02.c | 1 - testcases/kernel/syscalls/umount/umount03.c | 1 - testcases/kernel/syscalls/umount2/umount2_01.c | 1 - testcases/kernel/syscalls/umount2/umount2_02.c | 1 - testcases/kernel/syscalls/utime/utime03.c | 1 - testcases/kernel/syscalls/utimensat/utimensat01.c | 1 - testcases/kernel/syscalls/writev/writev03.c | 1 - 62 files changed, 2 insertions(+), 63 deletions(-)
include/tst_fs.h +2 -1
@@ -49,7 +49,8 @@ enum { TST_GB = 1073741824, }; -#define OVL_BASE_MNTPOINT "mntpoint" +#define MNTPOINT "mntpoint" +#define OVL_BASE_MNTPOINT MNTPOINT#define OVL_LOWER OVL_BASE_MNTPOINT"/lower"#define OVL_UPPER OVL_BASE_MNTPOINT"/upper"#define OVL_WORK OVL_BASE_MNTPOINT"/work"
testcases/kernel/fs/fs_fill/fs_fill.c +0 -1
@@ -17,7 +17,6 @@#include "tst_safe_pthread.h" #include "tst_test.h" -#define MNTPOINT "mntpoint"#define THREADS_DIR MNTPOINT "/subdir"static volatile int run;
testcases/kernel/mem/hugetlb/lib/hugetlb.h +0 -2
@@ -20,8 +20,6 @@#include "old_tmpdir.h" #include "mem.h" -#define MNTPOINT "mntpoint" -#define PALIGN (p, a) ((void *)LTP_ALIGN((unsigned long)(p), (a)))#define SHM_RD 0400
testcases/kernel/syscalls/chdir/chdir01.c +0 -1
@@ -18,7 +18,6 @@#include "tst_test.h" -#define MNTPOINT "mntpoint"#define FILE_NAME "testfile"#define DIR_NAME "subdir"
testcases/kernel/syscalls/creat/creat09.c +0 -1
@@ -49,7 +49,6 @@#define MODE_RWX 0777#define MODE_SGID (S_ISGID|0777) -#define MNTPOINT "mntpoint"#define WORKDIR MNTPOINT "/testdir"#define CREAT_FILE WORKDIR "/creat.tmp"#define OPEN_FILE WORKDIR "/open.tmp"
testcases/kernel/syscalls/fallocate/fallocate05.c +0 -1
@@ -25,7 +25,6 @@#include "tst_test.h" #include "lapi/fallocate.h" -#define MNTPOINT "mntpoint"#define FALLOCATE_BLOCKS 256#define DEALLOCATE_BLOCKS 64#define TESTED_FLAGS "fallocate(FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE)"
testcases/kernel/syscalls/fallocate/fallocate06.c +0 -1
@@ -41,7 +41,6 @@#include "tst_test.h" #include "lapi/fallocate.h" -#define MNTPOINT "mntpoint"#define TEMPFILE MNTPOINT "/test_file"#define WRITE_BLOCKS 8#define FALLOCATE_BLOCKS 2
testcases/kernel/syscalls/fanotify/fanotify14.c +0 -1
@@ -31,7 +31,6 @@#ifdef HAVE_SYS_FANOTIFY_H #include "fanotify.h" -#define MNTPOINT "mntpoint"#define FILE1 MNTPOINT"/file1"/*
testcases/kernel/syscalls/fgetxattr/fgetxattr01.c +0 -1
@@ -39,7 +39,6 @@#define XATTR_TEST_VALUE "this is a test value"#define XATTR_TEST_VALUE_SIZE 20#define XATTR_TEST_INVALID_KEY "user.nosuchkey" -#define MNTPOINT "mntpoint"#define FNAME MNTPOINT"/fgetxattr01testfile"static int fd =-1 ;
testcases/kernel/syscalls/fgetxattr/fgetxattr02.c +0 -1
@@ -54,7 +54,6 @@#define XATTR_TEST_VALUE "this is a test value"#define XATTR_TEST_VALUE_SIZE 20 -#define MNTPOINT "mntpoint"#define OFFSET 11#define FILENAME "fgetxattr02testfile"#define DIRNAME "fgetxattr02testdir"
testcases/kernel/syscalls/fremovexattr/fremovexattr01.c +0 -1
@@ -32,7 +32,6 @@#define XATTR_TEST_VALUE "this is a test value"#define XATTR_TEST_VALUE_SIZE 20 -#define MNTPOINT "mntpoint"#define FNAME MNTPOINT"/fremovexattr01testfile"static int fd =-1 ;
testcases/kernel/syscalls/fremovexattr/fremovexattr02.c +0 -1
@@ -34,7 +34,6 @@#define XATTR_TEST_KEY "user.testkey" -#define MNTPOINT "mntpoint"#define FNAME MNTPOINT"/fremovexattr02testfile"static int fd =-1 ;
testcases/kernel/syscalls/fsconfig/fsconfig01.c +0 -1
@@ -8,7 +8,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint"static int fd;
testcases/kernel/syscalls/fsconfig/fsconfig03.c +0 -1
@@ -19,7 +19,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint"static int fd =-1 ;
testcases/kernel/syscalls/fsetxattr/fsetxattr01.c +0 -1
@@ -52,7 +52,6 @@#define XATTR_TEST_KEY "user.testkey"#define XATTR_TEST_VALUE "this is a test value"#define XATTR_TEST_VALUE_SIZE 20 -#define MNTPOINT "mntpoint"#define FNAME MNTPOINT"/fsetxattr01testfile"static int fd =-1 ;
testcases/kernel/syscalls/fsetxattr/fsetxattr02.c +0 -1
@@ -54,7 +54,6 @@#define XATTR_TEST_VALUE "this is a test value"#define XATTR_TEST_VALUE_SIZE 20 -#define MNTPOINT "mntpoint"#define OFFSET 11#define FILENAME "fsetxattr02testfile"#define DIRNAME "fsetxattr02testdir"
testcases/kernel/syscalls/fsmount/fsmount01.c +0 -1
@@ -9,7 +9,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint"#define TCASE_ENTRY (_flags, _attrs) {.name = "Flag " #_flags ", Attr " #_attrs, .flags = _flags, .attrs = _attrs}
testcases/kernel/syscalls/fsmount/fsmount02.c +0 -1
@@ -9,7 +9,6 @@int fd =-1 , invalid_fd =-1 ; -#define MNTPOINT "mntpoint" static struct tcase { char *name;
testcases/kernel/syscalls/fsopen/fsopen01.c +0 -1
@@ -8,7 +8,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint"#define TCASE_ENTRY (_flags) {.name = "Flag " #_flags, .flags = _flags}
testcases/kernel/syscalls/fspick/fspick01.c +0 -1
@@ -7,7 +7,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint"#define TCASE_ENTRY (_flags) {.name = "Flag " #_flags, .flags = _flags} static struct tcase {
testcases/kernel/syscalls/fspick/fspick02.c +0 -1
@@ -7,7 +7,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint" static struct tcase { char *name;
testcases/kernel/syscalls/ftruncate/ftruncate04.c +0 -1
@@ -35,7 +35,6 @@#include "tst_test.h" #define RECLEN 100 -#define MNTPOINT "mntpoint"#define TESTFILE MNTPOINT"/testfile"static int len =8 *1024 ;
testcases/kernel/syscalls/getxattr/getxattr02.c +0 -1
@@ -34,7 +34,6 @@#include "tst_test.h" #include "tst_test_macros.h" -#define MNTPOINT "mntpoint"#define FNAME MNTPOINT"/getxattr02"#define XATTR_TEST_KEY "user.testkey"
testcases/kernel/syscalls/getxattr/getxattr03.c +0 -1
@@ -17,7 +17,6 @@#include <sys/xattr.h> #include "tst_safe_macros.h" -#define MNTPOINT "mntpoint"#define FNAME MNTPOINT"/getxattr03testfile"#define XATTR_TEST_KEY "user.testkey"#define XATTR_TEST_VALUE "test value"
testcases/kernel/syscalls/getxattr/getxattr04.c +0 -1
@@ -34,7 +34,6 @@#ifdef HAVE_SYS_XATTR_H -#define MNTPOINT "mntpoint"#define TEST_FILE MNTPOINT "/file"#define TRUSTED_BIG "trusted.big"#define TRUSTED_SMALL "trusted.small"
testcases/kernel/syscalls/lremovexattr/lremovexattr01.c +0 -1
@@ -43,7 +43,6 @@#define XATTR_VALUE "file and link"#define XATTR_VALUE_SIZE 13 -#define MNTPOINT "mntpoint"#define FILENAME MNTPOINT"/lremovexattr01testfile"#define SYMLINK MNTPOINT"/lremovexattr01symlink"
testcases/kernel/syscalls/mkdir/mkdir09.c +0 -1
@@ -16,7 +16,6 @@#include "tst_test.h" #include "tst_safe_pthread.h" -#define MNTPOINT "mntpoint"#define MODE_RWX 07770#define DIR_NAME MNTPOINT "/X.%d"#define DIR_NAME_GROUP MNTPOINT "/X.%d.%d"
testcases/kernel/syscalls/mmap/mmap16.c +0 -1
@@ -34,7 +34,6 @@#include <sys/wait.h> #include "tst_test.h" -#define MNTPOINT "mntpoint"#define FILE_PARENT "mntpoint/testfilep"#define FILE_CHILD "mntpoint/testfilec"#define FS_BLOCKSIZE 1024
testcases/kernel/syscalls/mount/mount01.c +0 -1
@@ -34,7 +34,6 @@ char *TCID = "mount01";int TST_TOTAL =1 ;#define DIR_MODE (S_IRWXU | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP) -#define MNTPOINT "mntpoint"static const char *device;static const char *fs_type;
testcases/kernel/syscalls/mount/mount03.c +0 -1
@@ -31,7 +31,6 @@#include "tst_test.h" #include "lapi/mount.h" -#define MNTPOINT "mntpoint"#define TESTBIN "mount03_suid_child"#define BIN_PATH MNTPOINT "/" TESTBIN#define TEST_STR "abcdefghijklmnopqrstuvwxyz"
testcases/kernel/syscalls/mount/mount04.c +0 -1
@@ -16,7 +16,6 @@#include <pwd.h> #include <sys/mount.h> -#define MNTPOINT "mntpoint"static void cleanup (void ) {
testcases/kernel/syscalls/mount/mount07.c +0 -1
@@ -29,7 +29,6 @@# define ST_NOSYMFOLLOW 0x2000#endif -#define MNTPOINT "mntpoint"static char test_file[PATH_MAX ];static char link_file[PATH_MAX ];
testcases/kernel/syscalls/mount_setattr/mount_setattr01.c +0 -1
@@ -33,7 +33,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint"#define OT_MNTPOINT "ot_mntpoint"#define TCASE_ENTRY (attrs, exp_attrs) \ { \
testcases/kernel/syscalls/move_mount/move_mount01.c +0 -1
@@ -7,7 +7,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint"#define TCASE_ENTRY (_flags) {.name = "Flag " #_flags, .flags = _flags}
testcases/kernel/syscalls/move_mount/move_mount02.c +0 -1
@@ -7,7 +7,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint"int invalid_fd =-1 , fsmfd;
testcases/kernel/syscalls/open/open11.c +0 -1
@@ -54,7 +54,6 @@#include "tst_test.h" -#define MNTPOINT "mntpoint"#define T_REG "t_reg"/* regular file with content */ #define T_REG_EMPTY "t_reg_empty"/* empty regular file */ #define T_LINK_REG "t_link_reg"/* hard link to T_REG */
testcases/kernel/syscalls/open/open12.c +0 -1
@@ -32,7 +32,6 @@#include "lapi/fcntl.h" #include "lapi/mount.h" -#define MNTPOINT "mntpoint"#define TEST_FILE MNTPOINT"/test_file"#define LARGE_FILE "large_file"
testcases/kernel/syscalls/open_tree/open_tree01.c +0 -1
@@ -7,7 +7,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint"#define OT_MNTPOINT "ot_mntpoint"#define TCASE_ENTRY (_flags) {.name = "Flag " #_flags, .flags = _flags}
testcases/kernel/syscalls/open_tree/open_tree02.c +0 -1
@@ -7,7 +7,6 @@#include "tst_test.h" #include "lapi/fsmount.h" -#define MNTPOINT "mntpoint" static struct tcase { char *name;
testcases/kernel/syscalls/openat/openat04.c +0 -1
@@ -36,7 +36,6 @@#define MODE_RWX 0777#define MODE_SGID (S_ISGID|0777) -#define MNTPOINT "mntpoint"#define WORKDIR MNTPOINT "/testdir"#define OPEN_FILE "open.tmp"
testcases/kernel/syscalls/prctl/prctl06.h +0 -1
@@ -17,7 +17,6 @@#include "tst_test.h" #define PROC_STATUS "/proc/self/status" -#define MNTPOINT "mntpoint"#define TESTBIN "prctl06_execve"#define TEST_REL_BIN_DIR MNTPOINT"/"#define BIN_PATH MNTPOINT"/"TESTBIN
testcases/kernel/syscalls/preadv/preadv03.c +0 -1
@@ -24,7 +24,6 @@#include "tst_test.h" #include "preadv.h" -#define MNTPOINT "mntpoint"#define FNAME MNTPOINT"/file"static int fd;
testcases/kernel/syscalls/preadv2/preadv203.c +0 -1
@@ -49,7 +49,6 @@#define CHUNK_SZ 4123#define CHUNKS 60 -#define MNTPOINT "mntpoint"#define FILES 500static int fds[FILES ];
testcases/kernel/syscalls/pwritev/pwritev03.c +0 -1
@@ -25,7 +25,6 @@#include "pwritev.h" #include "tst_safe_prw.h" -#define MNTPOINT "mntpoint"#define FNAME MNTPOINT"/file"static char *initbuf, *preadbuf;
testcases/kernel/syscalls/quotactl/quotactl01.c +0 -1
@@ -39,7 +39,6 @@#define USRPATH MNTPOINT "/aquota.user"#define GRPPATH MNTPOINT "/aquota.group" -#define MNTPOINT "mntpoint"static int32_t fmt_id;static int test_id;
testcases/kernel/syscalls/quotactl/quotactl06.c +0 -1
@@ -45,7 +45,6 @@#define OPTION_INVALID 999#define USRPATH MNTPOINT "/aquota.user" -#define MNTPOINT "mntpoint"#define TESTDIR1 MNTPOINT "/testdir1"#define TESTDIR2 MNTPOINT "/testdir2"
testcases/kernel/syscalls/quotactl/quotactl08.c +0 -1
@@ -41,7 +41,6 @@#include "tst_test.h" #include "quotactl_syscall_var.h" -#define MNTPOINT "mntpoint"static int32_t fmt_id =QFMT_VFS_V1 ;static int test_id, mount_flag;
testcases/kernel/syscalls/quotactl/quotactl_syscall_var.h +0 -1
@@ -10,7 +10,6 @@#include "lapi/quotactl.h" #define QUOTACTL_SYSCALL_VARIANTS 2 -#define MNTPOINT "mntpoint"static int fd =-1 ;
testcases/kernel/syscalls/rename/rename11.c +0 -1
@@ -41,7 +41,6 @@char *TCID ="rename11" ; -#define MNTPOINT "mntpoint"#define TEST_EROFS "mntpoint/test_erofs"#define TEST_NEW_EROFS "mntpoint/new_test_erofs"
testcases/kernel/syscalls/renameat/renameat01.c +0 -1
@@ -51,7 +51,6 @@#include "safe_macros.h" #include "lapi/fcntl.h" -#define MNTPOINT "mntpoint"#define TESTDIR "testdir"#define NEW_TESTDIR "new_testdir"#define TESTDIR2 "/loopdir"
testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c +0 -1
@@ -17,7 +17,6 @@#include "tst_test.h" #include "tst_numa.h" -#define MNTPOINT "mntpoint"#define PAGES_ALLOCATED 16u#ifdef HAVE_NUMA_V2
testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c +0 -1
@@ -28,7 +28,6 @@#include "tst_test.h" #include "tst_numa.h" -#define MNTPOINT "mntpoint"#define FILES 10#ifdef HAVE_NUMA_V2
testcases/kernel/syscalls/setxattr/setxattr01.c +0 -1
@@ -51,7 +51,6 @@#define XATTR_TEST_KEY "user.testkey"#define XATTR_TEST_VALUE "this is a test value"#define XATTR_TEST_VALUE_SIZE 20 -#define MNTPOINT "mntpoint"#define FNAME MNTPOINT"/setxattr01testfile"static char long_key[XATTR_NAME_LEN ];
testcases/kernel/syscalls/statx/statx12.c +0 -1
@@ -23,7 +23,6 @@#include "tst_test.h" #include "lapi/stat.h" -#define MNTPOINT "mntpoint"#define TESTFILE MNTPOINT"/testfile"static int dir_fd =-1 , file_fd =-1 ;
testcases/kernel/syscalls/umount/umount01.c +0 -1
@@ -14,7 +14,6 @@#include <sys/mount.h> #include "tst_test.h" -#define MNTPOINT "mntpoint"static int mount_flag;
testcases/kernel/syscalls/umount/umount02.c +0 -1
@@ -23,7 +23,6 @@#include <sys/mount.h> #include "tst_test.h" -#define MNTPOINT "mntpoint"static char long_path[PATH_MAX +2 ];static int mount_flag;
testcases/kernel/syscalls/umount/umount03.c +0 -1
@@ -16,7 +16,6 @@#include <sys/mount.h> #include "tst_test.h" -#define MNTPOINT "mntpoint"static int mount_flag;
testcases/kernel/syscalls/umount2/umount2_01.c +0 -1
@@ -37,7 +37,6 @@ int TST_TOTAL = 1;#define DIR_MODE (S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)#define FILE_MODE (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID) -#define MNTPOINT "mntpoint"static int fd;static int mount_flag;
testcases/kernel/syscalls/umount2/umount2_02.c +0 -1
@@ -23,7 +23,6 @@#include "lapi/mount.h" #include "tst_test.h" -#define MNTPOINT "mntpoint"#define SYMLINK "symlink"#define FLAG_DESC (x, y) .flag = x, .exp_errno = 0, \
testcases/kernel/syscalls/utime/utime03.c +0 -1
@@ -26,7 +26,6 @@#include "tst_uid.h" #include "tst_clocks.h" -#define MNTPOINT "mntpoint"#define TEMP_FILE MNTPOINT"/tmp_file"#define FILE_MODE 0766
testcases/kernel/syscalls/utimensat/utimensat01.c +0 -1
@@ -21,7 +21,6 @@#include "time64_variants.h" #include "tst_timer.h" -#define MNTPOINT "mntpoint"#define TEST_FILE MNTPOINT"/test_file"#define TEST_DIR MNTPOINT"/test_dir"
testcases/kernel/syscalls/writev/writev03.c +0 -1
@@ -29,7 +29,6 @@#define CHUNK_SIZE 256#define BUF_SIZE (2 * CHUNK_SIZE) -#define MNTPOINT "mntpoint"#define TEMPFILE MNTPOINT "/test_file"#define MAPFILE MNTPOINT "/map_file"
Signature · 5 lines
2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 3/5 tree: Reuse MNTPOINT definition
In reply to Petr VorelReuse MNTPOINT definition instead of MNT_POINT and other custom definitions.
--- testcases/kernel/io/direct_io/dma_thread_diotest.c | 9 ++++----- testcases/kernel/syscalls/access/access04.c | 5 ++--- testcases/kernel/syscalls/chmod/chmod06.c | 5 ++--- testcases/kernel/syscalls/chown/chown04.c | 6 ++---- testcases/kernel/syscalls/fchmod/fchmod06.c | 5 ++--- testcases/kernel/syscalls/fchown/fchown04.c | 5 ++--- testcases/kernel/syscalls/fstatfs/fstatfs01.c | 5 ++--- testcases/kernel/syscalls/link/link08.c | 3 +-- testcases/kernel/syscalls/mkdir/mkdir03.c | 3 +-- testcases/kernel/syscalls/mkdirat/mkdirat02.c | 3 +-- testcases/kernel/syscalls/mknod/mknod07.c | 7 +++---- testcases/kernel/syscalls/mknodat/mknodat02.c | 9 ++++----- testcases/kernel/syscalls/rename/rename01.c | 5 ++--- testcases/kernel/syscalls/rename/rename03.c | 11 +++++------ testcases/kernel/syscalls/rename/rename04.c | 5 ++--- testcases/kernel/syscalls/rename/rename05.c | 5 ++--- testcases/kernel/syscalls/rename/rename06.c | 5 ++--- testcases/kernel/syscalls/rename/rename07.c | 5 ++--- testcases/kernel/syscalls/rename/rename08.c | 5 ++--- testcases/kernel/syscalls/rename/rename10.c | 5 ++--- testcases/kernel/syscalls/rename/rename12.c | 5 ++--- testcases/kernel/syscalls/rename/rename13.c | 7 +++---- testcases/kernel/syscalls/rmdir/rmdir02.c | 5 ++--- testcases/kernel/syscalls/statfs/statfs01.c | 5 ++--- testcases/kernel/syscalls/statvfs/statvfs01.c | 5 ++--- testcases/kernel/syscalls/statx/statx01.c | 3 +-- testcases/kernel/syscalls/statx/statx04.c | 5 ++--- testcases/kernel/syscalls/statx/statx05.c | 1 - testcases/kernel/syscalls/statx/statx06.c | 5 ++--- testcases/kernel/syscalls/statx/statx08.c | 7 +++---- testcases/kernel/syscalls/statx/statx09.c | 1 - testcases/kernel/syscalls/statx/statx10.c | 1 - testcases/kernel/syscalls/utime/utime01.c | 5 ++--- testcases/kernel/syscalls/utime/utime02.c | 5 ++--- testcases/kernel/syscalls/utime/utime04.c | 5 ++--- testcases/kernel/syscalls/utime/utime05.c | 7 +++---- testcases/kernel/syscalls/utime/utime06.c | 5 ++--- testcases/kernel/syscalls/utimes/utimes01.c | 3 +-- 38 files changed, 76 insertions(+), 115 deletions(-)
testcases/kernel/io/direct_io/dma_thread_diotest.c +4 -5
@@ -108,8 +108,7 @@#define FILESIZE (12*1024*1024)#define READSIZE (1024*1024) -#define MNT_POINT "mntpoint" -#define FILE_BASEPATH MNT_POINT "/_dma_thread_test_%.04d.tmp" +#define FILE_BASEPATH MNTPOINT "/_dma_thread_test_%.04d.tmp"#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \ S_IXGRP|S_IROTH|S_IXOTH)#define FILECOUNT 100
@@ -385,7 +384,7 @@ static void setup(void)SAFE_CLOSE (NULL , fd); } -SAFE_MKDIR (cleanup,MNT_POINT ,DIR_MODE ); +SAFE_MKDIR (cleanup,MNTPOINT ,DIR_MODE );/* * verify whether the current directory has enough free space,
@@ -401,7 +400,7 @@ static void setup(void)tst_mkfs (NULL , device,"ext3" ,NULL ,NULL ); } -SAFE_MOUNT (NULL , device,MNT_POINT ,"ext3" ,0 ,NULL ); +SAFE_MOUNT (NULL , device,MNTPOINT ,"ext3" ,0 ,NULL ); mount_flag =1 ; }
@@ -427,7 +426,7 @@ static void cleanup(void) {free (buffer); -if (mount_flag &&tst_umount (MNT_POINT ) <0 ) +if (mount_flag &&tst_umount (MNTPOINT ) <0 )tst_resm (TWARN |TERRNO ,"umount device:%s failed" , device);free (worker);
testcases/kernel/syscalls/access/access04.c +2 -3
@@ -39,7 +39,6 @@#define DNAME "accessfile2"#define SNAME1 "symlink1"#define SNAME2 "symlink2" -#define MNT_POINT "mntpoint"#define LONGPATHSIZE (PATH_MAX + 2)static uid_t uid;
@@ -108,7 +107,7 @@ static struct tst_test test = { .needs_root = 1, .forks_child = 1, .needs_rofs = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .setup = setup, .test = verify_access, .bufs = (struct tst_buffers []) {
@@ -117,7 +116,7 @@ static struct tst_test test = { {&sname1, .str = SNAME1}, {&empty_fname, .str = ""}, {&longpathname, .size = LONGPATHSIZE}, - {&mnt_point, .str = MNT_POINT}, + {&mnt_point, .str = MNTPOINT}, {} } };
testcases/kernel/syscalls/chmod/chmod06.c +2 -3
@@ -35,7 +35,6 @@#define TEST_FILE2 "testdir_1/tfile_2"#define TEST_FILE3 "t_file/tfile_3"#define TEST_FILE4 "test_file4" -#define MNT_POINT "mntpoint"#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \ S_IXGRP|S_IROTH|S_IXOTH)
@@ -61,7 +60,7 @@ static struct tcase { {long_path, FILE_MODE, ENAMETOOLONG, NULL, NULL}, {"", FILE_MODE, ENOENT, NULL, NULL}, {TEST_FILE3, FILE_MODE, ENOTDIR, NULL, NULL}, - {MNT_POINT, FILE_MODE, EROFS, NULL, NULL}, + {MNTPOINT, FILE_MODE, EROFS, NULL, NULL}, {TEST_FILE4, FILE_MODE, ELOOP, NULL, NULL}, };
@@ -144,5 +143,5 @@ static struct tst_test test = { .tcnt = ARRAY_SIZE(tc), .needs_root = 1, .needs_rofs = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, };
testcases/kernel/syscalls/chown/chown04.c +2 -4
@@ -41,13 +41,11 @@#define FILE_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) -#define MNT_POINT "mntpoint"#define DIR_TEMP "testdir_1"#define TEST_FILE1 "tfile_1"#define TEST_FILE2 "testdir_1/tfile_2"#define TEST_FILE3 "t_file/tfile_3"#define TEST_FILE4 "test_eloop1" -#define TEST_FILE5 "mntpoint"static char long_path[PATH_MAX +2 ] = {[0 ...PATH_MAX +1 ] ='a' };
@@ -63,7 +61,7 @@ static struct test_case_t { {"", ENOENT, "when file does not exist"}, {TEST_FILE3, ENOTDIR, "when the path prefix is not a directory"}, {TEST_FILE4, ELOOP, "with too many symbolic links"}, - {TEST_FILE5, EROFS, "when the named file resides on a read-only filesystem"} + {MNTPOINT, EROFS, "when the named file resides on a read-only filesystem"} };static void run (unsigned int i)
@@ -100,7 +98,7 @@ static void setup(void)static struct tst_test test = { .needs_root =1 , .needs_rofs =1 , - .mntpoint =MNT_POINT , + .mntpoint =MNTPOINT , .tcnt =ARRAY_SIZE (tc), .test = run, .setup = setup,
testcases/kernel/syscalls/fchmod/fchmod06.c +2 -3
@@ -16,7 +16,6 @@#include <pwd.h> #include "tst_test.h" -#define MNT_POINT "mntpoint"static int fd1;static int fd2;
@@ -58,7 +57,7 @@ static void setup(void) {struct passwd *ltpuser =SAFE_GETPWNAM ("nobody" ); - fd3 =SAFE_OPEN (MNT_POINT "/file" ,O_RDONLY ); + fd3 =SAFE_OPEN (MNTPOINT "/file" ,O_RDONLY ); fd1 =SAFE_OPEN ("tfile_1" ,O_RDWR |O_CREAT ,0666 ); fd2 =SAFE_OPEN ("tfile_2" ,O_RDWR |O_CREAT ,0666 );SAFE_CLOSE (fd2);
@@ -82,5 +81,5 @@ static struct tst_test test = { .tcnt = ARRAY_SIZE(tcases), .needs_root = 1, .needs_rofs = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, };
testcases/kernel/syscalls/fchown/fchown04.c +2 -3
@@ -25,7 +25,6 @@#include "compat_tst_16.h" #include "tst_safe_macros.h" -#define MNT_POINT "mntpoint"#define TEST_FILE "tfile_1"#define MODE 0666#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
@@ -48,7 +47,7 @@ static void setup(void)struct passwd *ltpuser; fd1 =SAFE_OPEN (TEST_FILE ,O_RDWR |O_CREAT ,MODE ); - fd3 =SAFE_OPEN (MNT_POINT ,O_RDONLY ); + fd3 =SAFE_OPEN (MNTPOINT ,O_RDONLY ); ltpuser =SAFE_GETPWNAM ("nobody" );SAFE_SETEUID (ltpuser->pw_uid);
@@ -78,7 +77,7 @@ static void cleanup(void)static struct tst_test test = { .needs_root =1 , .needs_rofs =1 , - .mntpoint =MNT_POINT , + .mntpoint =MNTPOINT , .tcnt =ARRAY_SIZE (tc), .test = run, .setup = setup,
testcases/kernel/syscalls/fstatfs/fstatfs01.c +2 -3
@@ -15,8 +15,7 @@#include <stdio.h> #include "tst_test.h" -#define MNT_POINT "mntpoint" -#define TEMP_FILE MNT_POINT"/test_file" +#define TEMP_FILE MNTPOINT"/test_file"static int file_fd;static int pipe_fd;
@@ -61,7 +60,7 @@ static struct tst_test test = { .tcnt = ARRAY_SIZE(tcases), .test = run, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1, .needs_root = 1 };
testcases/kernel/syscalls/link/link08.c +1 -2
@@ -26,7 +26,6 @@#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \ S_IXGRP|S_IROTH|S_IXOTH) -#define MNT_POINT "mntpoint"#define TEST_FILE "testfile"#define TEST_FILE1 "testfile1"#define TEST_FILE2 "mntpoint/file"
@@ -86,5 +85,5 @@ static struct tst_test test = { .tcnt = ARRAY_SIZE(tcases), .needs_root = 1, .needs_rofs = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, };
testcases/kernel/syscalls/mkdir/mkdir03.c +1 -2
@@ -24,7 +24,6 @@#define TST_ENOTDIR_DIR "tst_enotdir/tst"#define MODE 0777 -#define MNT_POINT "mntpoint"#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \ S_IXGRP|S_IROTH|S_IXOTH)#define TST_EROFS "mntpoint/tst_erofs"
@@ -89,7 +88,7 @@ static struct tst_test test = { .tcnt = ARRAY_SIZE(TC), .needs_root = 1, .needs_rofs = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .setup = setup, .test = verify_mkdir, };
testcases/kernel/syscalls/mkdirat/mkdirat02.c +1 -2
@@ -12,7 +12,6 @@#define _GNU_SOURCE#include "tst_test.h" -#define MNT_POINT "mntpoint"#define TEST_DIR "mntpoint/test_dir"#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \ S_IXGRP|S_IROTH|S_IXOTH)
@@ -77,5 +76,5 @@ static struct tst_test test = { .tcnt = ARRAY_SIZE(tcases), .needs_root = 1, .needs_rofs = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, };
testcases/kernel/syscalls/mknod/mknod07.c +3 -4
@@ -52,7 +52,6 @@#define DIR_TEMP_MODE (S_IRUSR | S_IXUSR)#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \ S_IXGRP|S_IROTH|S_IXOTH) -#define MNT_POINT "mntpoint"#define FIFO_MODE (S_IFIFO | S_IRUSR | S_IRGRP | S_IROTH)#define SOCKET_MODE (S_IFSOCK | S_IRWXU | S_IRWXG | S_IRWXO)
@@ -130,8 +129,8 @@ static void setup(void)TEST_PAUSE ;/* mount a read-only file system for EROFS test */ -SAFE_MKDIR (cleanup,MNT_POINT ,DIR_MODE ); -SAFE_MOUNT (cleanup, device,MNT_POINT , fs_type,MS_RDONLY ,NULL ); +SAFE_MKDIR (cleanup,MNTPOINT ,DIR_MODE ); +SAFE_MOUNT (cleanup, device,MNTPOINT , fs_type,MS_RDONLY ,NULL ); mount_flag =1 ; ltpuser =SAFE_GETPWNAM (cleanup,"nobody" );
@@ -174,7 +173,7 @@ static void cleanup(void)if (seteuid (0 ) ==-1 )tst_resm (TWARN |TERRNO ,"seteuid(0) failed" ); -if (mount_flag &&tst_umount (MNT_POINT ) <0 ) +if (mount_flag &&tst_umount (MNTPOINT ) <0 )tst_resm (TWARN |TERRNO ,"umount device:%s failed" , device);if (device)
testcases/kernel/syscalls/mknodat/mknodat02.c +4 -5
@@ -44,7 +44,6 @@ static void cleanup(void);#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \ S_IXGRP|S_IROTH|S_IXOTH) -#define MNT_POINT "mntpoint"#define FIFOMODE (S_IFIFO | S_IRUSR | S_IRGRP | S_IROTH)#define FREGMODE (S_IFREG | S_IRUSR | S_IRGRP | S_IROTH)
@@ -124,10 +123,10 @@ static void setup(void)/* * mount a read-only file system for EROFS test */ -SAFE_MKDIR (cleanup,MNT_POINT ,DIR_MODE ); -SAFE_MOUNT (cleanup, device,MNT_POINT , fs_type,MS_RDONLY ,NULL ); +SAFE_MKDIR (cleanup,MNTPOINT ,DIR_MODE ); +SAFE_MOUNT (cleanup, device,MNTPOINT , fs_type,MS_RDONLY ,NULL ); mount_flag =1 ; - dir_fd =SAFE_OPEN (cleanup,MNT_POINT ,O_DIRECTORY ); + dir_fd =SAFE_OPEN (cleanup,MNTPOINT ,O_DIRECTORY );/* * NOTE: the ELOOP test is written based on that the consecutive
@@ -168,7 +167,7 @@ static void cleanup(void) {if (dir_fd >0 &&close (dir_fd) <0 )tst_resm (TWARN |TERRNO ,"close(%d) failed" , dir_fd); -if (mount_flag &&tst_umount (MNT_POINT ) <0 ) +if (mount_flag &&tst_umount (MNTPOINT ) <0 )tst_resm (TWARN |TERRNO ,"umount device:%s failed" , device);if (device)
testcases/kernel/syscalls/rename/rename01.c +2 -3
@@ -14,7 +14,6 @@#include <stdio.h> #include "tst_test.h" -#define MNT_POINT "mntpoint"static const char *old_file_name ="oldfile" ;static const char *old_dir_name ="olddir" ;
@@ -32,7 +31,7 @@ static inline void swap(const char **a, const char **b)static void setup (void ) { -SAFE_CHDIR (MNT_POINT ); +SAFE_CHDIR (MNTPOINT );SAFE_TOUCH (old_file_name,0700 ,NULL );SAFE_MKDIR (old_dir_name,00770 );
@@ -78,6 +77,6 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1 };
testcases/kernel/syscalls/rename/rename03.c +5 -6
@@ -16,11 +16,10 @@#include <stdio.h> #include "tst_test.h" -#define MNT_POINT "mntpoint" -#define OLD_FILE_NAME MNT_POINT"/oldfile" -#define NEW_FILE_NAME MNT_POINT"/newfile" -#define OLD_DIR_NAME MNT_POINT"/olddir" -#define NEW_DIR_NAME MNT_POINT"/newdir" +#define OLD_FILE_NAME MNTPOINT"/oldfile" +#define NEW_FILE_NAME MNTPOINT"/newfile" +#define OLD_DIR_NAME MNTPOINT"/olddir" +#define NEW_DIR_NAME MNTPOINT"/newdir"static struct stat old_file_st, old_dir_st, new_file_st, new_dir_st;
@@ -68,6 +67,6 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1 };
testcases/kernel/syscalls/rename/rename04.c +2 -3
@@ -15,14 +15,13 @@#include <stdio.h> #include "tst_test.h" -#define MNT_POINT "mntpoint"#define DIR1 "dir1"#define DIR2 "dir2"#define TEMP_FILE DIR2"/tmpfile"static void setup (void ) { -SAFE_CHDIR (MNT_POINT ); +SAFE_CHDIR (MNTPOINT );SAFE_MKDIR (DIR1 ,00770 );SAFE_MKDIR (DIR2 ,00770 );SAFE_TOUCH (TEMP_FILE ,0700 ,NULL );
@@ -44,7 +43,7 @@ static struct tst_test test = { .setup = setup, .test_all = run, .needs_root = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .mount_device = 1, .all_filesystems = 1 };
testcases/kernel/syscalls/rename/rename05.c +2 -3
@@ -15,13 +15,12 @@#include <stdio.h> #include "tst_test.h" -#define MNT_POINT "mntpoint"#define TEMP_FILE "tmpfile"#define TEMP_DIR "tmpdir"static void setup (void ) { -SAFE_CHDIR (MNT_POINT ); +SAFE_CHDIR (MNTPOINT );SAFE_TOUCH (TEMP_FILE ,0700 ,NULL );SAFE_MKDIR (TEMP_DIR ,00770 ); }
@@ -37,6 +36,6 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1 };
testcases/kernel/syscalls/rename/rename06.c +2 -3
@@ -15,13 +15,12 @@#include <stdio.h> #include "tst_test.h" -#define MNT_POINT "mntpoint"#define DIR1 "dir1"#define DIR2 DIR1"/dir2"static void setup (void ) { -SAFE_CHDIR (MNT_POINT ); +SAFE_CHDIR (MNTPOINT );SAFE_MKDIR (DIR1 ,00770 );SAFE_MKDIR (DIR2 ,00770 ); }
@@ -37,6 +36,6 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1 };
testcases/kernel/syscalls/rename/rename07.c +2 -3
@@ -16,13 +16,12 @@#include <stdio.h> #include "tst_test.h" -#define MNT_POINT "mntpoint"#define TEMP_DIR "tmpdir"#define TEMP_FILE "tmpfile"static void setup (void ) { -SAFE_CHDIR (MNT_POINT ); +SAFE_CHDIR (MNTPOINT );SAFE_MKDIR (TEMP_DIR ,00770 );SAFE_TOUCH (TEMP_FILE ,0700 ,NULL ); }
@@ -38,6 +37,6 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1 };
testcases/kernel/syscalls/rename/rename08.c +2 -3
@@ -15,13 +15,12 @@#include <stdio.h> #include "tst_test.h" -#define MNT_POINT "mntpoint"#define TEMP_FILE "tmpfile"#define INVALID_PATH ((void *)-1)static void setup (void ) { -SAFE_CHDIR (MNT_POINT ); +SAFE_CHDIR (MNTPOINT );SAFE_TOUCH (TEMP_FILE ,0700 ,NULL ); }
@@ -38,6 +37,6 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1 };
testcases/kernel/syscalls/rename/rename10.c +2 -3
@@ -15,7 +15,6 @@#include <stdio.h> #include "tst_test.h" -#define MNT_POINT "mntpoint"#define TEMP_FILE "tmpfile"/* Path longer than PATH_MAX: fails the syscall right away (getname() fails) */
@@ -28,7 +27,7 @@ static char long_name[PATH_MAX] = {[0 ... PATH_MAX - 2] = 'a', [PATH_MAX - 1] =static void setup (void ) { -SAFE_CHDIR (MNT_POINT ); +SAFE_CHDIR (MNTPOINT );SAFE_TOUCH (TEMP_FILE ,0700 ,NULL ); }
@@ -45,6 +44,6 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1 };
testcases/kernel/syscalls/rename/rename12.c +2 -3
@@ -17,7 +17,6 @@#include <pwd.h> #include "tst_test.h" -#define MNT_POINT "mntpoint"#define TEMP_DIR "tempdir"#define TEMP_FILE1 TEMP_DIR"/tmpfile1"#define TEMP_FILE2 TEMP_DIR"/tmpfile2"
@@ -32,7 +31,7 @@ static void setup(void) pw =SAFE_GETPWNAM ("nobody" ); nobody_uid = pw->pw_uid; -SAFE_CHDIR (MNT_POINT ); +SAFE_CHDIR (MNTPOINT );SAFE_MKDIR (TEMP_DIR ,0777 );SAFE_STAT (TEMP_DIR , &buf1);SAFE_CHMOD (TEMP_DIR , buf1.st_mode |S_ISVTX );
@@ -56,7 +55,7 @@ static struct tst_test test = { .setup = setup, .test_all = run, .needs_root = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .mount_device = 1, .all_filesystems = 1, .skip_filesystems = (const char *const []){
testcases/kernel/syscalls/rename/rename13.c +3 -4
@@ -15,9 +15,8 @@#include <stdio.h> #include "tst_test.h" -#define MNT_POINT "mntpoint" -#define TEMP_FILE1 MNT_POINT"/tmpfile1" -#define TEMP_FILE2 MNT_POINT"/tmpfile2" +#define TEMP_FILE1 MNTPOINT"/tmpfile1" +#define TEMP_FILE2 MNTPOINT"/tmpfile2"static struct stat buf1, buf2;
@@ -43,7 +42,7 @@ static struct tst_test test = { .setup = setup, .test_all = run, .needs_root = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .mount_device = 1, .all_filesystems = 1, .skip_filesystems = (const char *const []){
testcases/kernel/syscalls/rmdir/rmdir02.c +2 -3
@@ -26,7 +26,6 @@#define TESTDIR2 "nosuchdir/testdir2"#define TESTDIR3 "testfile2/testdir3"#define TESTDIR4 "/loopdir" -#define MNT_POINT "mntpoint"#define TESTDIR5 "mntpoint/dir"#define TESTFILE "testdir/testfile"#define TESTFILE2 "testfile2"
@@ -45,7 +44,7 @@ static struct testcase { {NULL, EFAULT}, {looppathname, ELOOP}, {TESTDIR5, EROFS}, - {MNT_POINT, EBUSY}, + {MNTPOINT, EBUSY}, {".", EINVAL} };
@@ -104,5 +103,5 @@ static struct tst_test test = { .test = verify_rmdir, .needs_root = 1, .needs_rofs = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, };
testcases/kernel/syscalls/statfs/statfs01.c +2 -3
@@ -14,8 +14,7 @@#include "tst_test.h" -#define MNT_POINT "mntpoint" -#define TEMP_FILE MNT_POINT"/testfile" +#define TEMP_FILE MNTPOINT"/testfile"#define TEXT "dummy text"static void setup (void )
@@ -38,6 +37,6 @@ static struct tst_test test = { .test_all = run, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1 };
testcases/kernel/syscalls/statvfs/statvfs01.c +2 -3
@@ -16,8 +16,7 @@#include <sys/statvfs.h> #include "tst_test.h" -#define MNT_POINT "mntpoint" -#define TEST_PATH MNT_POINT"/testfile" +#define TEST_PATH MNTPOINT"/testfile"#define NLS_MAX_CHARSET_SIZE 6static void run (void )
@@ -58,6 +57,6 @@ static struct tst_test test = { .setup = setup, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1 };
testcases/kernel/syscalls/statx/statx01.c +1 -2
@@ -39,8 +39,7 @@#include <inttypes.h> #define TESTFILE "test_file" -#define MNTPOINT "mntpoint/" -#define DEVICEFILE MNTPOINT"blk_dev" +#define DEVICEFILE MNTPOINT"/blk_dev"#define MODE 0644#define SIZE 256
testcases/kernel/syscalls/statx/statx04.c +2 -3
@@ -58,8 +58,7 @@#include "lapi/stat.h" #include "lapi/fcntl.h" -#define MOUNT_POINT "mntpoint" -#define TESTDIR MOUNT_POINT "/testdir" +#define TESTDIR MNTPOINT "/testdir"#define ATTR (x) {.attr = x, .name = #x}
@@ -129,7 +128,7 @@ static struct tst_test test = { .needs_root = 1, .all_filesystems = 1, .mount_device = 1, - .mntpoint = MOUNT_POINT, + .mntpoint = MNTPOINT, .min_kver = "4.11", .skip_filesystems = (const char *const []) {"fuse" ,
testcases/kernel/syscalls/statx/statx05.c +0 -1
@@ -29,7 +29,6 @@#include "lapi/stat.h" #include "lapi/fcntl.h" -#define MNTPOINT "mnt_point"#define TESTDIR_FLAGGED MNTPOINT"/test_dir1"#define TESTDIR_UNFLAGGED MNTPOINT"/test_dir2"
testcases/kernel/syscalls/statx/statx06.c +2 -3
@@ -30,8 +30,7 @@#include "lapi/mount.h" #include "lapi/fcntl.h" -#define MOUNT_POINT "mount_ext" -#define TEST_FILE MOUNT_POINT"/test_file.txt" +#define TEST_FILE MNTPOINT"/test_file.txt"#define SIZE 2static int fd;
@@ -153,7 +152,7 @@ static struct tst_test test = { .test = test_statx, .min_kver = "4.11", .needs_root = 1, - .mntpoint = MOUNT_POINT, + .mntpoint = MNTPOINT, .mount_device = 1, .dev_fs_type = "ext4", .dev_fs_opts = (const char *const []){"-I", "256", NULL},
testcases/kernel/syscalls/statx/statx08.c +3 -4
@@ -28,9 +28,8 @@#include "lapi/stat.h" #include "lapi/fcntl.h" -#define MOUNT_POINT "mntpoint" -#define TESTDIR_FLAGGED MOUNT_POINT"/test_dir1" -#define TESTDIR_UNFLAGGED MOUNT_POINT"/test_dir2" +#define TESTDIR_FLAGGED MNTPOINT"/test_dir1" +#define TESTDIR_UNFLAGGED MNTPOINT"/test_dir2"static int fd, clear_flags;static int supp_compr =1 , supp_append =1 , supp_immutable =1 , supp_nodump =1 ;
@@ -176,6 +175,6 @@ static struct tst_test test = { .needs_root = 1, .all_filesystems = 1, .mount_device = 1, - .mntpoint = MOUNT_POINT, + .mntpoint = MNTPOINT, .min_kver = "4.11", };
testcases/kernel/syscalls/statx/statx09.c +0 -1
@@ -28,7 +28,6 @@#include "lapi/fcntl.h" #include <inttypes.h> -#define MNTPOINT "mnt_point"#define TESTFILE_FLAGGED MNTPOINT"/test_file1"#define TESTFILE_UNFLAGGED MNTPOINT"/test_file2"
testcases/kernel/syscalls/statx/statx10.c +0 -1
@@ -33,7 +33,6 @@#include "lapi/stat.h" #include "lapi/fcntl.h" -#define MNTPOINT "mnt_point"#define TESTFILE MNTPOINT"/testfile"static void verify_statx (void )
testcases/kernel/syscalls/utime/utime01.c +2 -3
@@ -18,8 +18,7 @@#include "tst_test.h" #include "tst_clocks.h" -#define MNT_POINT "mntpoint" -#define TEMP_FILE MNT_POINT"/tmp_file" +#define TEMP_FILE MNTPOINT"/tmp_file"#define FILE_MODE 0444static void setup (void )
@@ -64,7 +63,7 @@ static struct tst_test test = { .test_all = run, .setup = setup, .needs_root = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .mount_device = 1, .all_filesystems = 1, .skip_filesystems = (const char *const []) {
testcases/kernel/syscalls/utime/utime02.c +2 -3
@@ -23,8 +23,7 @@#include "tst_test.h" #include "tst_clocks.h" -#define MNT_POINT "mntpoint" -#define TEMP_FILE MNT_POINT"/tmp_file" +#define TEMP_FILE MNTPOINT"/tmp_file"#define FILE_MODE 0444#define TEST_USERNAME "nobody"
@@ -80,7 +79,7 @@ static struct tst_test test = { .test_all = run, .setup = setup, .needs_root = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .mount_device = 1, .all_filesystems = 1, .skip_filesystems = (const char *const []) {
testcases/kernel/syscalls/utime/utime04.c +2 -3
@@ -19,8 +19,7 @@#include <utime.h> #include "tst_test.h" -#define MNT_POINT "mntpoint" -#define TEMP_FILE MNT_POINT"/tmp_file" +#define TEMP_FILE MNTPOINT"/tmp_file"#define FILE_MODE 0444#define NEW_MODF_TIME 10000
@@ -55,7 +54,7 @@ static struct tst_test test = { .setup = setup, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1, .skip_filesystems = (const char *const []) {"vfat" ,
testcases/kernel/syscalls/utime/utime05.c +3 -4
@@ -22,8 +22,7 @@#include "tst_test.h" -#define MNT_POINT "mntpoint" -#define TEMP_FILE MNT_POINT"/tmp_file" +#define TEMP_FILE MNTPOINT"/tmp_file"#define FILE_MODE 0444#define MODE_RWX 0777
@@ -41,7 +40,7 @@ static void setup(void) {struct passwd *pw; -SAFE_CHMOD (MNT_POINT ,MODE_RWX ); +SAFE_CHMOD (MNTPOINT ,MODE_RWX ); pw =SAFE_GETPWNAM (TEST_USERNAME );tst_res (TINFO ,"Switching effective user ID to user: %s" , pw->pw_name);
@@ -69,7 +68,7 @@ static struct tst_test test = { .setup = setup, .needs_root = 1, .mount_device = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .all_filesystems = 1, .skip_filesystems = (const char *const []) {"vfat" ,
testcases/kernel/syscalls/utime/utime06.c +2 -3
@@ -24,7 +24,6 @@#include "tst_test.h" #define TEMP_FILE "tmp_file" -#define MNT_POINT "mntpoint"#define FILE_MODE 0644#define TEST_USERNAME "nobody"
@@ -39,7 +38,7 @@ static struct tcase { {TEMP_FILE, EACCES, NULL, "No write access"}, {"", ENOENT, NULL, "File not exist"}, {TEMP_FILE, EPERM, ×, "Not file owner"}, - {MNT_POINT, EROFS, NULL, "Read-only filesystem"} + {MNTPOINT, EROFS, NULL, "Read-only filesystem"} };
@@ -68,6 +67,6 @@ static struct tst_test test = { .tcnt = ARRAY_SIZE(tcases), .needs_root = 1, .needs_tmpdir = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, .needs_rofs = 1 };
testcases/kernel/syscalls/utimes/utimes01.c +1 -2
@@ -28,7 +28,6 @@#include "tst_test.h" #include "lapi/syscalls.h" -#define MNT_POINT "mntpoint"#define TESTFILE1 "testfile1"#define TESTFILE2 "testfile2"#define TESTFILE3 "mntpoint/file"
@@ -98,5 +97,5 @@ static struct tst_test test = { .tcnt = ARRAY_SIZE(tcases), .needs_root = 1, .needs_rofs = 1, - .mntpoint = MNT_POINT, + .mntpoint = MNTPOINT, };
Signature · 5 lines
2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 4/5 tree: Use MNTPOINT macro instead of string
In reply to Petr Vorel--- testcases/kernel/syscalls/creat/creat06.c | 4 +-- testcases/kernel/syscalls/fsync/fsync01.c | 4 +-- testcases/kernel/syscalls/inotify/inotify03.c | 25 ++++++++----------- testcases/kernel/syscalls/ioctl/ioctl04.c | 10 ++++---- 4 files changed, 19 insertions(+), 24 deletions(-)
testcases/kernel/syscalls/creat/creat06.c +2 -2
@@ -52,7 +52,7 @@#define NOT_DIR "file1/testdir"#define TEST6_FILE "dir6/file6"#define TEST7_FILE "file7" -#define TEST8_FILE "mntpoint/tmp" +#define TEST8_FILE MNTPOINT"/tmp"#define MODE1 0444#define MODE2 0666
@@ -153,6 +153,6 @@ static struct tst_test test = { .test = verify_creat, .needs_root = 1, .needs_rofs = 1, - .mntpoint = "mntpoint", + .mntpoint = MNTPOINT, .setup = setup, };
testcases/kernel/syscalls/fsync/fsync01.c +2 -2
@@ -33,7 +33,7 @@ static void verify_fsync(void)static void setup (void ) { -sprintf (fname,"mntpoint/tfile_%d" ,getpid ()); +sprintf (fname,"%s/tfile_%d" ,MNTPOINT ,getpid ()); fd =SAFE_OPEN (fname,O_RDWR |O_CREAT ,0700 ); }
@@ -49,6 +49,6 @@ static struct tst_test test = { .test_all = verify_fsync, .needs_root = 1, .mount_device = 1, - .mntpoint = "mntpoint", + .mntpoint = MNTPOINT, .all_filesystems = 1, };
testcases/kernel/syscalls/inotify/inotify03.c +10 -15
@@ -34,17 +34,13 @@#define EVENT_BUF_LEN (EVENT_MAX * (EVENT_SIZE + 16))#define BUF_SIZE 1024 +#define DIR_MODE (S_IRWXU | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP) +static char fname[BUF_SIZE ];static int fd, fd_notify;static int wd; -static unsigned int event_set[EVENT_MAX ]; -static char event_buf[EVENT_BUF_LEN ]; - -#define DIR_MODE (S_IRWXU | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP) - -static char *mntpoint ="mntpoint" ;static int mount_flag;void verify_inotify (void )
@@ -54,7 +50,7 @@ void verify_inotify(void)int test_cnt =0 ; -SAFE_MOUNT (tst_device->dev, mntpoint, tst_device->fs_type,0 ,NULL ); +SAFE_MOUNT (tst_device->dev,MNTPOINT , tst_device->fs_type,0 ,NULL ); mount_flag =1 ; wd =SAFE_MYINOTIFY_ADD_WATCH (fd_notify, fname,IN_ALL_EVENTS );
@@ -68,7 +64,7 @@ void verify_inotify(void) test_cnt++;tst_res (TINFO ,"umount %s" , tst_device->dev); -TEST (tst_umount (mntpoint)); +TEST (tst_umount (MNTPOINT ));if (TST_RET !=0 ) { tst_brk(TBROK, "umount(2) Failed " "while unmounting errno = %d : %s",
@@ -129,12 +125,12 @@ static void setup(void) {int ret; -SAFE_MKDIR (mntpoint,DIR_MODE ); +SAFE_MKDIR (MNTPOINT ,DIR_MODE ); -SAFE_MOUNT (tst_device->dev, mntpoint, tst_device->fs_type,0 ,NULL ); +SAFE_MOUNT (tst_device->dev,MNTPOINT , tst_device->fs_type,0 ,NULL ); mount_flag =1 ; -sprintf (fname,"%s/tfile_%d" , mntpoint,getpid ()); +sprintf (fname,"%s/tfile_%d" ,MNTPOINT ,getpid ()); fd =SAFE_OPEN (fname,O_RDWR |O_CREAT ,0700 ); ret =write (fd, fname,1 );
@@ -148,7 +144,7 @@ static void setup(void) fd_notify =SAFE_MYINOTIFY_INIT (); -tst_umount (mntpoint); +tst_umount (MNTPOINT ); mount_flag =0 ; }
@@ -158,10 +154,9 @@ static void cleanup(void)SAFE_CLOSE (fd_notify);if (mount_flag) { -TEST (tst_umount (mntpoint)); +TEST (tst_umount (MNTPOINT ));if (TST_RET !=0 ) -tst_res (TWARN |TTERRNO ,"umount(%s) failed" , - mntpoint); +tst_res (TWARN |TTERRNO ,"umount(%s) failed" ,MNTPOINT ); } }
testcases/kernel/syscalls/ioctl/ioctl04.c +5 -5
@@ -41,11 +41,11 @@ static void verify_ioctl(void)else tst_res (TPASS ,"BLKROGET returned %i" , ro); -TEST (mount (tst_device->dev,"mntpoint" , tst_device->fs_type,0 ,NULL )); +TEST (mount (tst_device->dev,MNTPOINT , tst_device->fs_type,0 ,NULL ));if (TST_RET !=-1 ) {tst_res (TFAIL ,"Mounting RO device RW succeeded" ); -tst_umount ("mntpoint" ); +tst_umount (MNTPOINT ); goto next; }
@@ -58,11 +58,11 @@ static void verify_ioctl(void) "Mounting RO device RW failed unexpectedly expected EACCES"); next: -TEST (mount (tst_device->dev,"mntpoint" , tst_device->fs_type,MS_RDONLY ,NULL )); +TEST (mount (tst_device->dev,MNTPOINT , tst_device->fs_type,MS_RDONLY ,NULL ));if (TST_RET ==0 ) {tst_res (TPASS ,"Mounting RO device RO works" ); -tst_umount ("mntpoint" ); +tst_umount (MNTPOINT ); }else {tst_res (TFAIL |TTERRNO ,"Mounting RO device RO failed" ); }
@@ -73,7 +73,7 @@ next:static void setup (void ) { -SAFE_MKDIR ("mntpoint" ,0777 ); +SAFE_MKDIR (MNTPOINT ,0777 ); fd =SAFE_OPEN (tst_device->dev,O_RDONLY ); }
Signature · 5 lines
2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 5/5 doc/C-API: Update MNTPOINT related examples
In reply to Petr VorelMNTPOINT is defined in library header, no need to define it in the test. Also actually use that definition instead of hardcoded value.
--- doc/C-Test-API.asciidoc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
doc/C-Test-API.asciidoc +2 -3
@@ -165,9 +165,8 @@ libc and other low level libraries. ------------------------------------------------------------------------------- static int fd0, fd1, mount_flag; -#define MNTPOINT "mntpoint" -#define FILE1 "mntpoint/file1" -#define FILE2 "mntpoint/file2" +#define FILE1 MNTPOINT"/file1" +#define FILE2 MNTPOINT"/file2" static void setup(void) {
Signature · 5 lines
2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Actually I do not have strong opinion on the patches 2-4. The 3 and 4 looks reasonable as that unifies us on MNTPOINT macro. The 2 can probably be okay as long as we do not touch hugetbl.h, though I would have defined MNTPOINT in the tst_test.h rather than in tst_fs.h.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp