Skip to contentSkip to conversation

linux-2.5.66/fs/cramfs/inode.c typecheck - int vs. struct

PATCH New Adam Kelly 1 participant 1 message Mar 26, 2003

lore
Share & tools
lore

Adam Kelly

author
#0 lore raw

PATCH 1/1 linux-2.5.66/fs/cramfs/inode.c typecheck - int vs. struct

Very minor change. GCC now does more type checking, so This just zeros a timespec struct so that i_mtime, etc will match types.

gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7) compiling linux-2.5.66

-Adam

inode.c 2003-03-25 23:00:50.000000000 -0600 renamed from inode.c.orig 2003-03-25 22:50:17.000000000 -0600 +0 -0
@@ -44,6 +44,8 @@
{
       struct inode * inode = new_inode(sb);

+ const struct timespec zero_timespec = {0};
+

       if (inode) {
               inode->i_mode = cramfs_inode->mode;
               inode->i_uid = cramfs_inode->uid;
@@ -51,7 +53,7 @@
               inode->i_blocks = (cramfs_inode->size - 1) / 512 + 1;
               inode->i_blksize = PAGE_CACHE_SIZE;
               inode->i_gid = cramfs_inode->gid;
-               inode->i_mtime = inode->i_atime = inode->i_ctime = 0;
+               inode->i_mtime = inode->i_atime = inode->i_ctime = zero_timespec;
               inode->i_ino = CRAMINO(cramfs_inode);
               /* inode->i_nlink is left 1 - arguably wrong for 

directories,
but it's the best we can do without reading the
directory