Skip to contentSkip to conversation

[PATCH 07/11 reiserfs: use better open options for internal files

PATCH Jeff Mahoney 1 participant 1 message Feb 20, 2006

lore
Share & tools
lore
#0 lore raw

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(-)
fs/reiserfs/xattr.c +3 -3
diff -ruNpX ../dontdiff linux-2.6.15-staging1/fs/reiserfs/xattr.c linux-2.6.15-staging2/fs/reiserfs/xattr.c
@@ -222,7 +222,7 @@ static struct file *open_xattr_file(stru
 
 	dput(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 */