[PATCH 07/11 reiserfs: use better open options for internal files
The generic read path will mark the file's atime during the course of the read. For xattr backing files, this behavior is undesirable, so we open the xattr files and directories with O_NOATIME. We also add the O_DIRECTORY flag where the xattr dir is opened for readdir.
fs/reiserfs/xattr.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
Signed-off-by Jeff Mahoney <[email protected]>
fs/reiserfs/xattr.c +3 -3
@@ -222,7 +222,7 @@ static struct file *open_xattr_file(strudput (xadir); -return dentry_open (xafile,NULL ,O_RDWR ); +return dentry_open (xafile,NULL ,O_RDWR |O_NOATIME ); out_err:dput (xafile);
@@ -661,7 +661,7 @@ int reiserfs_delete_xattrs(struct inode goto out; } - fp =dentry_open (dir,NULL ,O_RDWR ); + fp =dentry_open (dir,NULL ,O_RDWR |O_NOATIME |O_DIRECTORY );if (IS_ERR (fp)) { err =PTR_ERR (fp);/* dentry_open dputs the dentry if it fails */
@@ -755,7 +755,7 @@ int reiserfs_chown_xattrs(struct inode * goto out; } - fp =dentry_open (dir,NULL ,O_RDWR ); + fp =dentry_open (dir,NULL ,O_RDWR |O_NOATIME |O_DIRECTORY );if (IS_ERR (fp)) { err =PTR_ERR (fp);/* dentry_open dputs the dentry if it fails */