commit 683b02792cdb437940104f8ac6c82950e7e593bd
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date: Fri Feb 23 13:31:21 2007 -0500
check mtime from all branches
diff --git a/fs/unionfs/dirhelper.c b/fs/unionfs/dirhelper.c
index c44905d..a1a27ed 100644
--- a/fs/unionfs/dirhelper.c
+++ b/fs/unionfs/dirhelper.c
@@ -685,7 +685,7 @@ out:
}
/* Cache contents of dir to an odf/ic file */
-int odf_cache_dir(struct dentry *d_upper, struct dentry *d_odf)
+int odf_cache_dir(struct dentry *d_upper, struct dentry *d_odf, struct
timespec *mtime)
{
int err = 0;
struct dentry *hidden_dentry = NULL;
@@ -709,14 +709,13 @@ int odf_cache_dir(struct dentry *d_upper, struct dentry
*d_odf)
/* compare mtimes, do not proceed if equal */
if (i_odf && i_odf->i_size) {
- if(timespec_equal(&i_odf->i_mtime,
- &d_upper->d_inode->i_mtime))
+ if(timespec_compare(&i_odf->i_mtime,mtime) >= 0)
goto out;
}
dget(d_odf);
mntget(UNIONFS_SB(sb)->odf->mnt);
-
+
/* force truncate if file exists */
if (i_odf) {
attr.ia_size = 0;
@@ -796,7 +795,7 @@ int odf_cache_dir(struct dentry *d_upper, struct dentry
*d_odf)
}
/* set mtime of odf file to that of higher file */
- attr.ia_mtime = d_upper->d_inode->i_mtime;
+ attr.ia_mtime = *mtime;//d_upper->d_inode->i_mtime;
attr.ia_valid = ATTR_MTIME | ATTR_MTIME_SET | ATTR_FORCE;
err = notify_change(d_odf, &attr);
diff --git a/fs/unionfs/odf.h b/fs/unionfs/odf.h
index d34a61e..4d4e06c 100644
--- a/fs/unionfs/odf.h
+++ b/fs/unionfs/odf.h
@@ -105,6 +105,7 @@ struct odf_dentry_info *odf_ic_dir(struct dentry *dir);
int odf_write_dirent(struct file *filp, const char *name, int namelen, u64
ino, unsigned int d_type);
int odf_read_dirent(struct file *filp, char **name, int *namelen, u64 *ino,
unsigned int *d_type);
int odf_purge_dir_cache(struct dentry *dentry);
+int odf_cache_dir(struct dentry *d_upper, struct dentry *d_odf, struct
timespec *mtime);
int odf_rename(struct dentry *old_dentry, struct dentry *new_dentry);
int odf_link(struct dentry *old_dentry, struct dentry *new_dentry);
@@ -154,8 +155,6 @@ static inline void odf_unlock(struct odf_dentry_info *odi)
extern void generate_random_uuid(unsigned char uuid_out[16]);
-int odf_cache_dir(struct dentry *d_upper, struct dentry *d_odf);
-
/* Macros for locking an odf dentry info. */
static inline void odf_lock(struct odf_dentry_info *odi)
{
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs