lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed,  6 Jan 2016 21:36:08 -0800
From:	Deepa Dinamani <deepa.kernel@...il.com>
To:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	y2038@...ts.linaro.org
Subject: [RFC 11/15] fs: ext4: replace inode_timespec with timespec64

Substitute inode_timespec aliases with timespec64.
Since CONFIG_FS_USES_64BIT_TIME is enabled, internally
all inode_timespec references are using timespec64
already.

Signed-off-by: Deepa Dinamani <deepa.kernel@...il.com>
---
 fs/ext4/ext4.h    | 14 +++++++-------
 fs/ext4/extents.c |  6 +++---
 fs/ext4/ialloc.c  |  2 +-
 fs/ext4/inline.c  |  4 ++--
 fs/ext4/inode.c   |  6 +++---
 fs/ext4/ioctl.c   |  2 +-
 fs/ext4/namei.c   | 10 +++++-----
 fs/ext4/super.c   |  2 +-
 8 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 4bb2604..2d4bef0 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -754,14 +754,14 @@ struct move_extent {
  * affected filesystem before 2242.
  */
 
-static inline __le32 ext4_encode_extra_time(struct inode_timespec *time)
+static inline __le32 ext4_encode_extra_time(struct timespec64 *time)
 {
 	u32 extra = sizeof(time->tv_sec) > 4 ?
 		((time->tv_sec - (s32)time->tv_sec) >> 32) & EXT4_EPOCH_MASK : 0;
 	return cpu_to_le32(extra | (time->tv_nsec << EXT4_EPOCH_BITS));
 }
 
-static inline void ext4_decode_extra_time(struct inode_timespec *time,
+static inline void ext4_decode_extra_time(struct timespec64 *time,
 					  __le32 extra)
 {
 	if (unlikely(sizeof(time->tv_sec) > 4 &&
@@ -787,7 +787,7 @@ static inline void ext4_decode_extra_time(struct inode_timespec *time,
 
 #define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode)				\
 do {										\
-	struct inode_timespec __ts = VFS_INODE_GET_XTIME(xtime, inode);		\
+	struct timespec64 __ts = VFS_INODE_GET_XTIME(xtime, inode);		\
 	(raw_inode)->xtime = cpu_to_le32(__ts.tv_sec);				\
 	if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra))	\
 		(raw_inode)->xtime ## _extra =					\
@@ -805,7 +805,7 @@ do {									       \
 
 #define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode)				\
 do {										\
-	struct inode_timespec __ts = VFS_INODE_GET_XTIME(xtime, inode);		\
+	struct timespec64 __ts = VFS_INODE_GET_XTIME(xtime, inode);		\
 	__ts.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime);			\
 	if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra))	\
 		ext4_decode_extra_time(&__ts,					\
@@ -935,9 +935,9 @@ struct ext4_inode_info {
 
 	/*
 	 * File creation time. Its function is same as that of
-	 * struct inode_timespec i_{a,c,m}time in the generic inode.
+	 * struct timespec64 i_{a,c,m}time in the generic inode.
 	 */
-	struct inode_timespec i_crtime;
+	struct timespec64 i_crtime;
 
 	/* mballoc */
 	struct list_head i_prealloc_list;
@@ -1445,7 +1445,7 @@ static inline struct ext4_inode_info *EXT4_I(struct inode *inode)
 	return container_of(inode, struct ext4_inode_info, vfs_inode);
 }
 
-static inline struct inode_timespec ext4_current_time(struct inode *inode)
+static inline struct timespec64 ext4_current_time(struct inode *inode)
 {
 	return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ?
 		current_fs_time(inode->i_sb) : current_fs_time_sec(inode->i_sb);
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 99c4800..ec1a912 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4756,7 +4756,7 @@ static long ext4_zero_range(struct file *file, loff_t offset,
 			    loff_t len, int mode)
 {
 	struct inode *inode = file_inode(file);
-	struct inode_timespec now;
+	struct timespec64 now;
 	handle_t *handle = NULL;
 	unsigned int max_blocks;
 	loff_t new_size = 0;
@@ -5465,7 +5465,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
 {
 	struct super_block *sb = inode->i_sb;
 	ext4_lblk_t punch_start, punch_stop;
-	struct inode_timespec now;
+	struct timespec64 now;
 	handle_t *handle;
 	unsigned int credits;
 	loff_t new_size, ioffset;
@@ -5616,7 +5616,7 @@ int ext4_insert_range(struct inode *inode, loff_t offset, loff_t len)
 	struct ext4_ext_path *path;
 	struct ext4_extent *extent;
 	ext4_lblk_t offset_lblk, len_lblk, ee_start_lblk = 0;
-	struct inode_timespec now;
+	struct timespec64 now;
 	unsigned int credits, ee_len;
 	int ret = 0, depth, split_flag = 0;
 	loff_t ioffset;
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 6f16598..929c092 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -756,7 +756,7 @@ struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir,
 	ext4_group_t i;
 	ext4_group_t flex_group;
 	struct ext4_group_info *grp;
-	struct inode_timespec ts;
+	struct timespec64 ts;
 	int encrypt = 0;
 
 	/* Cannot create files in a deleted directory */
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index a53fb3b..08550a4 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -1003,7 +1003,7 @@ static int ext4_add_dirent_to_inline(handle_t *handle,
 	struct inode	*dir = d_inode(dentry->d_parent);
 	int		err;
 	struct ext4_dir_entry_2 *de;
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	err = ext4_find_dest_de(dir, inode, iloc->bh, inline_start,
 				inline_size, fname, &de);
@@ -1899,7 +1899,7 @@ void ext4_inline_data_truncate(struct inode *inode, int *has_inline)
 	int inline_size, value_len, needed_blocks;
 	size_t i_size;
 	void *value = NULL;
-	struct inode_timespec now;
+	struct timespec64 now;
 	struct ext4_xattr_ibody_find is = {
 		.s = { .not_found = -ENODATA, },
 	};
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 078fd58..be618a7 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3689,7 +3689,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
 	struct super_block *sb = inode->i_sb;
 	ext4_lblk_t first_block, stop_block;
 	struct address_space *mapping = inode->i_mapping;
-	struct inode_timespec now;
+	struct timespec64 now;
 	loff_t first_block_offset, last_block_offset;
 	handle_t *handle;
 	unsigned int credits;
@@ -3878,7 +3878,7 @@ void ext4_truncate(struct inode *inode)
 	unsigned int credits;
 	handle_t *handle;
 	struct address_space *mapping = inode->i_mapping;
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	/*
 	 * There is a possibility that we're either freeing the inode
@@ -4831,7 +4831,7 @@ static void ext4_wait_for_tail_page_commit(struct inode *inode)
 int ext4_setattr(struct dentry *dentry, struct iattr *attr)
 {
 	struct inode *inode = d_inode(dentry);
-	struct inode_timespec now;
+	struct timespec64 now;
 	int error, rc = 0;
 	int orphan = 0;
 	const unsigned int ia_valid = attr->ia_valid;
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 3825eb7..94be0f8 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -98,7 +98,7 @@ static long swap_inode_boot_loader(struct super_block *sb,
 	struct inode *inode_bl;
 	struct ext4_inode_info *ei_bl;
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	if (inode->i_nlink != 1 || !S_ISREG(inode->i_mode))
 		return -EINVAL;
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 34c2d91..9ced45b 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1876,7 +1876,7 @@ static int add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname,
 			     struct buffer_head *bh)
 {
 	unsigned int	blocksize = dir->i_sb->s_blocksize;
-	struct inode_timespec now;
+	struct timespec64 now;
 	int		csum_size = 0;
 	int		err;
 
@@ -2914,7 +2914,7 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry)
 	struct buffer_head *bh;
 	struct ext4_dir_entry_2 *de;
 	handle_t *handle = NULL;
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	/* Initialize quotas before so that eventual writes go in
 	 * separate transaction */
@@ -2991,7 +2991,7 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry)
 	struct buffer_head *bh;
 	struct ext4_dir_entry_2 *de;
 	handle_t *handle = NULL;
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	trace_ext4_unlink_enter(dir, dentry);
 	/* Initialize quotas before so that eventual writes go
@@ -3352,7 +3352,7 @@ static int ext4_rename_dir_finish(handle_t *handle, struct ext4_renament *ent,
 static int ext4_setent(handle_t *handle, struct ext4_renament *ent,
 		       unsigned ino, unsigned file_type)
 {
-	struct inode_timespec now;
+	struct timespec64 now;
 	int retval;
 
 	BUFFER_TRACE(ent->bh, "get write access");
@@ -3501,7 +3501,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
 	int force_reread;
 	int retval;
 	struct inode *whiteout = NULL;
-	struct inode_timespec now;
+	struct timespec64 now;
 	int credits;
 	u8 old_file_type;
 
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2547697..32f6b19 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5116,7 +5116,7 @@ static int ext4_enable_quotas(struct super_block *sb)
 static int ext4_quota_off(struct super_block *sb, int type)
 {
 	struct inode *inode = sb_dqopt(sb)->files[type];
-	struct inode_timespec now;
+	struct timespec64 now;
 	handle_t *handle;
 
 	/* Force all delayed allocation blocks to be allocated.
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ