#ifdef _LARGEFILE64_SOURCE
+#include <string.h>
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
err = -EBADF;
goto out;
}
+ /*
+ * Never use the attributes cached in the inode record. Give
+ * the driver a chance to refresh them.
+ */
err = fil->f_ino->i_ops.inop_getattr(NULL, fil->f_ino, __stat_buf);
out:
SYSIO_INTERFACE_RETURN(err ? -1 : 0, err);
struct intent intent;
int err;
struct pnode *pno;
+ struct inode *ino;
SYSIO_INTERFACE_DISPLAY_BLOCK;
SYSIO_INTERFACE_ENTER;
err = _sysio_namei(_sysio_cwd, __filename, 0, &intent, &pno);
if (err)
goto out;
- err =
- pno->p_base->pb_ino->i_ops.inop_getattr(pno,
- pno->p_base->pb_ino,
- __stat_buf);
+ /*
+ * Leverage the INT_GETATTR intent above. We are counting
+ * on the FS driver to either make sure the attributes cached in
+ * the inode are always correct or refresh them in the lookup, above.
+ */
+ ino = pno->p_base->pb_ino;
+ (void )memcpy(__stat_buf, &ino->i_stbuf, sizeof(struct intnl_stat));
P_RELE(pno);
out:
SYSIO_INTERFACE_RETURN(err ? -1 : 0, err);
struct intent intent;
int err;
struct pnode *pno;
+ struct inode *ino;
SYSIO_INTERFACE_DISPLAY_BLOCK;
SYSIO_INTERFACE_ENTER;
err = _sysio_namei(_sysio_cwd, __filename, ND_NOFOLLOW, &intent, &pno);
if (err)
goto out;
- err =
- pno->p_base->pb_ino->i_ops.inop_getattr(pno,
- pno->p_base->pb_ino,
- __stat_buf);
+ /*
+ * Leverage the INT_GETATTR intent above. We are counting
+ * on the FS driver to either make sure the attributes cached in
+ * the inode are always correct or refresh them in the lookup, above.
+ */
+ ino = pno->p_base->pb_ino;
+ (void )memcpy(__stat_buf, &ino->i_stbuf, sizeof(struct intnl_stat));
P_RELE(pno);
out:
SYSIO_INTERFACE_RETURN(err ? -1 : 0, err);