Commit 36350462814739e1f38cba59a6900ebadb08d3bb
1 parent
287a80958c
Exists in
master
and in
7 other branches
udf: Remove dead quota code
Quota on UDF is non-functional at least since 2.6.16 (I'm too lazy to do more archeology) because it does not provide .quota_write and .quota_read functions and thus quotaon(8) just returns EINVAL. Since nobody complained for all those years and quota support is not even in UDF standard just nuke it. Signed-off-by: Jan Kara <jack@suse.cz>
Showing 7 changed files with 6 additions and 128 deletions Side-by-side Diff
fs/udf/balloc.c
... | ... | @@ -21,7 +21,6 @@ |
21 | 21 | |
22 | 22 | #include "udfdecl.h" |
23 | 23 | |
24 | -#include <linux/quotaops.h> | |
25 | 24 | #include <linux/buffer_head.h> |
26 | 25 | #include <linux/bitops.h> |
27 | 26 | |
... | ... | @@ -159,8 +158,6 @@ |
159 | 158 | udf_debug("byte=%2x\n", |
160 | 159 | ((char *)bh->b_data)[(bit + i) >> 3]); |
161 | 160 | } else { |
162 | - if (inode) | |
163 | - dquot_free_block(inode, 1); | |
164 | 161 | udf_add_free_space(sb, sbi->s_partition, 1); |
165 | 162 | } |
166 | 163 | } |
167 | 164 | |
... | ... | @@ -210,15 +207,8 @@ |
210 | 207 | bit = block % (sb->s_blocksize << 3); |
211 | 208 | |
212 | 209 | while (bit < (sb->s_blocksize << 3) && block_count > 0) { |
213 | - if (!udf_test_bit(bit, bh->b_data)) | |
210 | + if (!udf_clear_bit(bit, bh->b_data)) | |
214 | 211 | goto out; |
215 | - else if (dquot_prealloc_block(inode, 1)) | |
216 | - goto out; | |
217 | - else if (!udf_clear_bit(bit, bh->b_data)) { | |
218 | - udf_debug("bit already cleared for block %d\n", bit); | |
219 | - dquot_free_block(inode, 1); | |
220 | - goto out; | |
221 | - } | |
222 | 212 | block_count--; |
223 | 213 | alloc_count++; |
224 | 214 | bit++; |
... | ... | @@ -338,20 +328,6 @@ |
338 | 328 | } |
339 | 329 | |
340 | 330 | got_block: |
341 | - | |
342 | - /* | |
343 | - * Check quota for allocation of this block. | |
344 | - */ | |
345 | - if (inode) { | |
346 | - int ret = dquot_alloc_block(inode, 1); | |
347 | - | |
348 | - if (ret) { | |
349 | - mutex_unlock(&sbi->s_alloc_mutex); | |
350 | - *err = ret; | |
351 | - return 0; | |
352 | - } | |
353 | - } | |
354 | - | |
355 | 331 | newblock = bit + (block_group << (sb->s_blocksize_bits + 3)) - |
356 | 332 | (sizeof(struct spaceBitmapDesc) << 3); |
357 | 333 | |
... | ... | @@ -401,10 +377,6 @@ |
401 | 377 | } |
402 | 378 | |
403 | 379 | iinfo = UDF_I(table); |
404 | - /* We do this up front - There are some error conditions that | |
405 | - could occure, but.. oh well */ | |
406 | - if (inode) | |
407 | - dquot_free_block(inode, count); | |
408 | 380 | udf_add_free_space(sb, sbi->s_partition, count); |
409 | 381 | |
410 | 382 | start = bloc->logicalBlockNum + offset; |
... | ... | @@ -649,10 +621,7 @@ |
649 | 621 | epos.offset -= adsize; |
650 | 622 | |
651 | 623 | alloc_count = (elen >> sb->s_blocksize_bits); |
652 | - if (inode && dquot_prealloc_block(inode, | |
653 | - alloc_count > block_count ? block_count : alloc_count)) | |
654 | - alloc_count = 0; | |
655 | - else if (alloc_count > block_count) { | |
624 | + if (alloc_count > block_count) { | |
656 | 625 | alloc_count = block_count; |
657 | 626 | eloc.logicalBlockNum += alloc_count; |
658 | 627 | elen -= (alloc_count << sb->s_blocksize_bits); |
... | ... | @@ -752,14 +721,6 @@ |
752 | 721 | newblock = goal_eloc.logicalBlockNum; |
753 | 722 | goal_eloc.logicalBlockNum++; |
754 | 723 | goal_elen -= sb->s_blocksize; |
755 | - if (inode) { | |
756 | - *err = dquot_alloc_block(inode, 1); | |
757 | - if (*err) { | |
758 | - brelse(goal_epos.bh); | |
759 | - mutex_unlock(&sbi->s_alloc_mutex); | |
760 | - return 0; | |
761 | - } | |
762 | - } | |
763 | 724 | |
764 | 725 | if (goal_elen) |
765 | 726 | udf_write_aext(table, &goal_epos, &goal_eloc, goal_elen, 1); |
fs/udf/file.c
... | ... | @@ -34,7 +34,6 @@ |
34 | 34 | #include <linux/errno.h> |
35 | 35 | #include <linux/smp_lock.h> |
36 | 36 | #include <linux/pagemap.h> |
37 | -#include <linux/quotaops.h> | |
38 | 37 | #include <linux/buffer_head.h> |
39 | 38 | #include <linux/aio.h> |
40 | 39 | #include <linux/smp_lock.h> |
... | ... | @@ -219,7 +218,7 @@ |
219 | 218 | .read = do_sync_read, |
220 | 219 | .aio_read = generic_file_aio_read, |
221 | 220 | .unlocked_ioctl = udf_ioctl, |
222 | - .open = dquot_file_open, | |
221 | + .open = generic_file_open, | |
223 | 222 | .mmap = generic_file_mmap, |
224 | 223 | .write = do_sync_write, |
225 | 224 | .aio_write = udf_file_aio_write, |
226 | 225 | |
... | ... | @@ -229,30 +228,7 @@ |
229 | 228 | .llseek = generic_file_llseek, |
230 | 229 | }; |
231 | 230 | |
232 | -int udf_setattr(struct dentry *dentry, struct iattr *iattr) | |
233 | -{ | |
234 | - struct inode *inode = dentry->d_inode; | |
235 | - int error; | |
236 | - | |
237 | - error = inode_change_ok(inode, iattr); | |
238 | - if (error) | |
239 | - return error; | |
240 | - | |
241 | - if (is_quota_modification(inode, iattr)) | |
242 | - dquot_initialize(inode); | |
243 | - | |
244 | - if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) || | |
245 | - (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) { | |
246 | - error = dquot_transfer(inode, iattr); | |
247 | - if (error) | |
248 | - return error; | |
249 | - } | |
250 | - | |
251 | - return inode_setattr(inode, iattr); | |
252 | -} | |
253 | - | |
254 | 231 | const struct inode_operations udf_file_inode_operations = { |
255 | 232 | .truncate = udf_truncate, |
256 | - .setattr = udf_setattr, | |
257 | 233 | }; |
fs/udf/ialloc.c
... | ... | @@ -20,7 +20,6 @@ |
20 | 20 | |
21 | 21 | #include "udfdecl.h" |
22 | 22 | #include <linux/fs.h> |
23 | -#include <linux/quotaops.h> | |
24 | 23 | #include <linux/sched.h> |
25 | 24 | #include <linux/slab.h> |
26 | 25 | |
... | ... | @@ -32,13 +31,6 @@ |
32 | 31 | struct super_block *sb = inode->i_sb; |
33 | 32 | struct udf_sb_info *sbi = UDF_SB(sb); |
34 | 33 | |
35 | - /* | |
36 | - * Note: we must free any quota before locking the superblock, | |
37 | - * as writing the quota to disk may need the lock as well. | |
38 | - */ | |
39 | - dquot_free_inode(inode); | |
40 | - dquot_drop(inode); | |
41 | - | |
42 | 34 | clear_inode(inode); |
43 | 35 | |
44 | 36 | mutex_lock(&sbi->s_alloc_mutex); |
... | ... | @@ -61,7 +53,7 @@ |
61 | 53 | struct super_block *sb = dir->i_sb; |
62 | 54 | struct udf_sb_info *sbi = UDF_SB(sb); |
63 | 55 | struct inode *inode; |
64 | - int block, ret; | |
56 | + int block; | |
65 | 57 | uint32_t start = UDF_I(dir)->i_location.logicalBlockNum; |
66 | 58 | struct udf_inode_info *iinfo; |
67 | 59 | struct udf_inode_info *dinfo = UDF_I(dir); |
... | ... | @@ -145,17 +137,6 @@ |
145 | 137 | iinfo->i_crtime = current_fs_time(inode->i_sb); |
146 | 138 | insert_inode_hash(inode); |
147 | 139 | mark_inode_dirty(inode); |
148 | - | |
149 | - dquot_initialize(inode); | |
150 | - ret = dquot_alloc_inode(inode); | |
151 | - if (ret) { | |
152 | - dquot_drop(inode); | |
153 | - inode->i_flags |= S_NOQUOTA; | |
154 | - inode->i_nlink = 0; | |
155 | - iput(inode); | |
156 | - *err = ret; | |
157 | - return NULL; | |
158 | - } | |
159 | 140 | |
160 | 141 | *err = 0; |
161 | 142 | return inode; |
fs/udf/inode.c
... | ... | @@ -36,7 +36,6 @@ |
36 | 36 | #include <linux/pagemap.h> |
37 | 37 | #include <linux/buffer_head.h> |
38 | 38 | #include <linux/writeback.h> |
39 | -#include <linux/quotaops.h> | |
40 | 39 | #include <linux/slab.h> |
41 | 40 | #include <linux/crc-itu-t.h> |
42 | 41 | |
... | ... | @@ -71,9 +70,6 @@ |
71 | 70 | |
72 | 71 | void udf_delete_inode(struct inode *inode) |
73 | 72 | { |
74 | - if (!is_bad_inode(inode)) | |
75 | - dquot_initialize(inode); | |
76 | - | |
77 | 73 | truncate_inode_pages(&inode->i_data, 0); |
78 | 74 | |
79 | 75 | if (is_bad_inode(inode)) |
... | ... | @@ -113,7 +109,6 @@ |
113 | 109 | (unsigned long long)iinfo->i_lenExtents); |
114 | 110 | } |
115 | 111 | |
116 | - dquot_drop(inode); | |
117 | 112 | kfree(iinfo->i_ext.i_data); |
118 | 113 | iinfo->i_ext.i_data = NULL; |
119 | 114 | } |
fs/udf/namei.c
... | ... | @@ -27,7 +27,6 @@ |
27 | 27 | #include <linux/errno.h> |
28 | 28 | #include <linux/mm.h> |
29 | 29 | #include <linux/slab.h> |
30 | -#include <linux/quotaops.h> | |
31 | 30 | #include <linux/smp_lock.h> |
32 | 31 | #include <linux/buffer_head.h> |
33 | 32 | #include <linux/sched.h> |
... | ... | @@ -563,8 +562,6 @@ |
563 | 562 | int err; |
564 | 563 | struct udf_inode_info *iinfo; |
565 | 564 | |
566 | - dquot_initialize(dir); | |
567 | - | |
568 | 565 | lock_kernel(); |
569 | 566 | inode = udf_new_inode(dir, mode, &err); |
570 | 567 | if (!inode) { |
... | ... | @@ -617,8 +614,6 @@ |
617 | 614 | if (!old_valid_dev(rdev)) |
618 | 615 | return -EINVAL; |
619 | 616 | |
620 | - dquot_initialize(dir); | |
621 | - | |
622 | 617 | lock_kernel(); |
623 | 618 | err = -EIO; |
624 | 619 | inode = udf_new_inode(dir, mode, &err); |
... | ... | @@ -664,8 +659,6 @@ |
664 | 659 | struct udf_inode_info *dinfo = UDF_I(dir); |
665 | 660 | struct udf_inode_info *iinfo; |
666 | 661 | |
667 | - dquot_initialize(dir); | |
668 | - | |
669 | 662 | lock_kernel(); |
670 | 663 | err = -EMLINK; |
671 | 664 | if (dir->i_nlink >= (256 << sizeof(dir->i_nlink)) - 1) |
... | ... | @@ -800,8 +793,6 @@ |
800 | 793 | struct fileIdentDesc *fi, cfi; |
801 | 794 | struct kernel_lb_addr tloc; |
802 | 795 | |
803 | - dquot_initialize(dir); | |
804 | - | |
805 | 796 | retval = -ENOENT; |
806 | 797 | lock_kernel(); |
807 | 798 | fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi); |
... | ... | @@ -848,8 +839,6 @@ |
848 | 839 | struct fileIdentDesc cfi; |
849 | 840 | struct kernel_lb_addr tloc; |
850 | 841 | |
851 | - dquot_initialize(dir); | |
852 | - | |
853 | 842 | retval = -ENOENT; |
854 | 843 | lock_kernel(); |
855 | 844 | fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi); |
... | ... | @@ -904,8 +893,6 @@ |
904 | 893 | struct buffer_head *bh; |
905 | 894 | struct udf_inode_info *iinfo; |
906 | 895 | |
907 | - dquot_initialize(dir); | |
908 | - | |
909 | 896 | lock_kernel(); |
910 | 897 | inode = udf_new_inode(dir, S_IFLNK | S_IRWXUGO, &err); |
911 | 898 | if (!inode) |
... | ... | @@ -1075,8 +1062,6 @@ |
1075 | 1062 | int err; |
1076 | 1063 | struct buffer_head *bh; |
1077 | 1064 | |
1078 | - dquot_initialize(dir); | |
1079 | - | |
1080 | 1065 | lock_kernel(); |
1081 | 1066 | if (inode->i_nlink >= (256 << sizeof(inode->i_nlink)) - 1) { |
1082 | 1067 | unlock_kernel(); |
... | ... | @@ -1139,9 +1124,6 @@ |
1139 | 1124 | struct kernel_lb_addr tloc; |
1140 | 1125 | struct udf_inode_info *old_iinfo = UDF_I(old_inode); |
1141 | 1126 | |
1142 | - dquot_initialize(old_dir); | |
1143 | - dquot_initialize(new_dir); | |
1144 | - | |
1145 | 1127 | lock_kernel(); |
1146 | 1128 | ofi = udf_find_entry(old_dir, &old_dentry->d_name, &ofibh, &ocfi); |
1147 | 1129 | if (ofi) { |
... | ... | @@ -1387,7 +1369,6 @@ |
1387 | 1369 | const struct inode_operations udf_dir_inode_operations = { |
1388 | 1370 | .lookup = udf_lookup, |
1389 | 1371 | .create = udf_create, |
1390 | - .setattr = udf_setattr, | |
1391 | 1372 | .link = udf_link, |
1392 | 1373 | .unlink = udf_unlink, |
1393 | 1374 | .symlink = udf_symlink, |
... | ... | @@ -1400,6 +1381,5 @@ |
1400 | 1381 | .readlink = generic_readlink, |
1401 | 1382 | .follow_link = page_follow_link_light, |
1402 | 1383 | .put_link = page_put_link, |
1403 | - .setattr = udf_setattr, | |
1404 | 1384 | }; |
fs/udf/super.c
... | ... | @@ -54,7 +54,6 @@ |
54 | 54 | #include <linux/vmalloc.h> |
55 | 55 | #include <linux/errno.h> |
56 | 56 | #include <linux/mount.h> |
57 | -#include <linux/quotaops.h> | |
58 | 57 | #include <linux/seq_file.h> |
59 | 58 | #include <linux/bitmap.h> |
60 | 59 | #include <linux/crc-itu-t.h> |
61 | 60 | |
62 | 61 | |
... | ... | @@ -587,18 +586,11 @@ |
587 | 586 | if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) |
588 | 587 | goto out_unlock; |
589 | 588 | |
590 | - if (*flags & MS_RDONLY) { | |
589 | + if (*flags & MS_RDONLY) | |
591 | 590 | udf_close_lvid(sb); |
592 | - | |
593 | - error = dquot_suspend(sb, -1); | |
594 | - } else { | |
591 | + else | |
595 | 592 | udf_open_lvid(sb); |
596 | 593 | |
597 | - /* mark the fs r/w for quota activity */ | |
598 | - sb->s_flags &= ~MS_RDONLY; | |
599 | - dquot_resume(sb, -1); | |
600 | - } | |
601 | - | |
602 | 594 | out_unlock: |
603 | 595 | unlock_kernel(); |
604 | 596 | return error; |
... | ... | @@ -1948,10 +1940,6 @@ |
1948 | 1940 | /* Fill in the rest of the superblock */ |
1949 | 1941 | sb->s_op = &udf_sb_ops; |
1950 | 1942 | sb->s_export_op = &udf_export_ops; |
1951 | -#ifdef CONFIG_QUOTA | |
1952 | - sb->s_qcop = &dquot_quotactl_ops; | |
1953 | - sb->dq_op = NULL; /* &dquot_operations */ | |
1954 | -#endif | |
1955 | 1943 | |
1956 | 1944 | sb->s_dirt = 0; |
1957 | 1945 | sb->s_magic = UDF_SUPER_MAGIC; |
... | ... | @@ -2105,8 +2093,6 @@ |
2105 | 2093 | { |
2106 | 2094 | int i; |
2107 | 2095 | struct udf_sb_info *sbi; |
2108 | - | |
2109 | - dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); | |
2110 | 2096 | |
2111 | 2097 | sbi = UDF_SB(sb); |
2112 | 2098 |
fs/udf/udfdecl.h
... | ... | @@ -131,7 +131,6 @@ |
131 | 131 | |
132 | 132 | /* file.c */ |
133 | 133 | extern long udf_ioctl(struct file *, unsigned int, unsigned long); |
134 | -extern int udf_setattr(struct dentry *dentry, struct iattr *iattr); | |
135 | 134 | /* inode.c */ |
136 | 135 | extern struct inode *udf_iget(struct super_block *, struct kernel_lb_addr *); |
137 | 136 | extern int udf_sync_inode(struct inode *); |