linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][PROGS] xfs_io: Allow setting multiple mode flags for fallocate()
@ 2017-03-18  1:26 Calvin Owens
  2017-03-18  6:55 ` Dave Chinner
  0 siblings, 1 reply; 6+ messages in thread
From: Calvin Owens @ 2017-03-18  1:26 UTC (permalink / raw)
  To: linux-xfs; +Cc: kernel-team, calvinowens

This allows testing FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE.

Signed-off-by: Calvin Owens <calvinowens@fb.com>
---
 io/prealloc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/io/prealloc.c b/io/prealloc.c
index a9d66cc..2a4bcdc 100644
--- a/io/prealloc.c
+++ b/io/prealloc.c
@@ -201,19 +201,19 @@ fallocate_f(
 	while ((c = getopt(argc, argv, "cikpu")) != EOF) {
 		switch (c) {
 		case 'c':
-			mode = FALLOC_FL_COLLAPSE_RANGE;
+			mode |= FALLOC_FL_COLLAPSE_RANGE;
 			break;
 		case 'i':
-			mode = FALLOC_FL_INSERT_RANGE;
+			mode |= FALLOC_FL_INSERT_RANGE;
 			break;
 		case 'k':
-			mode = FALLOC_FL_KEEP_SIZE;
+			mode |= FALLOC_FL_KEEP_SIZE;
 			break;
 		case 'p':
-			mode = FALLOC_FL_PUNCH_HOLE;
+			mode |= FALLOC_FL_PUNCH_HOLE;
 			break;
 		case 'u':
-			mode = FALLOC_FL_UNSHARE_RANGE;
+			mode |= FALLOC_FL_UNSHARE_RANGE;
 			break;
 		default:
 			command_usage(&falloc_cmd);
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-04 19:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-18  1:26 [PATCH][PROGS] xfs_io: Allow setting multiple mode flags for fallocate() Calvin Owens
2017-03-18  6:55 ` Dave Chinner
2017-03-20  4:33   ` Calvin Owens
2017-03-21 21:54     ` Dave Chinner
2017-03-31  4:14       ` Calvin Owens
2017-04-04 19:26         ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).