stavo proprio guardo i sorgenti (da bravo scemo non ci avevo pensato) anche se la conoscenza del C è inferiore a quella dell'inglese
ma in fs/inode.c vedo che
Codice: Seleziona tutto
/*
* With relative atime, only update atime if the previous atime is
* earlier than either the ctime or mtime or if at least a day has
* passed since the last atime update.
*/
static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
struct timespec now)
{
if (!(mnt->mnt_flags & MNT_RELATIME))
return 1;
/*
* Is mtime younger than atime? If yes, update atime:
*/
if (timespec_compare(&inode->i_mtime, &inode->i_atime) >= 0)
return 1;
/*
* Is ctime younger than atime? If yes, update atime:
*/
if (timespec_compare(&inode->i_ctime, &inode->i_atime) >= 0)
return 1;
/*
* Is the previous atime value older than a day? If yes,
* update atime:
*/
if ((long)(now.tv_sec - inode->i_atime.tv_sec) >= 24*60*60)
return 1;
/*
* Good, we can skip the atime update:
*/
return 0;
}
/**
* touch_atime - update the access time
* @mnt: mount the inode is accessed on
* @dentry: dentry accessed
*
* Update the accessed time on an inode and mark it for writeback.
* This function automatically handles read only file systems and media,
* as well as the "noatime" flag and inode specific "noatime" markers.
*/
void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
{
struct inode *inode = dentry->d_inode;
struct timespec now;
if (mnt_want_write(mnt))
return;
if (inode->i_flags & S_NOATIME)
goto out;
if (IS_NOATIME(inode))
goto out;
if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
goto out;
if (mnt->mnt_flags & MNT_NOATIME)
goto out;
if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
goto out;
now = current_fs_time(inode->i_sb);
if (!relatime_need_update(mnt, inode, now))
goto out;
if (timespec_equal(&inode->i_atime, &now))
goto out;
inode->i_atime = now;
mark_inode_dirty_sync(inode);
out:
mnt_drop_write(mnt);
}
EXPORT_SYMBOL(touch_atime);
da quel poco che capisco se c'è NOATIME salta a "out" senza aggiornare l'inode atime, con RELATIME, quella che utilizzo io dove ho i dati da far leggere a mutt, verifica la data di mtime e ctime
sempre se ho capito bene che questa funzione è richiamata dai vari filesystem (se hanno la funzione di settare S_NOATIME)
p.s.
posso aver scritto bischerate, ne sono consapevole, ma è per capire meglio