Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: Add EXT4_IOC_TRIM ioctl to handle batched discard
fs: Do not dispatch FITRIM through separate super_operation
ext4: ext4_fill_super shouldn't return 0 on corruption
jbd2: fix /proc/fs/jbd2/<dev> when using an external journal
ext4: missing unlock in ext4_clear_request_list()
ext4: fix setting random pages PageUptodate

+37 -56
+24
fs/ext4/ioctl.c
··· 331 331 return err; 332 332 } 333 333 334 + case FITRIM: 335 + { 336 + struct super_block *sb = inode->i_sb; 337 + struct fstrim_range range; 338 + int ret = 0; 339 + 340 + if (!capable(CAP_SYS_ADMIN)) 341 + return -EPERM; 342 + 343 + if (copy_from_user(&range, (struct fstrim_range *)arg, 344 + sizeof(range))) 345 + return -EFAULT; 346 + 347 + ret = ext4_trim_fs(sb, &range); 348 + if (ret < 0) 349 + return ret; 350 + 351 + if (copy_to_user((struct fstrim_range *)arg, &range, 352 + sizeof(range))) 353 + return -EFAULT; 354 + 355 + return 0; 356 + } 357 + 334 358 default: 335 359 return -ENOTTY; 336 360 }
+2 -2
fs/ext4/page-io.c
··· 237 237 } while (bh != head); 238 238 } 239 239 240 - put_io_page(io_end->pages[i]); 241 - 242 240 /* 243 241 * If this is a partial write which happened to make 244 242 * all buffers uptodate then we can optimize away a ··· 246 248 */ 247 249 if (!partial_write) 248 250 SetPageUptodate(page); 251 + 252 + put_io_page(io_end->pages[i]); 249 253 } 250 254 io_end->num_io_pages = 0; 251 255 inode = io_end->inode;
+3 -6
fs/ext4/super.c
··· 1197 1197 .quota_write = ext4_quota_write, 1198 1198 #endif 1199 1199 .bdev_try_to_free_page = bdev_try_to_free_page, 1200 - .trim_fs = ext4_trim_fs 1201 1200 }; 1202 1201 1203 1202 static const struct super_operations ext4_nojournal_sops = { ··· 2798 2799 struct ext4_li_request *elr; 2799 2800 2800 2801 mutex_lock(&ext4_li_info->li_list_mtx); 2801 - if (list_empty(&ext4_li_info->li_request_list)) 2802 - return; 2803 - 2804 2802 list_for_each_safe(pos, n, &ext4_li_info->li_request_list) { 2805 2803 elr = list_entry(pos, struct ext4_li_request, 2806 2804 lr_request); ··· 3264 3268 * Test whether we have more sectors than will fit in sector_t, 3265 3269 * and whether the max offset is addressable by the page cache. 3266 3270 */ 3267 - ret = generic_check_addressable(sb->s_blocksize_bits, 3271 + err = generic_check_addressable(sb->s_blocksize_bits, 3268 3272 ext4_blocks_count(es)); 3269 - if (ret) { 3273 + if (err) { 3270 3274 ext4_msg(sb, KERN_ERR, "filesystem" 3271 3275 " too large to mount safely on this system"); 3272 3276 if (sizeof(sector_t) < 8) 3273 3277 ext4_msg(sb, KERN_WARNING, "CONFIG_LBDAF not enabled"); 3278 + ret = err; 3274 3279 goto failed_mount; 3275 3280 } 3276 3281
-39
fs/ioctl.c
··· 529 529 return thaw_super(sb); 530 530 } 531 531 532 - static int ioctl_fstrim(struct file *filp, void __user *argp) 533 - { 534 - struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; 535 - struct fstrim_range range; 536 - int ret = 0; 537 - 538 - if (!capable(CAP_SYS_ADMIN)) 539 - return -EPERM; 540 - 541 - /* If filesystem doesn't support trim feature, return. */ 542 - if (sb->s_op->trim_fs == NULL) 543 - return -EOPNOTSUPP; 544 - 545 - /* If a blockdevice-backed filesystem isn't specified, return EINVAL. */ 546 - if (sb->s_bdev == NULL) 547 - return -EINVAL; 548 - 549 - if (argp == NULL) { 550 - range.start = 0; 551 - range.len = ULLONG_MAX; 552 - range.minlen = 0; 553 - } else if (copy_from_user(&range, argp, sizeof(range))) 554 - return -EFAULT; 555 - 556 - ret = sb->s_op->trim_fs(sb, &range); 557 - if (ret < 0) 558 - return ret; 559 - 560 - if ((argp != NULL) && 561 - (copy_to_user(argp, &range, sizeof(range)))) 562 - return -EFAULT; 563 - 564 - return 0; 565 - } 566 - 567 532 /* 568 533 * When you add any new common ioctls to the switches above and below 569 534 * please update compat_sys_ioctl() too. ··· 577 612 578 613 case FITHAW: 579 614 error = ioctl_fsthaw(filp); 580 - break; 581 - 582 - case FITRIM: 583 - error = ioctl_fstrim(filp, argp); 584 615 break; 585 616 586 617 case FS_IOC_FIEMAP:
+8 -8
fs/jbd2/journal.c
··· 899 899 900 900 /* journal descriptor can store up to n blocks -bzzz */ 901 901 journal->j_blocksize = blocksize; 902 + journal->j_dev = bdev; 903 + journal->j_fs_dev = fs_dev; 904 + journal->j_blk_offset = start; 905 + journal->j_maxlen = len; 906 + bdevname(journal->j_dev, journal->j_devname); 907 + p = journal->j_devname; 908 + while ((p = strchr(p, '/'))) 909 + *p = '!'; 902 910 jbd2_stats_proc_init(journal); 903 911 n = journal->j_blocksize / sizeof(journal_block_tag_t); 904 912 journal->j_wbufsize = n; ··· 916 908 __func__); 917 909 goto out_err; 918 910 } 919 - journal->j_dev = bdev; 920 - journal->j_fs_dev = fs_dev; 921 - journal->j_blk_offset = start; 922 - journal->j_maxlen = len; 923 - bdevname(journal->j_dev, journal->j_devname); 924 - p = journal->j_devname; 925 - while ((p = strchr(p, '/'))) 926 - *p = '!'; 927 911 928 912 bh = __getblk(journal->j_dev, start, journal->j_blocksize); 929 913 if (!bh) {
-1
include/linux/fs.h
··· 1612 1612 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1613 1613 #endif 1614 1614 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); 1615 - int (*trim_fs) (struct super_block *, struct fstrim_range *); 1616 1615 }; 1617 1616 1618 1617 /*