Commit b81209de authored by Suresh Jayaraman's avatar Suresh Jayaraman Committed by Steve French

cifs: enable fscache iff fsc mount option is used explicitly

Currently, if CONFIG_CIFS_FSCACHE is set, fscache is enabled on files opened
as read-only irrespective of the 'fsc' mount option. Fix this by enabling
fscache only if 'fsc' mount option is specified explicitly.

Remove an extraneous cFYI debug message and fix a typo while at it.
Reported-by: default avatarJeff Layton <jlayton@redhat.com>
Acked-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSuresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 607a569d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* fs/cifs/fscache.c - CIFS filesystem cache interface * fs/cifs/fscache.c - CIFS filesystem cache interface
* *
* Copyright (c) 2010 Novell, Inc. * Copyright (c) 2010 Novell, Inc.
* Author(s): Suresh Jayaraman (sjayaraman@suse.de> * Author(s): Suresh Jayaraman <sjayaraman@suse.de>
* *
* This library is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published * it under the terms of the GNU Lesser General Public License as published
...@@ -67,10 +67,12 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode) ...@@ -67,10 +67,12 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode)
if (cifsi->fscache) if (cifsi->fscache)
return; return;
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) {
cifsi->fscache = fscache_acquire_cookie(tcon->fscache, cifsi->fscache = fscache_acquire_cookie(tcon->fscache,
&cifs_fscache_inode_object_def, cifsi); &cifs_fscache_inode_object_def, cifsi);
cFYI(1, "CIFS: got FH cookie (0x%p/0x%p)", tcon->fscache, cFYI(1, "CIFS: got FH cookie (0x%p/0x%p)", tcon->fscache,
cifsi->fscache); cifsi->fscache);
}
} }
void cifs_fscache_release_inode_cookie(struct inode *inode) void cifs_fscache_release_inode_cookie(struct inode *inode)
...@@ -101,10 +103,8 @@ void cifs_fscache_set_inode_cookie(struct inode *inode, struct file *filp) ...@@ -101,10 +103,8 @@ void cifs_fscache_set_inode_cookie(struct inode *inode, struct file *filp)
{ {
if ((filp->f_flags & O_ACCMODE) != O_RDONLY) if ((filp->f_flags & O_ACCMODE) != O_RDONLY)
cifs_fscache_disable_inode_cookie(inode); cifs_fscache_disable_inode_cookie(inode);
else { else
cifs_fscache_enable_inode_cookie(inode); cifs_fscache_enable_inode_cookie(inode);
cFYI(1, "CIFS: fscache inode cookie set");
}
} }
void cifs_fscache_reset_inode_cookie(struct inode *inode) void cifs_fscache_reset_inode_cookie(struct inode *inode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment