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

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull quota updates from Jan Kara:
"Quota improvements and some minor cleanups.

The main portion in the pull request are changes which move i_dquot
array from struct inode into fs-private part of an inode which saves
memory for filesystems which don't use VFS quotas"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
udf: One function call less in udf_fill_super() after error detection
udf: Deletion of unnecessary checks before the function call "iput"
jbd: Deletion of an unnecessary check before the function call "iput"
vfs: Remove i_dquot field from inode
jfs: Convert to private i_dquot field
reiserfs: Convert to private i_dquot field
ocfs2: Convert to private i_dquot field
ext4: Convert to private i_dquot field
ext3: Convert to private i_dquot field
ext2: Convert to private i_dquot field
quota: Use function to provide i_dquot pointers
xfs: Set allowed quota types
gfs2: Set allowed quota types
quota: Allow each filesystem to specify which quota types it supports
quota: Remove const from function declarations
quota: Add log level to printk

+138 -47
+3
fs/ext2/ext2.h
··· 689 689 struct mutex truncate_mutex; 690 690 struct inode vfs_inode; 691 691 struct list_head i_orphan; /* unlinked but open inodes */ 692 + #ifdef CONFIG_QUOTA 693 + struct dquot *i_dquot[MAXQUOTAS]; 694 + #endif 692 695 }; 693 696 694 697 /*
+10
fs/ext2/super.c
··· 166 166 return NULL; 167 167 ei->i_block_alloc_info = NULL; 168 168 ei->vfs_inode.i_version = 1; 169 + #ifdef CONFIG_QUOTA 170 + memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); 171 + #endif 172 + 169 173 return &ei->vfs_inode; 170 174 } 171 175 ··· 307 303 #ifdef CONFIG_QUOTA 308 304 static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data, size_t len, loff_t off); 309 305 static ssize_t ext2_quota_write(struct super_block *sb, int type, const char *data, size_t len, loff_t off); 306 + static struct dquot **ext2_get_dquots(struct inode *inode) 307 + { 308 + return EXT2_I(inode)->i_dquot; 309 + } 310 310 #endif 311 311 312 312 static const struct super_operations ext2_sops = { ··· 328 320 #ifdef CONFIG_QUOTA 329 321 .quota_read = ext2_quota_read, 330 322 .quota_write = ext2_quota_write, 323 + .get_dquots = ext2_get_dquots, 331 324 #endif 332 325 }; 333 326 ··· 1099 1090 #ifdef CONFIG_QUOTA 1100 1091 sb->dq_op = &dquot_operations; 1101 1092 sb->s_qcop = &dquot_quotactl_ops; 1093 + sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; 1102 1094 #endif 1103 1095 1104 1096 root = ext2_iget(sb, EXT2_ROOT_INO);
+4
fs/ext3/ext3.h
··· 615 615 atomic_t i_sync_tid; 616 616 atomic_t i_datasync_tid; 617 617 618 + #ifdef CONFIG_QUOTA 619 + struct dquot *i_dquot[MAXQUOTAS]; 620 + #endif 621 + 618 622 struct inode vfs_inode; 619 623 }; 620 624
+10
fs/ext3/super.c
··· 485 485 ei->vfs_inode.i_version = 1; 486 486 atomic_set(&ei->i_datasync_tid, 0); 487 487 atomic_set(&ei->i_sync_tid, 0); 488 + #ifdef CONFIG_QUOTA 489 + memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); 490 + #endif 491 + 488 492 return &ei->vfs_inode; 489 493 } 490 494 ··· 768 764 size_t len, loff_t off); 769 765 static ssize_t ext3_quota_write(struct super_block *sb, int type, 770 766 const char *data, size_t len, loff_t off); 767 + static struct dquot **ext3_get_dquots(struct inode *inode) 768 + { 769 + return EXT3_I(inode)->i_dquot; 770 + } 771 771 772 772 static const struct dquot_operations ext3_quota_operations = { 773 773 .write_dquot = ext3_write_dquot, ··· 811 803 #ifdef CONFIG_QUOTA 812 804 .quota_read = ext3_quota_read, 813 805 .quota_write = ext3_quota_write, 806 + .get_dquots = ext3_get_dquots, 814 807 #endif 815 808 .bdev_try_to_free_page = bdev_try_to_free_page, 816 809 }; ··· 2010 2001 #ifdef CONFIG_QUOTA 2011 2002 sb->s_qcop = &ext3_qctl_operations; 2012 2003 sb->dq_op = &ext3_quota_operations; 2004 + sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; 2013 2005 #endif 2014 2006 memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid)); 2015 2007 INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
+4
fs/ext4/ext4.h
··· 941 941 tid_t i_sync_tid; 942 942 tid_t i_datasync_tid; 943 943 944 + #ifdef CONFIG_QUOTA 945 + struct dquot *i_dquot[MAXQUOTAS]; 946 + #endif 947 + 944 948 /* Precomputed uuid+inum+igen checksum for seeding inode checksums */ 945 949 __u32 i_csum_seed; 946 950 };
+8
fs/ext4/super.c
··· 892 892 spin_lock_init(&(ei->i_block_reservation_lock)); 893 893 #ifdef CONFIG_QUOTA 894 894 ei->i_reserved_quota = 0; 895 + memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); 895 896 #endif 896 897 ei->jinode = NULL; 897 898 INIT_LIST_HEAD(&ei->i_rsv_conversion_list); ··· 1069 1068 unsigned int flags); 1070 1069 static int ext4_enable_quotas(struct super_block *sb); 1071 1070 1071 + static struct dquot **ext4_get_dquots(struct inode *inode) 1072 + { 1073 + return EXT4_I(inode)->i_dquot; 1074 + } 1075 + 1072 1076 static const struct dquot_operations ext4_quota_operations = { 1073 1077 .get_reserved_space = ext4_get_reserved_space, 1074 1078 .write_dquot = ext4_write_dquot, ··· 1123 1117 #ifdef CONFIG_QUOTA 1124 1118 .quota_read = ext4_quota_read, 1125 1119 .quota_write = ext4_quota_write, 1120 + .get_dquots = ext4_get_dquots, 1126 1121 #endif 1127 1122 .bdev_try_to_free_page = bdev_try_to_free_page, 1128 1123 }; ··· 3939 3932 sb->s_qcop = &ext4_qctl_sysfile_operations; 3940 3933 else 3941 3934 sb->s_qcop = &ext4_qctl_operations; 3935 + sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; 3942 3936 #endif 3943 3937 memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid)); 3944 3938
+1
fs/gfs2/ops_fstype.c
··· 1074 1074 sb->s_export_op = &gfs2_export_ops; 1075 1075 sb->s_xattr = gfs2_xattr_handlers; 1076 1076 sb->s_qcop = &gfs2_quotactl_ops; 1077 + sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; 1077 1078 sb_dqopt(sb)->flags |= DQUOT_QUOTA_SYS_FILE; 1078 1079 sb->s_time_gran = 1; 1079 1080 sb->s_maxbytes = MAX_LFS_FILESIZE;
-3
fs/inode.c
··· 143 143 inode->i_blocks = 0; 144 144 inode->i_bytes = 0; 145 145 inode->i_generation = 0; 146 - #ifdef CONFIG_QUOTA 147 - memset(&inode->i_dquot, 0, sizeof(inode->i_dquot)); 148 - #endif 149 146 inode->i_pipe = NULL; 150 147 inode->i_bdev = NULL; 151 148 inode->i_cdev = NULL;
+1 -2
fs/jbd/journal.c
··· 1373 1373 } 1374 1374 mutex_unlock(&journal->j_checkpoint_mutex); 1375 1375 1376 - if (journal->j_inode) 1377 - iput(journal->j_inode); 1376 + iput(journal->j_inode); 1378 1377 if (journal->j_revoke) 1379 1378 journal_destroy_revoke(journal); 1380 1379 kfree(journal->j_wbuf);
+3
fs/jfs/jfs_incore.h
··· 94 94 unchar _inline_ea[128]; /* 128: inline extended attr */ 95 95 } link; 96 96 } u; 97 + #ifdef CONFIG_QUOTA 98 + struct dquot *i_dquot[MAXQUOTAS]; 99 + #endif 97 100 u32 dev; /* will die when we get wide dev_t */ 98 101 struct inode vfs_inode; 99 102 };
+9
fs/jfs/super.c
··· 117 117 jfs_inode = kmem_cache_alloc(jfs_inode_cachep, GFP_NOFS); 118 118 if (!jfs_inode) 119 119 return NULL; 120 + #ifdef CONFIG_QUOTA 121 + memset(&jfs_inode->i_dquot, 0, sizeof(jfs_inode->i_dquot)); 122 + #endif 120 123 return &jfs_inode->vfs_inode; 121 124 } 122 125 ··· 540 537 #ifdef CONFIG_QUOTA 541 538 sb->dq_op = &dquot_operations; 542 539 sb->s_qcop = &dquot_quotactl_ops; 540 + sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; 543 541 #endif 544 542 545 543 /* ··· 840 836 return len - towrite; 841 837 } 842 838 839 + static struct dquot **jfs_get_dquots(struct inode *inode) 840 + { 841 + return JFS_IP(inode)->i_dquot; 842 + } 843 843 #endif 844 844 845 845 static const struct super_operations jfs_super_operations = { ··· 862 854 #ifdef CONFIG_QUOTA 863 855 .quota_read = jfs_quota_read, 864 856 .quota_write = jfs_quota_write, 857 + .get_dquots = jfs_get_dquots, 865 858 #endif 866 859 }; 867 860
+2
fs/ocfs2/inode.h
··· 80 80 */ 81 81 tid_t i_sync_tid; 82 82 tid_t i_datasync_tid; 83 + 84 + struct dquot *i_dquot[MAXQUOTAS]; 83 85 }; 84 86 85 87 /*
+8
fs/ocfs2/super.c
··· 143 143 static int ocfs2_enable_quotas(struct ocfs2_super *osb); 144 144 static void ocfs2_disable_quotas(struct ocfs2_super *osb); 145 145 146 + static struct dquot **ocfs2_get_dquots(struct inode *inode) 147 + { 148 + return OCFS2_I(inode)->i_dquot; 149 + } 150 + 146 151 static const struct super_operations ocfs2_sops = { 147 152 .statfs = ocfs2_statfs, 148 153 .alloc_inode = ocfs2_alloc_inode, ··· 160 155 .show_options = ocfs2_show_options, 161 156 .quota_read = ocfs2_quota_read, 162 157 .quota_write = ocfs2_quota_write, 158 + .get_dquots = ocfs2_get_dquots, 163 159 }; 164 160 165 161 enum { ··· 569 563 570 564 oi->i_sync_tid = 0; 571 565 oi->i_datasync_tid = 0; 566 + memset(&oi->i_dquot, 0, sizeof(oi->i_dquot)); 572 567 573 568 jbd2_journal_init_jbd_inode(&oi->ip_jinode, &oi->vfs_inode); 574 569 return &oi->vfs_inode; ··· 2080 2073 sb->s_export_op = &ocfs2_export_ops; 2081 2074 sb->s_qcop = &ocfs2_quotactl_ops; 2082 2075 sb->dq_op = &ocfs2_quota_operations; 2076 + sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; 2083 2077 sb->s_xattr = ocfs2_xattr_handlers; 2084 2078 sb->s_time_gran = 1; 2085 2079 sb->s_flags |= MS_NOATIME;
+32 -27
fs/quota/dquot.c
··· 893 893 } 894 894 EXPORT_SYMBOL(dqget); 895 895 896 + static inline struct dquot **i_dquot(struct inode *inode) 897 + { 898 + return inode->i_sb->s_op->get_dquots(inode); 899 + } 900 + 896 901 static int dqinit_needed(struct inode *inode, int type) 897 902 { 898 903 int cnt; ··· 905 900 if (IS_NOQUOTA(inode)) 906 901 return 0; 907 902 if (type != -1) 908 - return !inode->i_dquot[type]; 903 + return !i_dquot(inode)[type]; 909 904 for (cnt = 0; cnt < MAXQUOTAS; cnt++) 910 - if (!inode->i_dquot[cnt]) 905 + if (!i_dquot(inode)[cnt]) 911 906 return 1; 912 907 return 0; 913 908 } ··· 970 965 static void remove_inode_dquot_ref(struct inode *inode, int type, 971 966 struct list_head *tofree_head) 972 967 { 973 - struct dquot *dquot = inode->i_dquot[type]; 968 + struct dquot *dquot = i_dquot(inode)[type]; 974 969 975 - inode->i_dquot[type] = NULL; 970 + i_dquot(inode)[type] = NULL; 976 971 if (!dquot) 977 972 return; 978 973 ··· 1407 1402 * we check it without locking here to avoid unnecessary 1408 1403 * dqget()/dqput() calls. 1409 1404 */ 1410 - if (inode->i_dquot[cnt]) 1405 + if (i_dquot(inode)[cnt]) 1411 1406 continue; 1412 1407 init_needed = 1; 1413 1408 ··· 1438 1433 /* We could race with quotaon or dqget() could have failed */ 1439 1434 if (!got[cnt]) 1440 1435 continue; 1441 - if (!inode->i_dquot[cnt]) { 1442 - inode->i_dquot[cnt] = got[cnt]; 1436 + if (!i_dquot(inode)[cnt]) { 1437 + i_dquot(inode)[cnt] = got[cnt]; 1443 1438 got[cnt] = NULL; 1444 1439 /* 1445 1440 * Make quota reservation system happy if someone ··· 1447 1442 */ 1448 1443 rsv = inode_get_rsv_space(inode); 1449 1444 if (unlikely(rsv)) 1450 - dquot_resv_space(inode->i_dquot[cnt], rsv); 1445 + dquot_resv_space(i_dquot(inode)[cnt], rsv); 1451 1446 } 1452 1447 } 1453 1448 out_err: ··· 1477 1472 1478 1473 spin_lock(&dq_data_lock); 1479 1474 for (cnt = 0; cnt < MAXQUOTAS; cnt++) { 1480 - put[cnt] = inode->i_dquot[cnt]; 1481 - inode->i_dquot[cnt] = NULL; 1475 + put[cnt] = i_dquot(inode)[cnt]; 1476 + i_dquot(inode)[cnt] = NULL; 1482 1477 } 1483 1478 spin_unlock(&dq_data_lock); 1484 1479 dqput_all(put); ··· 1499 1494 * add quota pointers back anyway. 1500 1495 */ 1501 1496 for (cnt = 0; cnt < MAXQUOTAS; cnt++) { 1502 - if (inode->i_dquot[cnt]) 1497 + if (i_dquot(inode)[cnt]) 1503 1498 break; 1504 1499 } 1505 1500 ··· 1600 1595 { 1601 1596 int cnt, ret = 0, index; 1602 1597 struct dquot_warn warn[MAXQUOTAS]; 1603 - struct dquot **dquots = inode->i_dquot; 1598 + struct dquot **dquots = i_dquot(inode); 1604 1599 int reserve = flags & DQUOT_SPACE_RESERVE; 1605 1600 1606 1601 if (!dquot_active(inode)) { ··· 1648 1643 /* 1649 1644 * This operation can block, but only after everything is updated 1650 1645 */ 1651 - int dquot_alloc_inode(const struct inode *inode) 1646 + int dquot_alloc_inode(struct inode *inode) 1652 1647 { 1653 1648 int cnt, ret = 0, index; 1654 1649 struct dquot_warn warn[MAXQUOTAS]; 1655 - struct dquot * const *dquots = inode->i_dquot; 1650 + struct dquot * const *dquots = i_dquot(inode); 1656 1651 1657 1652 if (!dquot_active(inode)) 1658 1653 return 0; ··· 1701 1696 spin_lock(&dq_data_lock); 1702 1697 /* Claim reserved quotas to allocated quotas */ 1703 1698 for (cnt = 0; cnt < MAXQUOTAS; cnt++) { 1704 - if (inode->i_dquot[cnt]) 1705 - dquot_claim_reserved_space(inode->i_dquot[cnt], 1699 + if (i_dquot(inode)[cnt]) 1700 + dquot_claim_reserved_space(i_dquot(inode)[cnt], 1706 1701 number); 1707 1702 } 1708 1703 /* Update inode bytes */ 1709 1704 inode_claim_rsv_space(inode, number); 1710 1705 spin_unlock(&dq_data_lock); 1711 - mark_all_dquot_dirty(inode->i_dquot); 1706 + mark_all_dquot_dirty(i_dquot(inode)); 1712 1707 srcu_read_unlock(&dquot_srcu, index); 1713 1708 return 0; 1714 1709 } ··· 1730 1725 spin_lock(&dq_data_lock); 1731 1726 /* Claim reserved quotas to allocated quotas */ 1732 1727 for (cnt = 0; cnt < MAXQUOTAS; cnt++) { 1733 - if (inode->i_dquot[cnt]) 1734 - dquot_reclaim_reserved_space(inode->i_dquot[cnt], 1728 + if (i_dquot(inode)[cnt]) 1729 + dquot_reclaim_reserved_space(i_dquot(inode)[cnt], 1735 1730 number); 1736 1731 } 1737 1732 /* Update inode bytes */ 1738 1733 inode_reclaim_rsv_space(inode, number); 1739 1734 spin_unlock(&dq_data_lock); 1740 - mark_all_dquot_dirty(inode->i_dquot); 1735 + mark_all_dquot_dirty(i_dquot(inode)); 1741 1736 srcu_read_unlock(&dquot_srcu, index); 1742 1737 return; 1743 1738 } ··· 1750 1745 { 1751 1746 unsigned int cnt; 1752 1747 struct dquot_warn warn[MAXQUOTAS]; 1753 - struct dquot **dquots = inode->i_dquot; 1748 + struct dquot **dquots = i_dquot(inode); 1754 1749 int reserve = flags & DQUOT_SPACE_RESERVE, index; 1755 1750 1756 1751 if (!dquot_active(inode)) { ··· 1789 1784 /* 1790 1785 * This operation can block, but only after everything is updated 1791 1786 */ 1792 - void dquot_free_inode(const struct inode *inode) 1787 + void dquot_free_inode(struct inode *inode) 1793 1788 { 1794 1789 unsigned int cnt; 1795 1790 struct dquot_warn warn[MAXQUOTAS]; 1796 - struct dquot * const *dquots = inode->i_dquot; 1791 + struct dquot * const *dquots = i_dquot(inode); 1797 1792 int index; 1798 1793 1799 1794 if (!dquot_active(inode)) ··· 1870 1865 if (!sb_has_quota_active(inode->i_sb, cnt)) 1871 1866 continue; 1872 1867 is_valid[cnt] = 1; 1873 - transfer_from[cnt] = inode->i_dquot[cnt]; 1868 + transfer_from[cnt] = i_dquot(inode)[cnt]; 1874 1869 ret = check_idq(transfer_to[cnt], 1, &warn_to[cnt]); 1875 1870 if (ret) 1876 1871 goto over_quota; ··· 1906 1901 dquot_incr_space(transfer_to[cnt], cur_space); 1907 1902 dquot_resv_space(transfer_to[cnt], rsv_space); 1908 1903 1909 - inode->i_dquot[cnt] = transfer_to[cnt]; 1904 + i_dquot(inode)[cnt] = transfer_to[cnt]; 1910 1905 } 1911 1906 spin_unlock(&dq_data_lock); 1912 1907 ··· 2748 2743 for (i = 0; i < nr_hash; i++) 2749 2744 INIT_HLIST_HEAD(dquot_hash + i); 2750 2745 2751 - printk("Dquot-cache hash table entries: %ld (order %ld, %ld bytes)\n", 2752 - nr_hash, order, (PAGE_SIZE << order)); 2746 + pr_info("VFS: Dquot-cache hash table entries: %ld (order %ld," 2747 + " %ld bytes)\n", nr_hash, order, (PAGE_SIZE << order)); 2753 2748 2754 2749 register_shrinker(&dqcache_shrinker); 2755 2750
+11 -2
fs/quota/quota.c
··· 47 47 48 48 static void quota_sync_one(struct super_block *sb, void *arg) 49 49 { 50 - if (sb->s_qcop && sb->s_qcop->quota_sync) 51 - sb->s_qcop->quota_sync(sb, *(int *)arg); 50 + int type = *(int *)arg; 51 + 52 + if (sb->s_qcop && sb->s_qcop->quota_sync && 53 + (sb->s_quota_types & (1 << type))) 54 + sb->s_qcop->quota_sync(sb, type); 52 55 } 53 56 54 57 static int quota_sync_all(int type) ··· 300 297 301 298 if (type >= (XQM_COMMAND(cmd) ? XQM_MAXQUOTAS : MAXQUOTAS)) 302 299 return -EINVAL; 300 + /* 301 + * Quota not supported on this fs? Check this before s_quota_types 302 + * since they needn't be set if quota is not supported at all. 303 + */ 303 304 if (!sb->s_qcop) 304 305 return -ENOSYS; 306 + if (!(sb->s_quota_types & (1 << type))) 307 + return -EINVAL; 305 308 306 309 ret = check_quotactl_permission(sb, type, cmd, id); 307 310 if (ret < 0)
+4
fs/reiserfs/reiserfs.h
··· 97 97 #ifdef CONFIG_REISERFS_FS_XATTR 98 98 struct rw_semaphore i_xattr_sem; 99 99 #endif 100 + #ifdef CONFIG_QUOTA 101 + struct dquot *i_dquot[MAXQUOTAS]; 102 + #endif 103 + 100 104 struct inode vfs_inode; 101 105 }; 102 106
+11
fs/reiserfs/super.c
··· 594 594 return NULL; 595 595 atomic_set(&ei->openers, 0); 596 596 mutex_init(&ei->tailpack); 597 + #ifdef CONFIG_QUOTA 598 + memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); 599 + #endif 600 + 597 601 return &ei->vfs_inode; 598 602 } 599 603 ··· 754 750 size_t, loff_t); 755 751 static ssize_t reiserfs_quota_read(struct super_block *, int, char *, size_t, 756 752 loff_t); 753 + 754 + static struct dquot **reiserfs_get_dquots(struct inode *inode) 755 + { 756 + return REISERFS_I(inode)->i_dquot; 757 + } 757 758 #endif 758 759 759 760 static const struct super_operations reiserfs_sops = { ··· 777 768 #ifdef CONFIG_QUOTA 778 769 .quota_read = reiserfs_quota_read, 779 770 .quota_write = reiserfs_quota_write, 771 + .get_dquots = reiserfs_get_dquots, 780 772 #endif 781 773 }; 782 774 ··· 1643 1633 #ifdef CONFIG_QUOTA 1644 1634 s->s_qcop = &reiserfs_qctl_operations; 1645 1635 s->dq_op = &reiserfs_quota_operations; 1636 + s->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; 1646 1637 #endif 1647 1638 1648 1639 /*
+5 -6
fs/udf/super.c
··· 2082 2082 mutex_init(&sbi->s_alloc_mutex); 2083 2083 2084 2084 if (!udf_parse_options((char *)options, &uopt, false)) 2085 - goto error_out; 2085 + goto parse_options_failure; 2086 2086 2087 2087 if (uopt.flags & (1 << UDF_FLAG_UTF8) && 2088 2088 uopt.flags & (1 << UDF_FLAG_NLS_MAP)) { 2089 2089 udf_err(sb, "utf8 cannot be combined with iocharset\n"); 2090 - goto error_out; 2090 + goto parse_options_failure; 2091 2091 } 2092 2092 #ifdef CONFIG_UDF_NLS 2093 2093 if ((uopt.flags & (1 << UDF_FLAG_NLS_MAP)) && !uopt.nls_map) { ··· 2237 2237 return 0; 2238 2238 2239 2239 error_out: 2240 - if (sbi->s_vat_inode) 2241 - iput(sbi->s_vat_inode); 2240 + iput(sbi->s_vat_inode); 2241 + parse_options_failure: 2242 2242 #ifdef CONFIG_UDF_NLS 2243 2243 if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP)) 2244 2244 unload_nls(sbi->s_nls_map); ··· 2291 2291 2292 2292 sbi = UDF_SB(sb); 2293 2293 2294 - if (sbi->s_vat_inode) 2295 - iput(sbi->s_vat_inode); 2294 + iput(sbi->s_vat_inode); 2296 2295 #ifdef CONFIG_UDF_NLS 2297 2296 if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP)) 2298 2297 unload_nls(sbi->s_nls_map);
+1
fs/xfs/xfs_super.c
··· 1425 1425 sb->s_export_op = &xfs_export_operations; 1426 1426 #ifdef CONFIG_XFS_QUOTA 1427 1427 sb->s_qcop = &xfs_quotactl_operations; 1428 + sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP | QTYPE_MASK_PRJ; 1428 1429 #endif 1429 1430 sb->s_op = &xfs_super_operations; 1430 1431
+2 -3
include/linux/fs.h
··· 606 606 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 607 607 struct file_lock *i_flock; 608 608 struct address_space i_data; 609 - #ifdef CONFIG_QUOTA 610 - struct dquot *i_dquot[MAXQUOTAS]; 611 - #endif 612 609 struct list_head i_devices; 613 610 union { 614 611 struct pipe_inode_info *i_pipe; ··· 1221 1224 struct backing_dev_info *s_bdi; 1222 1225 struct mtd_info *s_mtd; 1223 1226 struct hlist_node s_instances; 1227 + unsigned int s_quota_types; /* Bitmask of supported quota types */ 1224 1228 struct quota_info s_dquot; /* Diskquota specific options */ 1225 1229 1226 1230 struct sb_writers s_writers; ··· 1590 1592 #ifdef CONFIG_QUOTA 1591 1593 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 1592 1594 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1595 + struct dquot **(*get_dquots)(struct inode *); 1593 1596 #endif 1594 1597 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); 1595 1598 long (*nr_cached_objects)(struct super_block *, int);
+5
include/linux/quota.h
··· 56 56 PRJQUOTA = 2, /* element used for project quotas */ 57 57 }; 58 58 59 + /* Masks for quota types when used as a bitmask */ 60 + #define QTYPE_MASK_USR (1 << USRQUOTA) 61 + #define QTYPE_MASK_GRP (1 << GRPQUOTA) 62 + #define QTYPE_MASK_PRJ (1 << PRJQUOTA) 63 + 59 64 typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ 60 65 typedef long long qsize_t; /* Type in which we store sizes */ 61 66
+4 -4
include/linux/quotaops.h
··· 64 64 int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags); 65 65 void __dquot_free_space(struct inode *inode, qsize_t number, int flags); 66 66 67 - int dquot_alloc_inode(const struct inode *inode); 67 + int dquot_alloc_inode(struct inode *inode); 68 68 69 69 int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); 70 - void dquot_free_inode(const struct inode *inode); 70 + void dquot_free_inode(struct inode *inode); 71 71 void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number); 72 72 73 73 int dquot_disable(struct super_block *sb, int type, unsigned int flags); ··· 213 213 { 214 214 } 215 215 216 - static inline int dquot_alloc_inode(const struct inode *inode) 216 + static inline int dquot_alloc_inode(struct inode *inode) 217 217 { 218 218 return 0; 219 219 } 220 220 221 - static inline void dquot_free_inode(const struct inode *inode) 221 + static inline void dquot_free_inode(struct inode *inode) 222 222 { 223 223 } 224 224