Hi Quang,
On Thu, Dec 06, 2001 at 05:18:24PM -0800, Quang Nguyen (Ngo) wrote:
> Does anyone have an answer to this question? ;-)
Yep.
>
> Thanks,
> Quang
>
> -----Original Message-----
> From: Quang Nguyen (Ngo)
> To: 'linux-xfs@xxxxxxxxxxx'
> Sent: 12/6/01 11:21 AM
> Subject: attr_set() Changes ctime
>
> How do I prevent attr_set() from changing the ctime?
> I have a feeling that the answer is "you can't".
Yep, you can't.
The relevant code in xfs_attr_set() is:
if (!error && (flags & ATTR_KERNOTIME) == 0) {
xfs_ichgtime(dp, XFS_ICHGTIME_CHG);
}
So one would need ATTR_KERNNOTIME set on the flags for the setting
of the attribute.
This is done by the dmapi code in the kernel.
HOWEVER, it can't be done in userspace as we test to make sure
that only valid flags are possibly set:
i.e ATTR_ROOT, ATTR_DONTFOLLOW, and for set op: ATTR_CREATE, ATTR_REPLACE
linvfs_attrctl():
...
int flags = ops[i].flags;
/* common flags */
flags &= ~(ATTR_ROOT | ATTR_DONTFOLLOW);
/* command specific */
if (ops[i].opcode == ATTR_OP_SET)
flags &= ~(ATTR_CREATE | ATTR_REPLACE);
if (flags != 0x0)
return -EINVAL;
> utime() allows to change mtime and atime of a file.
> Is there a function to change the ctime especially for XFS?
Not that I know of ??
--Tim
|