From: Lukas Czerner <lczerner@redhat.com>
To: linux-fsdevel@vger.kernel.org
Cc: Lukas Czerner <lczerner@redhat.com>,
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Subject: [PATCH 5/7] fat: Implement fallocate query support mode
Date: Mon, 18 Sep 2017 17:52:25 +0200 [thread overview]
Message-ID: <1505749947-26360-6-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1505749947-26360-1-git-send-email-lczerner@redhat.com>
Return all fallcoate modes supported by fat file system.
Remove unnecessary check for regular file since it's already done in
vfs_fallocate()
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
fs/fat/fat.h | 7 +++++++
fs/fat/file.c | 7 +++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/fs/fat/fat.h b/fs/fat/fat.h
index 051dac1..2ff49ee0 100644
--- a/fs/fat/fat.h
+++ b/fs/fat/fat.h
@@ -57,6 +57,13 @@ struct fat_mount_options {
#define FAT_HASH_SIZE (1UL << FAT_HASH_BITS)
/*
+ * Supported fallocate modes
+ */
+#define FAT_FALLOC_SUPPORTED (FALLOC_FL_KEEP_SIZE | \
+ FALLOC_FL_QUERY_SUPPORT | \
+ FALLOC_FL_PREALLOC_RANGE)
+
+/*
* MS-DOS file system in-core superblock data
*/
struct msdos_sb_info {
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 4724cc9..119915e 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -239,12 +239,11 @@ static long fat_fallocate(struct file *file, int mode,
int err = 0;
/* No support for hole punch or other fallocate flags. */
- if (mode & ~FALLOC_FL_KEEP_SIZE)
+ if (mode & ~FAT_FALLOC_SUPPORTED)
return -EOPNOTSUPP;
- /* No support for dir */
- if (!S_ISREG(inode->i_mode))
- return -EOPNOTSUPP;
+ if (mode & FALLOC_FL_QUERY_SUPPORT)
+ return FAT_FALLOC_SUPPORTED;
inode_lock(inode);
if (mode & FALLOC_FL_KEEP_SIZE) {
--
2.7.5
next prev parent reply other threads:[~2017-09-18 15:53 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 15:52 [PATCH 0/7][RFC] Introduce fallocate query support mode Lukas Czerner
2017-09-18 15:52 ` [PATCH 1/7] vfs: " Lukas Czerner
2017-09-18 15:52 ` [PATCH 2/7] ext4: Implement " Lukas Czerner
2017-09-18 15:52 ` [PATCH 3/7] ext4: Remove unnecessary S_ISREG checks in fallocate operations Lukas Czerner
2017-09-18 15:52 ` [PATCH 4/7] xfs: Implement fallocate query support mode Lukas Czerner
2017-09-18 17:56 ` Christoph Hellwig
2017-09-19 3:28 ` OGAWA Hirofumi
2017-09-19 8:15 ` Lukas Czerner
2017-09-19 14:13 ` Christoph Hellwig
2017-09-18 20:48 ` Darrick J. Wong
2017-09-18 21:55 ` Andreas Dilger
2017-09-19 14:55 ` Theodore Ts'o
2017-09-19 15:33 ` Lukas Czerner
2017-09-19 15:55 ` Christoph Hellwig
2017-09-19 19:17 ` Florian Weimer
2017-09-19 20:37 ` Christoph Hellwig
2017-09-19 23:17 ` Theodore Ts'o
2017-09-21 13:17 ` pathconf syscall for linux Lukas Czerner
2017-09-21 13:49 ` Florian Weimer
2017-09-22 8:38 ` Lukas Czerner
2017-09-21 13:54 ` [PATCH 4/7] xfs: Implement fallocate query support mode Florian Weimer
2017-09-22 8:40 ` Lukas Czerner
2017-09-19 8:20 ` Lukas Czerner
2017-09-18 15:52 ` Lukas Czerner [this message]
2017-09-18 15:52 ` [PATCH 6/7] gfs2: " Lukas Czerner
2017-09-18 15:52 ` [PATCH 7/7] loop: Check for puch hole and zero range support specifically Lukas Czerner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1505749947-26360-6-git-send-email-lczerner@redhat.com \
--to=lczerner@redhat.com \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).