*** fs/locks.c.ar Sun Nov 25 12:02:28 2007 --- fs/locks.c Tue Nov 27 18:49:01 2007 *************** *** 1157,1182 **** EXPORT_SYMBOL(__break_lease); /** - * lease_get_mtime - * @inode: the inode - * @time: pointer to a timespec which will contain the last modified time - * - * This is to force NFS clients to flush their caches for files with - * exclusive leases. The justification is that if someone has an - * exclusive lease, then they could be modifiying it. - */ - void lease_get_mtime(struct inode *inode, struct timespec *time) - { - struct file_lock *flock = inode->i_flock; - if (flock && IS_LEASE(flock) && (flock->fl_type & F_WRLCK)) - *time = current_fs_time(inode->i_sb); - else - *time = inode->i_mtime; - } - - EXPORT_SYMBOL(lease_get_mtime); - - /** * fcntl_getlease - Enquire what lease is currently active * @filp: the file * --- 1157,1162 ---- *** fs/nfsd/nfs3xdr.c.ar Sun Nov 25 12:02:23 2007 --- fs/nfsd/nfs3xdr.c Tue Nov 27 20:57:39 2007 *************** *** 175,181 **** struct vfsmount *mnt = fhp->fh_export->ex_mnt; struct dentry *dentry = fhp->fh_dentry; struct kstat stat; - struct timespec time; vfs_getattr(mnt, dentry, &stat); --- 175,180 ---- *************** *** 198,205 **** p = xdr_encode_hyper(p, (u64) huge_encode_dev(stat.dev)); p = xdr_encode_hyper(p, (u64) stat.ino); p = encode_time3(p, &stat.atime); ! lease_get_mtime(dentry->d_inode, &time); ! p = encode_time3(p, &time); p = encode_time3(p, &stat.ctime); return p; --- 197,203 ---- p = xdr_encode_hyper(p, (u64) huge_encode_dev(stat.dev)); p = xdr_encode_hyper(p, (u64) stat.ino); p = encode_time3(p, &stat.atime); ! p = encode_time3(p, &stat.mtime); p = encode_time3(p, &stat.ctime); return p; *** fs/nfsd/nfsxdr.c.ar Sun Nov 25 12:02:23 2007 --- fs/nfsd/nfsxdr.c Tue Nov 27 20:46:07 2007 *************** *** 158,164 **** struct dentry *dentry = fhp->fh_dentry; struct kstat stat; int type; - struct timespec time; vfs_getattr(mnt, dentry, &stat); type = (stat.mode & S_IFMT); --- 158,163 ---- *************** *** 187,195 **** *p++ = htonl((u32) stat.ino); *p++ = htonl((u32) stat.atime.tv_sec); *p++ = htonl(stat.atime.tv_nsec ? stat.atime.tv_nsec / 1000 : 0); ! lease_get_mtime(dentry->d_inode, &time); ! *p++ = htonl((u32) time.tv_sec); ! *p++ = htonl(time.tv_nsec ? time.tv_nsec / 1000 : 0); *p++ = htonl((u32) stat.ctime.tv_sec); *p++ = htonl(stat.ctime.tv_nsec ? stat.ctime.tv_nsec / 1000 : 0); --- 186,193 ---- *p++ = htonl((u32) stat.ino); *p++ = htonl((u32) stat.atime.tv_sec); *p++ = htonl(stat.atime.tv_nsec ? stat.atime.tv_nsec / 1000 : 0); ! *p++ = htonl((u32) stat.mtime.tv_sec); ! *p++ = htonl(stat.mtime.tv_nsec ? stat.mtime.tv_nsec / 1000 : 0); *p++ = htonl((u32) stat.ctime.tv_sec); *p++ = htonl(stat.ctime.tv_nsec ? stat.ctime.tv_nsec / 1000 : 0); *** include/linux/fs.h.ar Sun Nov 25 12:02:28 2007 --- include/linux/fs.h Tue Nov 27 18:50:20 2007 *************** *** 707,713 **** extern int posix_locks_deadlock(struct file_lock *, struct file_lock *); extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); extern int __break_lease(struct inode *inode, unsigned int flags); - extern void lease_get_mtime(struct inode *, struct timespec *time); extern int lock_may_read(struct inode *, loff_t start, unsigned long count); extern int lock_may_write(struct inode *, loff_t start, unsigned long count); extern void steal_locks(fl_owner_t from); --- 707,712 ----