[PATCH 4/5] libquota: use ext2_loff_t instead of loff_t

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

 



The type loff_t is not portable.  Use ext2_loff_t which handles this
for us.

Cc: Aditya Kali <adityakali@xxxxxxxxxx>
Signed-off-by: "Theodore Ts'o" <tytso@xxxxxxx>
---
 lib/quota/quotaio.c      |    8 +++++---
 lib/quota/quotaio.h      |    4 ++--
 lib/quota/quotaio_tree.c |   16 +++++++++-------
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/lib/quota/quotaio.c b/lib/quota/quotaio.c
index f651353..0457886 100644
--- a/lib/quota/quotaio.c
+++ b/lib/quota/quotaio.c
@@ -133,7 +133,8 @@ static ext2_off64_t compute_inode_size(ext2_filsys fs, ext2_ino_t ino)
 }
 
 /* Functions to read/write quota file. */
-static unsigned int quota_write_nomount(struct quota_file *qf, loff_t offset,
+static unsigned int quota_write_nomount(struct quota_file *qf,
+					ext2_loff_t offset,
 					void *buf, unsigned int size)
 {
 	ext2_file_t	e2_file = qf->e2_file;
@@ -156,8 +157,9 @@ static unsigned int quota_write_nomount(struct quota_file *qf, loff_t offset,
 	return bytes_written;
 }
 
-static unsigned int quota_read_nomount(struct quota_file *qf, loff_t offset,
-					void *buf, unsigned int size)
+static unsigned int quota_read_nomount(struct quota_file *qf,
+				       ext2_loff_t offset,
+				       void *buf, unsigned int size)
 {
 	ext2_file_t	e2_file = qf->e2_file;
 	unsigned int	bytes_read = 0;
diff --git a/lib/quota/quotaio.h b/lib/quota/quotaio.h
index f2c34f2..333a59f 100644
--- a/lib/quota/quotaio.h
+++ b/lib/quota/quotaio.h
@@ -56,9 +56,9 @@ struct quota_handle {
 	int qh_fmt;		/* Quotafile format */
 	int qh_io_flags;	/* IO flags for file */
 	struct quota_file qh_qf;
-	unsigned int (*e2fs_read)(struct quota_file *qf, loff_t offset,
+	unsigned int (*e2fs_read)(struct quota_file *qf, ext2_loff_t offset,
 			 void *buf, unsigned int size);
-	unsigned int (*e2fs_write)(struct quota_file *qf, loff_t offset,
+	unsigned int (*e2fs_write)(struct quota_file *qf, ext2_loff_t offset,
 			  void *buf, unsigned int size);
 	struct quotafile_ops *qh_ops;	/* Operations on quotafile */
 	struct util_dqinfo qh_info;	/* Generic quotafile info */
diff --git a/lib/quota/quotaio_tree.c b/lib/quota/quotaio_tree.c
index 1daea75..0890ca3 100644
--- a/lib/quota/quotaio_tree.c
+++ b/lib/quota/quotaio_tree.c
@@ -392,8 +392,8 @@ void qtree_delete_dquot(struct dquot *dquot)
 }
 
 /* Find entry in block */
-static loff_t find_block_dqentry(struct quota_handle *h,
-				 struct dquot *dquot, uint blk)
+static ext2_loff_t find_block_dqentry(struct quota_handle *h,
+				      struct dquot *dquot, uint blk)
 {
 	struct qtree_mem_dqinfo *info = &h->qh_info.u.v2_mdqi.dqi_qtree;
 	dqbuf_t buf = getdqbuf();
@@ -415,11 +415,12 @@ static loff_t find_block_dqentry(struct quota_handle *h,
 }
 
 /* Find entry for given id in the tree */
-static loff_t find_tree_dqentry(struct quota_handle *h, struct dquot *dquot,
-				uint blk, int depth)
+static ext2_loff_t find_tree_dqentry(struct quota_handle *h,
+				     struct dquot *dquot,
+				     uint blk, int depth)
 {
 	dqbuf_t buf = getdqbuf();
-	loff_t ret = 0;
+	ext2_loff_t ret = 0;
 	u_int32_t *ref = (u_int32_t *) buf;
 
 	read_blk(h, blk, buf);
@@ -437,7 +438,8 @@ out_buf:
 }
 
 /* Find entry for given id in the tree - wrapper function */
-static inline loff_t find_dqentry(struct quota_handle *h, struct dquot *dquot)
+static inline ext2_loff_t find_dqentry(struct quota_handle *h,
+				       struct dquot *dquot)
 {
 	return find_tree_dqentry(h, dquot, QT_TREEOFF, 0);
 }
@@ -449,7 +451,7 @@ static inline loff_t find_dqentry(struct quota_handle *h, struct dquot *dquot)
 struct dquot *qtree_read_dquot(struct quota_handle *h, qid_t id)
 {
 	struct qtree_mem_dqinfo *info = &h->qh_info.u.v2_mdqi.dqi_qtree;
-	loff_t offset;
+	ext2_loff_t offset;
 	ssize_t ret;
 	char *ddquot = smalloc(info->dqi_entry_size);
 	struct dquot *dquot = get_empty_dquot();
-- 
1.7.4.1.22.gec8e1.dirty

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


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux