aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/super.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2008-08-20 09:43:36 -0400
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:40:23 -0500
commit1a224ad11eeb190da4a123e156601aad1bb67f24 (patch)
tree093f4e8449c0fed95af2d73904f67c65a93241ff /fs/ocfs2/super.c
parent90e86a63eadf1a3b2f19b68d82150dc63fe01443 (diff)
ocfs2: Assign feature bits and system inodes to quota feature and quota files
Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r--fs/ocfs2/super.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 9e7accc68b4b..41bb0197cf4c 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -225,6 +225,19 @@ static int ocfs2_sync_fs(struct super_block *sb, int wait)
225 return 0; 225 return 0;
226} 226}
227 227
228static int ocfs2_need_system_inode(struct ocfs2_super *osb, int ino)
229{
230 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_USRQUOTA)
231 && (ino == USER_QUOTA_SYSTEM_INODE
232 || ino == LOCAL_USER_QUOTA_SYSTEM_INODE))
233 return 0;
234 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)
235 && (ino == GROUP_QUOTA_SYSTEM_INODE
236 || ino == LOCAL_GROUP_QUOTA_SYSTEM_INODE))
237 return 0;
238 return 1;
239}
240
228static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb) 241static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb)
229{ 242{
230 struct inode *new = NULL; 243 struct inode *new = NULL;
@@ -251,6 +264,8 @@ static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb)
251 264
252 for (i = OCFS2_FIRST_ONLINE_SYSTEM_INODE; 265 for (i = OCFS2_FIRST_ONLINE_SYSTEM_INODE;
253 i <= OCFS2_LAST_GLOBAL_SYSTEM_INODE; i++) { 266 i <= OCFS2_LAST_GLOBAL_SYSTEM_INODE; i++) {
267 if (!ocfs2_need_system_inode(osb, i))
268 continue;
254 new = ocfs2_get_system_file_inode(osb, i, osb->slot_num); 269 new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
255 if (!new) { 270 if (!new) {
256 ocfs2_release_system_inodes(osb); 271 ocfs2_release_system_inodes(osb);
@@ -281,6 +296,8 @@ static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb)
281 for (i = OCFS2_LAST_GLOBAL_SYSTEM_INODE + 1; 296 for (i = OCFS2_LAST_GLOBAL_SYSTEM_INODE + 1;
282 i < NUM_SYSTEM_INODES; 297 i < NUM_SYSTEM_INODES;
283 i++) { 298 i++) {
299 if (!ocfs2_need_system_inode(osb, i))
300 continue;
284 new = ocfs2_get_system_file_inode(osb, i, osb->slot_num); 301 new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
285 if (!new) { 302 if (!new) {
286 ocfs2_release_system_inodes(osb); 303 ocfs2_release_system_inodes(osb);