diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-02-26 01:04:07 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-02-26 01:04:07 -0500 |
commit | ccd2506bd43113659aa904d5bea5d1300605e2a6 (patch) | |
tree | 99a95645b3c2c092427b7c537c5628d502cd9c22 /fs/ext4/ioctl.c | |
parent | f63e6005bc63acc0a6bc3bdb8f971dcfbd827185 (diff) |
ext4: add EXT4_IOC_ALLOC_DA_BLKS ioctl
Add an ioctl which forces all of the delay allocated blocks to be
allocated. This also provides a function ext4_alloc_da_blocks() which
will be used by the following commits to force files to be fully
allocated to preserve application-expected ext3 behaviour.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r-- | fs/ext4/ioctl.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 22dd29f3ebc9..91e75f7a9e73 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
@@ -262,6 +262,20 @@ setversion_out: | |||
262 | return err; | 262 | return err; |
263 | } | 263 | } |
264 | 264 | ||
265 | case EXT4_IOC_ALLOC_DA_BLKS: | ||
266 | { | ||
267 | int err; | ||
268 | if (!is_owner_or_cap(inode)) | ||
269 | return -EACCES; | ||
270 | |||
271 | err = mnt_want_write(filp->f_path.mnt); | ||
272 | if (err) | ||
273 | return err; | ||
274 | err = ext4_alloc_da_blocks(inode); | ||
275 | mnt_drop_write(filp->f_path.mnt); | ||
276 | return err; | ||
277 | } | ||
278 | |||
265 | default: | 279 | default: |
266 | return -ENOTTY; | 280 | return -ENOTTY; |
267 | } | 281 | } |