diff options
author | Abhijith Das <adas@redhat.com> | 2007-08-15 12:25:05 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-10-10 03:55:27 -0400 |
commit | 2d9a4bbf6d28673f4057682cc02d16bf288b4a35 (patch) | |
tree | da4e598c88bc6df06e920951ad4d47deb350fc57 /include/linux/gfs2_ondisk.h | |
parent | 34eaae398e29dadeed95efd30f1eb694e5932b34 (diff) |
[GFS2] Fix quota do_list operation hang
This is the filesystem part of the patches to fix this bz. There are
additional userland patches (gfs2_quota, libgfs2) for the complete
solution. This patch adds a new field qu_ll_next to the gfs2_quota
structure. This field allows us to create linked lists of quotas in the
ondisk quota inode. Instead of scanning through the entire sparse quota
file for valid quotas, we can now simply walk through the user and group
quota linked lists to perform the do_list operation.
Signed-off-by: Abhijith Das <adas@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'include/linux/gfs2_ondisk.h')
-rw-r--r-- | include/linux/gfs2_ondisk.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index a44a6a078f0a..c3c19f926e6f 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h | |||
@@ -170,6 +170,33 @@ struct gfs2_rgrp { | |||
170 | }; | 170 | }; |
171 | 171 | ||
172 | /* | 172 | /* |
173 | * quota linked list: user quotas and group quotas form two separate | ||
174 | * singly linked lists. ll_next stores uids or gids of next quotas in the | ||
175 | * linked list. | ||
176 | |||
177 | Given the uid/gid, how to calculate the quota file offsets for the corresponding | ||
178 | gfs2_quota structures on disk: | ||
179 | |||
180 | for user quotas, given uid, | ||
181 | offset = uid * sizeof(struct gfs2_quota); | ||
182 | |||
183 | for group quotas, given gid, | ||
184 | offset = (gid * sizeof(struct gfs2_quota)) + sizeof(struct gfs2_quota); | ||
185 | |||
186 | |||
187 | uid:0 gid:0 uid:12 gid:12 uid:17 gid:17 uid:5142 gid:5142 | ||
188 | +-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+ | ||
189 | | valid | valid | :: | valid | valid | :: | valid | inval | :: | inval | valid | | ||
190 | +-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+ | ||
191 | next:12 next:12 next:17 next:5142 next:NULL next:NULL | ||
192 | | | | | |<-- user quota list | | ||
193 | \______|___________/ \______|___________/ group quota list -->| | ||
194 | | | | | ||
195 | \__________________/ \_______________________________________/ | ||
196 | |||
197 | */ | ||
198 | |||
199 | /* | ||
173 | * quota structure | 200 | * quota structure |
174 | */ | 201 | */ |
175 | 202 | ||
@@ -177,7 +204,8 @@ struct gfs2_quota { | |||
177 | __be64 qu_limit; | 204 | __be64 qu_limit; |
178 | __be64 qu_warn; | 205 | __be64 qu_warn; |
179 | __be64 qu_value; | 206 | __be64 qu_value; |
180 | __u8 qu_reserved[64]; | 207 | __be32 qu_ll_next; /* location of next quota in list */ |
208 | __u8 qu_reserved[60]; | ||
181 | }; | 209 | }; |
182 | 210 | ||
183 | /* | 211 | /* |