mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
fs/ntfs3: Code formatting
clang-format-15 was used to format code according kernel's .clang-format. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
f1d325b8c7
commit
f037776165
14 changed files with 92 additions and 83 deletions
|
@ -517,6 +517,9 @@ out:
|
||||||
*/
|
*/
|
||||||
static int ni_repack(struct ntfs_inode *ni)
|
static int ni_repack(struct ntfs_inode *ni)
|
||||||
{
|
{
|
||||||
|
#if 1
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
int err = 0;
|
int err = 0;
|
||||||
struct ntfs_sb_info *sbi = ni->mi.sbi;
|
struct ntfs_sb_info *sbi = ni->mi.sbi;
|
||||||
struct mft_inode *mi, *mi_p = NULL;
|
struct mft_inode *mi, *mi_p = NULL;
|
||||||
|
@ -639,6 +642,7 @@ static int ni_repack(struct ntfs_inode *ni)
|
||||||
|
|
||||||
run_close(&run);
|
run_close(&run);
|
||||||
return err;
|
return err;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1194,8 +1194,8 @@ out:
|
||||||
*
|
*
|
||||||
* NOTE: if fnd != NULL (ntfs_atomic_open) then @dir is locked
|
* NOTE: if fnd != NULL (ntfs_atomic_open) then @dir is locked
|
||||||
*/
|
*/
|
||||||
struct inode *ntfs_create_inode(struct mnt_idmap *idmap,
|
struct inode *ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
|
||||||
struct inode *dir, struct dentry *dentry,
|
struct dentry *dentry,
|
||||||
const struct cpu_str *uni, umode_t mode,
|
const struct cpu_str *uni, umode_t mode,
|
||||||
dev_t dev, const char *symname, u32 size,
|
dev_t dev, const char *symname, u32 size,
|
||||||
struct ntfs_fnd *fnd)
|
struct ntfs_fnd *fnd)
|
||||||
|
|
|
@ -109,8 +109,8 @@ static int ntfs_create(struct mnt_idmap *idmap, struct inode *dir,
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
||||||
inode = ntfs_create_inode(idmap, dir, dentry, NULL, S_IFREG | mode,
|
inode = ntfs_create_inode(idmap, dir, dentry, NULL, S_IFREG | mode, 0,
|
||||||
0, NULL, 0, NULL);
|
NULL, 0, NULL);
|
||||||
|
|
||||||
return IS_ERR(inode) ? PTR_ERR(inode) : 0;
|
return IS_ERR(inode) ? PTR_ERR(inode) : 0;
|
||||||
}
|
}
|
||||||
|
@ -125,8 +125,8 @@ static int ntfs_mknod(struct mnt_idmap *idmap, struct inode *dir,
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
||||||
inode = ntfs_create_inode(idmap, dir, dentry, NULL, mode, rdev,
|
inode = ntfs_create_inode(idmap, dir, dentry, NULL, mode, rdev, NULL, 0,
|
||||||
NULL, 0, NULL);
|
NULL);
|
||||||
|
|
||||||
return IS_ERR(inode) ? PTR_ERR(inode) : 0;
|
return IS_ERR(inode) ? PTR_ERR(inode) : 0;
|
||||||
}
|
}
|
||||||
|
@ -199,8 +199,8 @@ static int ntfs_symlink(struct mnt_idmap *idmap, struct inode *dir,
|
||||||
u32 size = strlen(symname);
|
u32 size = strlen(symname);
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
||||||
inode = ntfs_create_inode(idmap, dir, dentry, NULL, S_IFLNK | 0777,
|
inode = ntfs_create_inode(idmap, dir, dentry, NULL, S_IFLNK | 0777, 0,
|
||||||
0, symname, size, NULL);
|
symname, size, NULL);
|
||||||
|
|
||||||
return IS_ERR(inode) ? PTR_ERR(inode) : 0;
|
return IS_ERR(inode) ? PTR_ERR(inode) : 0;
|
||||||
}
|
}
|
||||||
|
@ -213,8 +213,8 @@ static int ntfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
||||||
inode = ntfs_create_inode(idmap, dir, dentry, NULL, S_IFDIR | mode,
|
inode = ntfs_create_inode(idmap, dir, dentry, NULL, S_IFDIR | mode, 0,
|
||||||
0, NULL, 0, NULL);
|
NULL, 0, NULL);
|
||||||
|
|
||||||
return IS_ERR(inode) ? PTR_ERR(inode) : 0;
|
return IS_ERR(inode) ? PTR_ERR(inode) : 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -708,8 +708,8 @@ int ntfs_sync_inode(struct inode *inode);
|
||||||
int ntfs_flush_inodes(struct super_block *sb, struct inode *i1,
|
int ntfs_flush_inodes(struct super_block *sb, struct inode *i1,
|
||||||
struct inode *i2);
|
struct inode *i2);
|
||||||
int inode_write_data(struct inode *inode, const void *data, size_t bytes);
|
int inode_write_data(struct inode *inode, const void *data, size_t bytes);
|
||||||
struct inode *ntfs_create_inode(struct mnt_idmap *idmap,
|
struct inode *ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
|
||||||
struct inode *dir, struct dentry *dentry,
|
struct dentry *dentry,
|
||||||
const struct cpu_str *uni, umode_t mode,
|
const struct cpu_str *uni, umode_t mode,
|
||||||
dev_t dev, const char *symname, u32 size,
|
dev_t dev, const char *symname, u32 size,
|
||||||
struct ntfs_fnd *fnd);
|
struct ntfs_fnd *fnd);
|
||||||
|
@ -858,8 +858,8 @@ unsigned long ntfs_names_hash(const u16 *name, size_t len, const u16 *upcase,
|
||||||
|
|
||||||
/* globals from xattr.c */
|
/* globals from xattr.c */
|
||||||
#ifdef CONFIG_NTFS3_FS_POSIX_ACL
|
#ifdef CONFIG_NTFS3_FS_POSIX_ACL
|
||||||
struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap,
|
struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry,
|
||||||
struct dentry *dentry, int type);
|
int type);
|
||||||
int ntfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
|
int ntfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
|
||||||
struct posix_acl *acl, int type);
|
struct posix_acl *acl, int type);
|
||||||
int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode,
|
int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode,
|
||||||
|
|
|
@ -257,6 +257,7 @@ enum Opt {
|
||||||
Opt_err,
|
Opt_err,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
static const struct fs_parameter_spec ntfs_fs_parameters[] = {
|
static const struct fs_parameter_spec ntfs_fs_parameters[] = {
|
||||||
fsparam_u32("uid", Opt_uid),
|
fsparam_u32("uid", Opt_uid),
|
||||||
fsparam_u32("gid", Opt_gid),
|
fsparam_u32("gid", Opt_gid),
|
||||||
|
@ -277,9 +278,13 @@ static const struct fs_parameter_spec ntfs_fs_parameters[] = {
|
||||||
fsparam_flag_no("nocase", Opt_nocase),
|
fsparam_flag_no("nocase", Opt_nocase),
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load nls table or if @nls is utf8 then return NULL.
|
* Load nls table or if @nls is utf8 then return NULL.
|
||||||
|
*
|
||||||
|
* It is good idea to use here "const char *nls".
|
||||||
|
* But load_nls accepts "char*".
|
||||||
*/
|
*/
|
||||||
static struct nls_table *ntfs_load_nls(char *nls)
|
static struct nls_table *ntfs_load_nls(char *nls)
|
||||||
{
|
{
|
||||||
|
@ -1537,12 +1542,14 @@ static void ntfs_fs_free(struct fs_context *fc)
|
||||||
put_mount_options(opts);
|
put_mount_options(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
static const struct fs_context_operations ntfs_context_ops = {
|
static const struct fs_context_operations ntfs_context_ops = {
|
||||||
.parse_param = ntfs_fs_parse_param,
|
.parse_param = ntfs_fs_parse_param,
|
||||||
.get_tree = ntfs_fs_get_tree,
|
.get_tree = ntfs_fs_get_tree,
|
||||||
.reconfigure = ntfs_fs_reconfigure,
|
.reconfigure = ntfs_fs_reconfigure,
|
||||||
.free = ntfs_fs_free,
|
.free = ntfs_fs_free,
|
||||||
};
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ntfs_init_fs_context - Initialize sbi and opts
|
* ntfs_init_fs_context - Initialize sbi and opts
|
||||||
|
|
|
@ -528,8 +528,8 @@ out:
|
||||||
/*
|
/*
|
||||||
* ntfs_get_acl - inode_operations::get_acl
|
* ntfs_get_acl - inode_operations::get_acl
|
||||||
*/
|
*/
|
||||||
struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap,
|
struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry,
|
||||||
struct dentry *dentry, int type)
|
int type)
|
||||||
{
|
{
|
||||||
struct inode *inode = d_inode(dentry);
|
struct inode *inode = d_inode(dentry);
|
||||||
struct ntfs_inode *ni = ntfs_i(inode);
|
struct ntfs_inode *ni = ntfs_i(inode);
|
||||||
|
@ -596,8 +596,7 @@ static noinline int ntfs_set_acl_ex(struct mnt_idmap *idmap,
|
||||||
case ACL_TYPE_ACCESS:
|
case ACL_TYPE_ACCESS:
|
||||||
/* Do not change i_mode if we are in init_acl */
|
/* Do not change i_mode if we are in init_acl */
|
||||||
if (acl && !init_acl) {
|
if (acl && !init_acl) {
|
||||||
err = posix_acl_update_mode(idmap, inode, &mode,
|
err = posix_acl_update_mode(idmap, inode, &mode, &acl);
|
||||||
&acl);
|
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -820,10 +819,9 @@ out:
|
||||||
* ntfs_setxattr - inode_operations::setxattr
|
* ntfs_setxattr - inode_operations::setxattr
|
||||||
*/
|
*/
|
||||||
static noinline int ntfs_setxattr(const struct xattr_handler *handler,
|
static noinline int ntfs_setxattr(const struct xattr_handler *handler,
|
||||||
struct mnt_idmap *idmap,
|
struct mnt_idmap *idmap, struct dentry *de,
|
||||||
struct dentry *de, struct inode *inode,
|
struct inode *inode, const char *name,
|
||||||
const char *name, const void *value,
|
const void *value, size_t size, int flags)
|
||||||
size_t size, int flags)
|
|
||||||
{
|
{
|
||||||
int err = -EINVAL;
|
int err = -EINVAL;
|
||||||
struct ntfs_inode *ni = ntfs_i(inode);
|
struct ntfs_inode *ni = ntfs_i(inode);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue