Skip to contentSkip to conversation

2.6.5-mm1 [PATCH]

DISCUSSION Ray Lee 2 participants 3 messages Apr 5, 2004 Diskquota

lore
Share & tools
lore

Ray Lee

author
#0 lore raw

Hello,

Probably the least important email you'll receive all day, but...

Quoted 2 lines

no-quota-inode-shrinkage.patch
shrink inode when quota is disabled

Could I suggest an alternate version, below? It limits the knowledge of the CONFIG_QUOTA option to the quota header file, and still shrinks the inode by two pointers. The only functional difference between this and Matt Mackall's version is the below will still leave in a call to memset, but with a zero length. On the plus side, it keeps fs/inode.c free of preprocessor noise, which seems worth the trade-off.

 quota.h |    4 ++++
 1 files changed, 4 insertions(+)
include/linux/quota.h +4 -0
diff -NurX ../dontdiff linus-2.6/include/linux/quota.h linus-2.6-inode-shrinkage/include/linux/quota.h
@@ -57,7 +57,11 @@
 #define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10))
 #define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)
 
+#ifdef CONFIG_QUOTA
 #define MAXQUOTAS 2
+#else
+#define MAXQUOTAS 0
+#endif
 
 #define USRQUOTA  0		/* element used for user quotas */
 #define GRPQUOTA  1		/* element used for group quotas */

--
Ray Lee

#1 lore raw
Quoted 18 lines · Ray Lee

Could I suggest an alternate version, below? It limits the knowledge of
the CONFIG_QUOTA option to the quota header file, and still shrinks the inode by two pointers. The only functional difference between this and Matt Mackall's version is the below will still leave in a call to memset, but with a zero length. On the plus side, it keeps fs/inode.c free of preprocessor noise, which seems worth the trade-off.

  quota.h |    4 ++++
  1 files changed, 4 insertions(+)

diff -NurX ../dontdiff linus-2.6/include/linux/quota.h linus-2.6-inode-shrinkage/include/linux/quota.h
--- linus-2.6/include/linux/quota.h 2004-04-03 08:46:35.000000000 -0800
+++ linus-2.6-inode-shrinkage/include/linux/quota.h 2004-04-03 08:45:19.000000000 -0800
@@ -57,7 +57,11 @@
#define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10))
#define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)

Quoted 5 lines

+#ifdef CONFIG_QUOTA
#define MAXQUOTAS 2
+#else
+#define MAXQUOTAS 0
+#endif

The advantage of the ifdeffy one is that if someone accesses i_dquot outside CONFIG_QUOTA, they get a compile failure rather than runtime inode corruption.

author
#2 lore raw
Quoted 3 lines · Andrew Morton

The advantage of the ifdeffy one is that if someone accesses i_dquot outside CONFIG_QUOTA, they get a compile failure rather than runtime inode corruption.

Ah, that's useful. Point taken.