12 #include <linux/capability.h>
13 #include <linux/time.h>
17 #include <asm/uaccess.h>
21 #define MAX_32_NUM ((((unsigned long long) 1) << 32) - 1)
40 struct ext4_iloc iloc;
41 unsigned int oldflags,
mask,
i;
54 flags = ext4_mask_flags(inode->
i_mode, flags);
82 if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) {
88 if (!(flags & EXT4_EXTENTS_FL)) {
92 }
else if (flags & EXT4_EXTENTS_FL) {
95 flags &= ~EXT4_EXTENTS_FL;
100 if (!(oldflags & EXT4_EOFBLOCKS_FL)) {
104 }
else if (oldflags & EXT4_EOFBLOCKS_FL)
107 handle = ext4_journal_start(inode, 1);
108 if (IS_ERR(handle)) {
109 err = PTR_ERR(handle);
113 ext4_handle_sync(handle);
118 for (i = 0, mask = 1; i < 32; i++, mask <<= 1) {
122 ext4_set_inode_flag(inode, i);
124 ext4_clear_inode_flag(inode, i);
128 inode->
i_ctime = ext4_current_time(inode);
136 if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL))
153 struct ext4_iloc iloc;
162 ext4_warning(sb,
"Setting inode version is not "
163 "supported with metadata_csum enabled.");
176 handle = ext4_journal_start(inode, 1);
177 if (IS_ERR(handle)) {
178 err = PTR_ERR(handle);
183 inode->
i_ctime = ext4_current_time(inode);
205 goto group_extend_out;
211 "Online resizing not supported with bigalloc");
213 goto group_extend_out;
218 goto group_extend_out;
260 "Online defrag not supported with bigalloc");
298 "Online resizing not supported with bigalloc");
360 int err = 0, err2 = 0;
365 "Online resizing not (yet) supported with bigalloc");
405 if (!blk_queue_discard(q))
413 q->limits.discard_granularity);
431 long ext4_compat_ioctl(
struct file *
file,
unsigned int cmd,
unsigned long arg)
435 case EXT4_IOC32_GETFLAGS:
438 case EXT4_IOC32_SETFLAGS:
441 case EXT4_IOC32_GETVERSION:
444 case EXT4_IOC32_SETVERSION:
447 case EXT4_IOC32_GROUP_EXTEND:
450 case EXT4_IOC32_GETVERSION_OLD:
453 case EXT4_IOC32_SETVERSION_OLD:
456 case EXT4_IOC32_GETRSVSZ:
459 case EXT4_IOC32_SETRSVSZ:
462 case EXT4_IOC32_GROUP_ADD: {
463 struct compat_ext4_new_group_input
__user *uinput;
468 uinput = compat_ptr(arg);
475 &uinput->reserved_blocks);
481 (
unsigned long) &
input);
492 return ext4_ioctl(file, cmd, (
unsigned long) compat_ptr(arg));