From: Jeff Layton <jlayton@redhat.com>
To: linux-cifs-client@lists.samba.org
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH 03/13] cifs: allow get_cifs_acl to be called without an inode
Date: Mon, 11 May 2009 16:24:22 -0400 [thread overview]
Message-ID: <1242073472-7100-4-git-send-email-jlayton@redhat.com> (raw)
In-Reply-To: <1242073472-7100-1-git-send-email-jlayton@redhat.com>
We'll need this later when we restructure cifs_get_inode_info.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
fs/cifs/cifsacl.c | 25 ++++++-------------------
1 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index 57ecdc8..82fc4a9 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -555,37 +555,24 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
/* Retrieve an ACL from the server */
static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode,
- const char *path, const __u16 *pfid)
+ const char *path, const __u16 *pfid)
{
struct cifsFileInfo *open_file = NULL;
- bool unlock_file = false;
int xid;
int rc = -EIO;
__u16 fid;
- struct super_block *sb;
- struct cifs_sb_info *cifs_sb;
struct cifs_ntsd *pntsd = NULL;
+ struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
cFYI(1, ("get mode from ACL for %s", path));
- if (inode == NULL)
- return NULL;
-
xid = GetXid();
- if (pfid == NULL)
- open_file = find_readable_file(CIFS_I(inode));
- else
+ if (pfid)
fid = *pfid;
-
- sb = inode->i_sb;
- if (sb == NULL) {
- FreeXid(xid);
- return NULL;
- }
- cifs_sb = CIFS_SB(sb);
+ else if (inode)
+ open_file = find_readable_file(CIFS_I(inode));
if (open_file) {
- unlock_file = true;
fid = open_file->netfid;
} else if (pfid == NULL) {
int oplock = 0;
@@ -603,7 +590,7 @@ static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode,
rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen);
cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen));
- if (unlock_file == true) /* find_readable_file increments ref count */
+ if (open_file) /* find_readable_file increments ref count */
atomic_dec(&open_file->wrtPending);
else if (pfid == NULL) /* if opened above we have to close the handle */
CIFSSMBClose(xid, cifs_sb->tcon, fid);
--
1.6.0.6
next prev parent reply other threads:[~2009-05-11 20:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-11 20:24 [PATCH 00/13] cifs: implement proper hardlink detection Jeff Layton
2009-05-11 20:24 ` [PATCH 01/13] cifs: have cifs_NTtimeToUnix take a little-endian arg Jeff Layton
2009-05-11 20:26 ` Christoph Hellwig
2009-05-11 20:24 ` [PATCH 02/13] cifs: make cnvrtDosUnixTm take a little-endian args and an offset Jeff Layton
2009-05-11 20:27 ` Christoph Hellwig
2009-05-11 20:24 ` Jeff Layton [this message]
2009-05-11 20:56 ` [PATCH 03/13] cifs: allow get_cifs_acl to be called without an inode Christoph Hellwig
2009-05-11 21:03 ` Jeff Layton
2009-05-13 9:09 ` Christoph Hellwig
2009-05-13 11:02 ` Jeff Layton
2009-05-11 20:24 ` [PATCH 04/13] cifs: rename cifs_iget to cifs_root_iget Jeff Layton
2009-05-11 20:24 ` [PATCH 05/13] cifs: add new cifs_fattr struct for holding cifs inode attributes in common way Jeff Layton
2009-05-11 21:01 ` Christoph Hellwig
2009-05-11 20:24 ` [PATCH 06/13] cifs: add new cifs_iget function and convert unix codepath to use it Jeff Layton
2009-05-11 21:06 ` Christoph Hellwig
2009-05-11 20:24 ` [PATCH 07/13] cifs: convert posix readdir codepath to use cifs_iget Jeff Layton
2009-05-11 20:24 ` [PATCH 08/13] cifs: convert cifs_get_inode_info " Jeff Layton
2009-05-11 20:24 ` [PATCH 09/13] cifs: convert non-posix readdir codepath " Jeff Layton
2009-05-11 20:24 ` [PATCH 10/13] cifs: remove cifs_new_inode Jeff Layton
2009-05-11 20:24 ` [PATCH 11/13] cifs: make serverino the default when mounting Jeff Layton
2009-05-11 20:24 ` [PATCH 12/13] cifs: remove cifsInodeInfo->inUse counter Jeff Layton
2009-05-11 20:24 ` [PATCH 13/13] cifs: remove "hardlink detection" from cifs_rename Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1242073472-7100-4-git-send-email-jlayton@redhat.com \
--to=jlayton@redhat.com \
--cc=linux-cifs-client@lists.samba.org \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).