cifsd: fix WARNING: Too many leading tabs
WARNING: Too many leading tabs - consider code refactoring 3066: FILE: fs/cifsd/smb2pdu.c:2733: + if (fattr.cf_dacls) Fix a warning from checkpatch.pl. Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
Родитель
63c454f839
Коммит
3d47e54623
|
@ -2250,6 +2250,19 @@ static int smb2_create_sd_buffer(struct ksmbd_work *work,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void ksmbd_acls_fattr(struct smb_fattr *fattr, struct inode *inode)
|
||||||
|
{
|
||||||
|
fattr->cf_uid = inode->i_uid;
|
||||||
|
fattr->cf_gid = inode->i_gid;
|
||||||
|
fattr->cf_mode = inode->i_mode;
|
||||||
|
fattr->cf_dacls = NULL;
|
||||||
|
|
||||||
|
fattr->cf_acls = ksmbd_vfs_get_acl(inode, ACL_TYPE_ACCESS);
|
||||||
|
if (S_ISDIR(inode->i_mode))
|
||||||
|
fattr->cf_dacls = ksmbd_vfs_get_acl(inode, ACL_TYPE_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* smb2_open() - handler for smb file open request
|
* smb2_open() - handler for smb file open request
|
||||||
* @work: smb work containing request buffer
|
* @work: smb work containing request buffer
|
||||||
|
@ -2734,23 +2747,13 @@ int smb2_open(struct ksmbd_work *work)
|
||||||
KSMBD_SHARE_FLAG_ACL_XATTR)) {
|
KSMBD_SHARE_FLAG_ACL_XATTR)) {
|
||||||
struct smb_fattr fattr;
|
struct smb_fattr fattr;
|
||||||
struct smb_ntsd *pntsd;
|
struct smb_ntsd *pntsd;
|
||||||
int pntsd_size, ace_num;
|
int pntsd_size, ace_num = 0;
|
||||||
|
|
||||||
fattr.cf_uid = inode->i_uid;
|
ksmbd_acls_fattr(&fattr, inode);
|
||||||
fattr.cf_gid = inode->i_gid;
|
|
||||||
fattr.cf_mode = inode->i_mode;
|
|
||||||
fattr.cf_dacls = NULL;
|
|
||||||
ace_num = 0;
|
|
||||||
|
|
||||||
fattr.cf_acls = ksmbd_vfs_get_acl(inode, ACL_TYPE_ACCESS);
|
|
||||||
if (fattr.cf_acls)
|
if (fattr.cf_acls)
|
||||||
ace_num = fattr.cf_acls->a_count;
|
ace_num = fattr.cf_acls->a_count;
|
||||||
if (S_ISDIR(inode->i_mode)) {
|
|
||||||
fattr.cf_dacls =
|
|
||||||
ksmbd_vfs_get_acl(inode, ACL_TYPE_DEFAULT);
|
|
||||||
if (fattr.cf_dacls)
|
if (fattr.cf_dacls)
|
||||||
ace_num += fattr.cf_dacls->a_count;
|
ace_num += fattr.cf_dacls->a_count;
|
||||||
}
|
|
||||||
|
|
||||||
pntsd = kmalloc(sizeof(struct smb_ntsd) +
|
pntsd = kmalloc(sizeof(struct smb_ntsd) +
|
||||||
sizeof(struct smb_sid) * 3 +
|
sizeof(struct smb_sid) * 3 +
|
||||||
|
@ -2768,6 +2771,7 @@ int smb2_open(struct ksmbd_work *work)
|
||||||
|
|
||||||
rc = ksmbd_vfs_set_sd_xattr(conn,
|
rc = ksmbd_vfs_set_sd_xattr(conn,
|
||||||
path.dentry, pntsd, pntsd_size);
|
path.dentry, pntsd, pntsd_size);
|
||||||
|
kfree(pntsd);
|
||||||
if (rc)
|
if (rc)
|
||||||
ksmbd_err("failed to store ntacl in xattr : %d\n",
|
ksmbd_err("failed to store ntacl in xattr : %d\n",
|
||||||
rc);
|
rc);
|
||||||
|
@ -4847,14 +4851,7 @@ static int smb2_get_info_sec(struct ksmbd_work *work,
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
inode = FP_INODE(fp);
|
inode = FP_INODE(fp);
|
||||||
fattr.cf_uid = inode->i_uid;
|
ksmbd_acls_fattr(&fattr, inode);
|
||||||
fattr.cf_gid = inode->i_gid;
|
|
||||||
fattr.cf_mode = inode->i_mode;
|
|
||||||
fattr.cf_dacls = NULL;
|
|
||||||
|
|
||||||
fattr.cf_acls = ksmbd_vfs_get_acl(inode, ACL_TYPE_ACCESS);
|
|
||||||
if (S_ISDIR(inode->i_mode))
|
|
||||||
fattr.cf_dacls = ksmbd_vfs_get_acl(inode, ACL_TYPE_DEFAULT);
|
|
||||||
|
|
||||||
if (test_share_config_flag(work->tcon->share_conf,
|
if (test_share_config_flag(work->tcon->share_conf,
|
||||||
KSMBD_SHARE_FLAG_ACL_XATTR))
|
KSMBD_SHARE_FLAG_ACL_XATTR))
|
||||||
|
|
Загрузка…
Ссылка в новой задаче