@@ -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);
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(-)