From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeffm@suse.com Subject: [patch 18/40] reiserfs: use better open options for internal files Date: Mon, 11 Jun 2007 15:03:27 -0400 Message-ID: <20070611190631.312573974@suse.com> References: <20070611190309.532091171@suse.com> Return-path: Content-Disposition: inline; filename=reiserfs-xattrs-noatime.diff Sender: reiserfs-devel-owner@vger.kernel.org List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ReiserFS Mailing List 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. Signed-off-by: Jeff Mahoney -- fs/reiserfs/xattr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/fs/reiserfs/xattr.c 2007-06-11 14:49:37.000000000 -0400 +++ b/fs/reiserfs/xattr.c 2007-06-11 14:50:06.000000000 -0400 @@ -188,7 +188,7 @@ out: dput(xadir); if (err) return ERR_PTR(err); - return dentry_open(xafile, NULL, O_RDWR); + return dentry_open(xafile, NULL, O_RDWR|O_NOATIME); } /* @@ -691,7 +691,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 */ @@ -780,7 +780,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 */ -- Jeff Mahoney SUSE Labs