From: Arnd Bergmann <arnd@arndb.de>
To: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org, joseph@codesourcery.com,
john.stultz@linaro.org, hch@infradead.org, tglx@linutronix.de,
geert@linux-m68k.org, lftan@altera.com, hpa@zytor.com,
linux-fsdevel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Sage Weil <sage@inktank.com>,
ceph-devel@vger.kernel.org
Subject: [RFC 08/32] fs/ceph: convert to 'struct inode_time'
Date: Fri, 30 May 2014 22:01:32 +0200 [thread overview]
Message-ID: <1401480116-1973111-9-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1401480116-1973111-1-git-send-email-arnd@arndb.de>
Ceph supports timestamps until year 2106 using u32 seconds on the
wire, but the kernel internally limits this to a signed value
that only works until 2038 on 32 bit CPUs.
This changes the type used in the ceph code to struct inode_time
to lift that limitation.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Sage Weil <sage@inktank.com>
Cc: ceph-devel@vger.kernel.org
---
drivers/block/rbd.c | 2 +-
fs/ceph/cache.c | 2 +-
fs/ceph/caps.c | 6 +++---
fs/ceph/file.c | 4 ++--
fs/ceph/inode.c | 20 ++++++++++----------
fs/ceph/super.h | 8 ++++----
include/linux/ceph/decode.h | 8 ++++----
include/linux/ceph/osd_client.h | 4 ++--
net/ceph/auth_x.c | 2 +-
net/ceph/osd_client.c | 4 ++--
10 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 4c95b50..d4a7404 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1710,7 +1710,7 @@ static void rbd_osd_req_format_write(struct rbd_obj_request *obj_request)
struct rbd_img_request *img_request = obj_request->img_request;
struct ceph_osd_request *osd_req = obj_request->osd_req;
struct ceph_snap_context *snapc;
- struct timespec mtime = CURRENT_TIME;
+ struct inode_time mtime = CURRENT_TIME;
rbd_assert(osd_req != NULL);
diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c
index 834f9f3..cf48f4b 100644
--- a/fs/ceph/cache.c
+++ b/fs/ceph/cache.c
@@ -25,7 +25,7 @@
#include "cache.h"
struct ceph_aux_inode {
- struct timespec mtime;
+ struct inode_time mtime;
loff_t size;
};
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index c561b62..263eecd 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -988,7 +988,7 @@ static int send_cap_msg(struct ceph_mds_session *session,
int caps, int wanted, int dirty,
u32 seq, u64 flush_tid, u32 issue_seq, u32 mseq,
u64 size, u64 max_size,
- struct timespec *mtime, struct timespec *atime,
+ struct inode_time *mtime, struct inode_time *atime,
u64 time_warp_seq,
kuid_t uid, kgid_t gid, umode_t mode,
u64 xattr_version,
@@ -1132,7 +1132,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
int held, revoking, dropping, keep;
u64 seq, issue_seq, mseq, time_warp_seq, follows;
u64 size, max_size;
- struct timespec mtime, atime;
+ struct inode_time mtime, atime;
int wake = 0;
umode_t mode;
kuid_t uid;
@@ -2416,7 +2416,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
int issued, implemented, used, wanted, dirty;
u64 size = le64_to_cpu(grant->size);
u64 max_size = le64_to_cpu(grant->max_size);
- struct timespec mtime, atime, ctime;
+ struct inode_time mtime, atime, ctime;
int check_caps = 0;
int wake = 0;
int writeback = 0;
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 3020851..0ebb709 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -546,7 +546,7 @@ ceph_sync_direct_write(struct kiocb *iocb, struct iov_iter *from)
int flags;
int check_caps = 0;
int ret;
- struct timespec mtime = CURRENT_TIME;
+ struct inode_time mtime = CURRENT_TIME;
loff_t pos = iocb->ki_pos;
size_t count = iov_iter_count(from);
@@ -662,7 +662,7 @@ static ssize_t ceph_sync_write(struct kiocb *iocb, struct iov_iter *from)
int flags;
int check_caps = 0;
int ret;
- struct timespec mtime = CURRENT_TIME;
+ struct inode_time mtime = CURRENT_TIME;
loff_t pos = iocb->ki_pos;
size_t count = iov_iter_count(from);
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index e4fff9f..ba18c9d 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -506,8 +506,8 @@ int ceph_fill_file_size(struct inode *inode, int issued,
}
void ceph_fill_file_time(struct inode *inode, int issued,
- u64 time_warp_seq, struct timespec *ctime,
- struct timespec *mtime, struct timespec *atime)
+ u64 time_warp_seq, struct inode_time *ctime,
+ struct inode_time *mtime, struct inode_time *atime)
{
struct ceph_inode_info *ci = ceph_inode(inode);
int warn = 0;
@@ -517,7 +517,7 @@ void ceph_fill_file_time(struct inode *inode, int issued,
CEPH_CAP_FILE_BUFFER|
CEPH_CAP_AUTH_EXCL|
CEPH_CAP_XATTR_EXCL)) {
- if (timespec_compare(ctime, &inode->i_ctime) > 0) {
+ if (inode_time_compare(ctime, &inode->i_ctime) > 0) {
dout("ctime %ld.%09ld -> %ld.%09ld inc w/ cap\n",
inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec,
ctime->tv_sec, ctime->tv_nsec);
@@ -536,14 +536,14 @@ void ceph_fill_file_time(struct inode *inode, int issued,
ci->i_time_warp_seq = time_warp_seq;
} else if (time_warp_seq == ci->i_time_warp_seq) {
/* nobody did utimes(); take the max */
- if (timespec_compare(mtime, &inode->i_mtime) > 0) {
+ if (inode_time_compare(mtime, &inode->i_mtime) > 0) {
dout("mtime %ld.%09ld -> %ld.%09ld inc\n",
inode->i_mtime.tv_sec,
inode->i_mtime.tv_nsec,
mtime->tv_sec, mtime->tv_nsec);
inode->i_mtime = *mtime;
}
- if (timespec_compare(atime, &inode->i_atime) > 0) {
+ if (inode_time_compare(atime, &inode->i_atime) > 0) {
dout("atime %ld.%09ld -> %ld.%09ld inc\n",
inode->i_atime.tv_sec,
inode->i_atime.tv_nsec,
@@ -586,7 +586,7 @@ static int fill_inode(struct inode *inode,
struct ceph_inode_info *ci = ceph_inode(inode);
int i;
int issued = 0, implemented;
- struct timespec mtime, atime, ctime;
+ struct inode_time mtime, atime, ctime;
u32 nsplits;
struct ceph_inode_frag *frag;
struct rb_node *rb_node;
@@ -1714,12 +1714,12 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
inode->i_atime = attr->ia_atime;
dirtied |= CEPH_CAP_FILE_EXCL;
} else if ((issued & CEPH_CAP_FILE_WR) &&
- timespec_compare(&inode->i_atime,
+ inode_time_compare(&inode->i_atime,
&attr->ia_atime) < 0) {
inode->i_atime = attr->ia_atime;
dirtied |= CEPH_CAP_FILE_WR;
} else if ((issued & CEPH_CAP_FILE_SHARED) == 0 ||
- !timespec_equal(&inode->i_atime, &attr->ia_atime)) {
+ !inode_time_equal(&inode->i_atime, &attr->ia_atime)) {
ceph_encode_timespec(&req->r_args.setattr.atime,
&attr->ia_atime);
mask |= CEPH_SETATTR_ATIME;
@@ -1736,12 +1736,12 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
inode->i_mtime = attr->ia_mtime;
dirtied |= CEPH_CAP_FILE_EXCL;
} else if ((issued & CEPH_CAP_FILE_WR) &&
- timespec_compare(&inode->i_mtime,
+ inode_time_compare(&inode->i_mtime,
&attr->ia_mtime) < 0) {
inode->i_mtime = attr->ia_mtime;
dirtied |= CEPH_CAP_FILE_WR;
} else if ((issued & CEPH_CAP_FILE_SHARED) == 0 ||
- !timespec_equal(&inode->i_mtime, &attr->ia_mtime)) {
+ !inode_time_equal(&inode->i_mtime, &attr->ia_mtime)) {
ceph_encode_timespec(&req->r_args.setattr.mtime,
&attr->ia_mtime);
mask |= CEPH_SETATTR_MTIME;
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index ead05cc..15dc11a 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -156,7 +156,7 @@ struct ceph_cap_snap {
u64 xattr_version;
u64 size;
- struct timespec mtime, atime, ctime;
+ struct inode_time mtime, atime, ctime;
u64 time_warp_seq;
int writing; /* a sync write is still in progress */
int dirty_pages; /* dirty pages awaiting writeback */
@@ -263,7 +263,7 @@ struct ceph_inode_info {
char *i_symlink;
/* for dirs */
- struct timespec i_rctime;
+ struct inode_time i_rctime;
u64 i_rbytes, i_rfiles, i_rsubdirs;
u64 i_files, i_subdirs;
@@ -698,8 +698,8 @@ extern struct inode *ceph_get_snapdir(struct inode *parent);
extern int ceph_fill_file_size(struct inode *inode, int issued,
u32 truncate_seq, u64 truncate_size, u64 size);
extern void ceph_fill_file_time(struct inode *inode, int issued,
- u64 time_warp_seq, struct timespec *ctime,
- struct timespec *mtime, struct timespec *atime);
+ u64 time_warp_seq, struct inode_time *ctime,
+ struct inode_time *mtime, struct inode_time *atime);
extern int ceph_fill_trace(struct super_block *sb,
struct ceph_mds_request *req,
struct ceph_mds_session *session);
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h
index a6ef9cc..f1bb277 100644
--- a/include/linux/ceph/decode.h
+++ b/include/linux/ceph/decode.h
@@ -132,16 +132,16 @@ bad:
}
/*
- * struct ceph_timespec <-> struct timespec
+ * struct ceph_timespec <-> struct inode_time
*/
-static inline void ceph_decode_timespec(struct timespec *ts,
+static inline void ceph_decode_timespec(struct inode_time *ts,
const struct ceph_timespec *tv)
{
- ts->tv_sec = (__kernel_time_t)le32_to_cpu(tv->tv_sec);
+ ts->tv_sec = (u64)le32_to_cpu(tv->tv_sec);
ts->tv_nsec = (long)le32_to_cpu(tv->tv_nsec);
}
static inline void ceph_encode_timespec(struct ceph_timespec *tv,
- const struct timespec *ts)
+ const struct inode_time *ts)
{
tv->tv_sec = cpu_to_le32((u32)ts->tv_sec);
tv->tv_nsec = cpu_to_le32((u32)ts->tv_nsec);
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 94ec696..1617d31 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -312,7 +312,7 @@ extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *
extern void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off,
struct ceph_snap_context *snapc,
u64 snap_id,
- struct timespec *mtime);
+ struct inode_time *mtime);
extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *,
struct ceph_file_layout *layout,
@@ -361,7 +361,7 @@ extern int ceph_osdc_writepages(struct ceph_osd_client *osdc,
struct ceph_snap_context *sc,
u64 off, u64 len,
u32 truncate_seq, u64 truncate_size,
- struct timespec *mtime,
+ struct inode_time *mtime,
struct page **pages, int nr_pages);
/* watch/notify events */
diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
index 96238ba..14f0e8a 100644
--- a/net/ceph/auth_x.c
+++ b/net/ceph/auth_x.c
@@ -163,7 +163,7 @@ static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
void *dp, *dend;
int dlen;
char is_enc;
- struct timespec validity;
+ struct inode_time validity;
struct ceph_crypto_key old_key;
void *tp, *tpend;
struct ceph_timespec new_validity;
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index b0dfce7..1433798 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -2315,7 +2315,7 @@ bad:
*/
void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off,
struct ceph_snap_context *snapc, u64 snap_id,
- struct timespec *mtime)
+ struct inode_time *mtime)
{
struct ceph_msg *msg = req->r_request;
void *p;
@@ -2630,7 +2630,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino,
struct ceph_snap_context *snapc,
u64 off, u64 len,
u32 truncate_seq, u64 truncate_size,
- struct timespec *mtime,
+ struct inode_time *mtime,
struct page **pages, int num_pages)
{
struct ceph_osd_request *req;
--
1.8.3.2
next prev parent reply other threads:[~2014-05-30 20:06 UTC|newest]
Thread overview: 124+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-30 20:01 [RFC 00/32] making inode time stamps y2038 ready Arnd Bergmann
2014-05-30 20:01 ` [RFC 01/32] fs: introduce new 'struct inode_time' Arnd Bergmann
2014-05-31 7:56 ` Geert Uytterhoeven
2014-05-31 8:39 ` Andreas Schwab
2014-05-31 13:19 ` Geert Uytterhoeven
2014-05-31 13:46 ` Andreas Schwab
2014-05-31 14:54 ` Arnd Bergmann
2014-05-31 16:15 ` Geert Uytterhoeven
2014-05-31 9:03 ` H. Peter Anvin
2014-05-31 14:53 ` Arnd Bergmann
2014-05-31 14:55 ` H. Peter Anvin
2014-05-30 20:01 ` [RFC 02/32] uapi: add struct __kernel_timespec{32,64} Arnd Bergmann
2014-05-30 20:18 ` H. Peter Anvin
2014-05-31 15:09 ` Arnd Bergmann
2014-05-30 20:01 ` [RFC 03/32] fs: introduce sys_utimens64at Arnd Bergmann
2014-05-31 9:22 ` Andreas Schwab
2014-05-31 14:55 ` Arnd Bergmann
2014-05-30 20:01 ` [RFC 04/32] fs: introduce sys_newfstat64/sys_newfstatat64 Arnd Bergmann
2014-05-30 20:01 ` [RFC 05/32] arch: hook up new stat and utimes syscalls Arnd Bergmann
2014-05-30 20:01 ` [RFC 06/32] isofs: fix timestamps beyond 2027 Arnd Bergmann
2014-05-31 7:59 ` Geert Uytterhoeven
2014-05-31 8:47 ` H. Peter Anvin
2014-05-30 20:01 ` [RFC 07/32] fs/nfs: convert to struct inode_time Arnd Bergmann
2014-05-30 20:01 ` Arnd Bergmann [this message]
2014-05-30 20:01 ` [RFC 09/32] fs/pstore: " Arnd Bergmann
2014-05-30 21:14 ` Kees Cook
2014-05-30 20:01 ` [RFC 10/32] fs/coda: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 11/32] xfs: " Arnd Bergmann
2014-05-31 0:37 ` Dave Chinner
2014-05-31 0:41 ` H. Peter Anvin
2014-05-31 1:14 ` Dave Chinner
2014-05-31 1:22 ` H. Peter Anvin
2014-05-31 5:54 ` Dave Chinner
2014-05-31 8:41 ` H. Peter Anvin
2014-05-31 15:46 ` Nicolas Pitre
2014-06-01 19:56 ` Arnd Bergmann
2014-06-01 20:26 ` H. Peter Anvin
2014-06-02 11:02 ` Arnd Bergmann
2014-06-02 1:36 ` Nicolas Pitre
2014-06-02 2:22 ` Dave Chinner
2014-06-02 7:09 ` Geert Uytterhoeven
2014-06-02 10:56 ` Arnd Bergmann
2014-06-02 11:57 ` Theodore Ts'o
2014-06-02 12:38 ` Arnd Bergmann
2014-06-02 13:15 ` Theodore Ts'o
2014-06-02 12:52 ` Arnd Bergmann
2014-06-02 13:07 ` Theodore Ts'o
2014-06-02 15:01 ` Arnd Bergmann
2014-06-02 14:52 ` H. Peter Anvin
2014-06-02 15:04 ` Chuck Lever
2014-06-02 15:31 ` Theodore Ts'o
2014-06-02 17:12 ` H. Peter Anvin
2014-06-02 18:50 ` Arnd Bergmann
2014-06-02 22:29 ` Theodore Ts'o
2014-06-02 22:32 ` H. Peter Anvin
2014-06-02 23:32 ` Theodore Ts'o
2014-06-02 23:33 ` H. Peter Anvin
2014-06-03 13:09 ` Roger Willcocks
2014-06-02 18:52 ` Arnd Bergmann
2014-06-02 18:58 ` Roger Willcocks
2014-06-02 19:04 ` Chuck Lever
2014-06-02 19:10 ` Arnd Bergmann
2014-06-01 0:39 ` Dave Chinner
2014-06-02 14:00 ` Joseph S. Myers
2014-05-31 15:37 ` Arnd Bergmann
2014-06-01 0:24 ` Dave Chinner
2014-06-02 0:28 ` Dave Chinner
2014-06-02 11:35 ` Roger Willcocks
2014-06-02 11:43 ` Arnd Bergmann
2014-06-03 0:32 ` Dave Chinner
2014-06-03 7:33 ` Arnd Bergmann
2014-06-03 8:41 ` Dave Chinner
2014-06-03 9:16 ` Arnd Bergmann
2014-05-30 20:01 ` [RFC 12/32] btrfs: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 13/32] ext3: " Arnd Bergmann
2014-05-31 9:10 ` H. Peter Anvin
2014-05-31 14:32 ` Arnd Bergmann
2014-05-30 20:01 ` [RFC 14/32] ext4: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 15/32] cifs: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 16/32] ntfs: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 17/32] ubifs: " Arnd Bergmann
2014-06-02 7:54 ` Artem Bityutskiy
2014-05-30 20:01 ` [RFC 18/32] ocfs2: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 19/32] fs/fat: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 20/32] afs: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 21/32] udf: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 22/32] fs: convert simple fs to inode_time Arnd Bergmann
2014-05-30 23:06 ` Greg Kroah-Hartman
2014-05-30 20:01 ` [RFC 23/32] logfs: convert to struct inode_time Arnd Bergmann
2014-05-30 20:01 ` [RFC 24/32] hfs, hfsplus: " Arnd Bergmann
2014-05-31 14:23 ` Vyacheslav Dubeyko
2014-05-30 20:01 ` [RFC 25/32] gfs2: " Arnd Bergmann
2014-06-02 9:52 ` Steven Whitehouse
2014-05-30 20:01 ` [RFC 26/32] reiserfs: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 27/32] jffs2: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 28/32] adfs: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 29/32] f2fs: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 30/32] fuse: " Arnd Bergmann
2014-05-30 20:01 ` [RFC 31/32] scsi: fnic: use current_kernel_time() for timestamp Arnd Bergmann
2014-05-30 20:01 ` [RFC 32/32] fs: use new inode_time definition unconditionally Arnd Bergmann
2014-05-31 14:30 ` [RFC 00/32] making inode time stamps y2038 ready Vyacheslav Dubeyko
2014-06-03 12:21 ` Arnd Bergmann
2014-05-31 14:51 ` Richard Cochran
2014-05-31 15:23 ` Arnd Bergmann
2014-05-31 18:22 ` Richard Cochran
2014-05-31 19:34 ` H. Peter Anvin
2014-06-01 4:46 ` Richard Cochran
2014-06-01 4:44 ` Richard Cochran
2014-06-02 13:52 ` Joseph S. Myers
2014-06-02 19:19 ` Arnd Bergmann
2014-06-02 19:26 ` H. Peter Anvin
2014-06-02 19:55 ` Arnd Bergmann
2014-06-02 21:57 ` H. Peter Anvin
2014-06-03 14:22 ` Arnd Bergmann
2014-06-03 14:33 ` Joseph S. Myers
2014-06-03 14:37 ` Arnd Bergmann
2014-06-03 21:38 ` Dave Chinner
2014-06-04 15:03 ` Arnd Bergmann
2014-06-04 17:30 ` Nicolas Pitre
2014-06-04 19:24 ` Arnd Bergmann
2014-06-05 0:10 ` H. Peter Anvin
2014-06-10 9:54 ` Arnd Bergmann
2014-06-02 21:02 ` Joseph S. Myers
2014-06-04 15:05 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1401480116-1973111-9-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=ceph-devel@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=hch@infradead.org \
--cc=hpa@zytor.com \
--cc=john.stultz@linaro.org \
--cc=joseph@codesourcery.com \
--cc=lftan@altera.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sage@inktank.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).