[PATCH 3/3] Adjust reiser4 for 3.19: convert to private i_dquot field.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Upstream commit 75cbe701a4251fcd8b846d52ae42f88c9a8e5e93
"vfs: Remove i_dquot field from inode".

Example taken from upstream commit 53873638bd7cbcbf43cea72f0eb0d2ee9260f059
"reiserfs: Convert to private i_dquot field".

reiser4 does not support quotas, but there's rudimentary code doing some quota
operations, and in order for it not to segfault we need to act like we do
support quotas.

Signed-off-by: Ivan Shapovalov <intelfx100@xxxxxxxxx>
---

Hopefully I've done the right thing. Another option would be to simply remove
all the quota-related code.

 fs/reiser4/inode.h     |  4 ++++
 fs/reiser4/super_ops.c | 15 ++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/fs/reiser4/inode.h b/fs/reiser4/inode.h
index 95e1d9e..43f7731 100644
--- a/fs/reiser4/inode.h
+++ b/fs/reiser4/inode.h
@@ -154,6 +154,10 @@ struct reiser4_inode {
 	 * fs/reiser4/search.c:handle_vroot() */
 	reiser4_block_nr vroot;
 	struct mutex loading;
+
+#ifdef CONFIG_QUOTA
+	struct dquot *i_dquot[MAXQUOTAS];
+#endif
 };
 
 void loading_init_once(reiser4_inode *);
diff --git a/fs/reiser4/super_ops.c b/fs/reiser4/super_ops.c
index 7e319bb..b196835 100644
--- a/fs/reiser4/super_ops.c
+++ b/fs/reiser4/super_ops.c
@@ -113,6 +113,9 @@ static struct inode *reiser4_alloc_inode(struct super_block *super)
 		/* this deals with info's loading semaphore */
 		loading_alloc(info);
 		info->vroot = UBER_TREE_ADDR;
+#ifdef CONFIG_QUOTA
+		memset(&info->i_dquot, 0, sizeof(info->i_dquot));
+#endif
 		return &obj->vfs_inode;
 	} else
 		return NULL;
@@ -477,6 +480,13 @@ static int reiser4_show_options(struct seq_file *m, struct dentry *dentry)
 	return 0;
 }
 
+#ifdef CONFIG_QUOTA
+static struct dquot **reiser4_get_dquots(struct inode *inode)
+{
+	return reiser4_inode_data(inode)->i_dquot;
+}
+#endif
+
 struct super_operations reiser4_super_operations = {
 	.alloc_inode = reiser4_alloc_inode,
 	.destroy_inode = reiser4_destroy_inode,
@@ -487,7 +497,10 @@ struct super_operations reiser4_super_operations = {
 	.statfs = reiser4_statfs,
 	.remount_fs = reiser4_remount,
 	.writeback_inodes = reiser4_writeback_inodes,
-	.show_options = reiser4_show_options
+	.show_options = reiser4_show_options,
+#ifdef CONFIG_QUOTA
+	.get_dquots = reiser4_get_dquots,
+#endif
 };
 
 /**
-- 
2.3.0

--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux