@@ -884,9 +884,9 @@ typedef struct xfs_dinode {
__be64 di_flags2; /* more random flags */
__be32 di_cowextsize; /* basic cow extent size for file */
__u8 di_pad2[12]; /* more padding for future expansion */
+ xfs_timestamp_t di_crtime; /* time created */
/* fields only written to during inode creation */
- xfs_timestamp_t di_crtime; /* time created */
__be64 di_ino; /* inode number */
uuid_t di_uuid; /* UUID of the filesystem */
@@ -415,9 +415,9 @@ struct xfs_log_dinode {
uint64_t di_flags2; /* more random flags */
uint32_t di_cowextsize; /* basic cow extent size for file */
uint8_t di_pad2[12]; /* more padding for future expansion */
+ xfs_ictimestamp_t di_crtime; /* time created */
/* fields only written to during inode creation */
- xfs_ictimestamp_t di_crtime; /* time created */
xfs_ino_t di_ino; /* inode number */
uuid_t di_uuid; /* UUID of the filesystem */
@@ -582,6 +582,10 @@ xfs_setattr_time(
inode->i_ctime = iattr->ia_ctime;
if (iattr->ia_valid & ATTR_MTIME)
inode->i_mtime = iattr->ia_mtime;
+ if (iattr->ia_valid & ATTR_BTIME) {
+ ip->i_d.di_crtime.t_sec = iattr->ia_btime.tv_sec;
+ ip->i_d.di_crtime.t_nsec = iattr->ia_btime.tv_nsec;
+ }
}
static int
@@ -1025,11 +1029,14 @@ xfs_vn_setattr(
struct dentry *dentry,
struct iattr *iattr)
{
+ struct inode *inode = d_inode(dentry);
+ struct xfs_inode *ip = XFS_I(inode);
int error;
+ if ((iattr->ia_valid & ATTR_BTIME) && ip->i_d.di_version != 3)
+ return -EOPNOTSUPP;
+
if (iattr->ia_valid & ATTR_SIZE) {
- struct inode *inode = d_inode(dentry);
- struct xfs_inode *ip = XFS_I(inode);
uint iolock;
xfs_ilock(ip, XFS_MMAPLOCK_EXCL);
@@ -1860,7 +1860,7 @@ static struct file_system_type xfs_fs_type = {
.name = "xfs",
.mount = xfs_fs_mount,
.kill_sb = kill_block_super,
- .fs_flags = FS_REQUIRES_DEV,
+ .fs_flags = FS_REQUIRES_DEV | FS_HAS_BTIME,
};
MODULE_ALIAS_FS("xfs");