static int lafs_getattr_dir(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat)
{
- generic_fillattr(dentry->d_inode, stat);
+ lafs_fillattr(dentry->d_inode, stat);
/* hide 'holes' in directories by making the size match
* the number of allocated blocks.
*/
return err;
}
+void lafs_fillattr(struct inode *ino, struct kstat *stat)
+{
+ /* This makes sure the reported 'atime' is a time that
+ * we can store and return after a clean restart
+ */
+ generic_fillattr(ino, stat);
+
+ if (!test_bit(I_AccessTime, &LAFSI(ino)->iflags))
+ return;
+
+ stat->atime = LAFSI(ino)->md.file.i_accesstime;
+ lafs_add_atime_offset(&stat->atime, LAFSI(ino)->md.file.atime_offset);
+}
+
+int lafs_getattr(struct vfsmount *mnt, struct dentry *dentry,
+ struct kstat *stat)
+{
+ lafs_fillattr(dentry->d_inode, stat);
+ return 0;
+}
+
const struct file_operations lafs_file_file_operations = {
.llseek = generic_file_llseek,
.read = do_sync_read,
const struct inode_operations lafs_file_ino_operations = {
.setattr = lafs_setattr,
+ .getattr = lafs_getattr,
};
const struct address_space_operations lafs_file_aops = {
const struct inode_operations lafs_special_ino_operations = {
.setattr = lafs_setattr,
+ .getattr = lafs_getattr,
.truncate = lafs_truncate,
};
#endif
int lafs_setattr(struct dentry *dentry, struct iattr *attr);
+int lafs_getattr(struct vfsmount *mnt, struct dentry *denty,
+ struct kstat *stat);
+void lafs_fillattr(struct inode *ino, struct kstat *stat);
char *strblk(struct block *b);
int lafs_print_tree(struct block *b, int depth);
.readlink = generic_readlink,
.follow_link = page_follow_link_light,
.put_link = page_put_link,
+ .getattr = lafs_getattr,
};