Skip to content

Commit 6e195b0

Browse files
committed
9p: fix a bunch of checkpatch warnings
Sohaib Mohamed started a serie of tiny and incomplete checkpatch fixes but seemingly stopped halfway -- take over and do most of it. This is still missing net/9p/trans* and net/9p/protocol.c for a later time... Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Dominique Martinet <[email protected]>
1 parent b1843d2 commit 6e195b0

21 files changed

+323
-305
lines changed

fs/9p/acl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ static int v9fs_set_acl(struct p9_fid *fid, int type, struct posix_acl *acl)
115115
char *name;
116116
size_t size;
117117
void *buffer;
118+
118119
if (!acl)
119120
return 0;
120121

fs/9p/acl.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
#define FS_9P_ACL_H
88

99
#ifdef CONFIG_9P_FS_POSIX_ACL
10-
extern int v9fs_get_acl(struct inode *, struct p9_fid *);
11-
extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type, bool rcu);
12-
extern int v9fs_acl_chmod(struct inode *, struct p9_fid *);
13-
extern int v9fs_set_create_acl(struct inode *, struct p9_fid *,
14-
struct posix_acl *, struct posix_acl *);
15-
extern int v9fs_acl_mode(struct inode *dir, umode_t *modep,
16-
struct posix_acl **dpacl, struct posix_acl **pacl);
17-
extern void v9fs_put_acl(struct posix_acl *dacl, struct posix_acl *acl);
10+
int v9fs_get_acl(struct inode *inode, struct p9_fid *fid);
11+
struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type,
12+
bool rcu);
13+
int v9fs_acl_chmod(struct inode *inode, struct p9_fid *fid);
14+
int v9fs_set_create_acl(struct inode *inode, struct p9_fid *fid,
15+
struct posix_acl *dacl, struct posix_acl *acl);
16+
int v9fs_acl_mode(struct inode *dir, umode_t *modep,
17+
struct posix_acl **dpacl, struct posix_acl **pacl);
18+
void v9fs_put_acl(struct posix_acl *dacl, struct posix_acl *acl);
1819
#else
1920
#define v9fs_iop_get_acl NULL
2021
static inline int v9fs_get_acl(struct inode *inode, struct p9_fid *fid)

fs/9p/cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#define CACHETAG_LEN 11
2020

2121
struct fscache_netfs v9fs_cache_netfs = {
22-
.name = "9p",
23-
.version = 0,
22+
.name = "9p",
23+
.version = 0,
2424
};
2525

2626
/*

fs/9p/v9fs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,10 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
188188

189189
while ((p = strsep(&options, ",")) != NULL) {
190190
int token, r;
191+
191192
if (!*p)
192193
continue;
194+
193195
token = match_token(p, tokens, args);
194196
switch (token) {
195197
case Opt_debug:
@@ -659,6 +661,7 @@ static void v9fs_destroy_inode_cache(void)
659661
static int v9fs_cache_register(void)
660662
{
661663
int ret;
664+
662665
ret = v9fs_init_inode_cache();
663666
if (ret < 0)
664667
return ret;
@@ -686,6 +689,7 @@ static void v9fs_cache_unregister(void)
686689
static int __init init_v9fs(void)
687690
{
688691
int err;
692+
689693
pr_info("Installing v9fs 9p2000 file system support\n");
690694
/* TODO: Setup list of registered trasnport modules */
691695

fs/9p/v9fs_vfs.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ extern struct kmem_cache *v9fs_inode_cache;
4444

4545
struct inode *v9fs_alloc_inode(struct super_block *sb);
4646
void v9fs_free_inode(struct inode *inode);
47-
struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t);
47+
struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode,
48+
dev_t rdev);
4849
int v9fs_init_inode(struct v9fs_session_info *v9ses,
49-
struct inode *inode, umode_t mode, dev_t);
50+
struct inode *inode, umode_t mode, dev_t rdev);
5051
void v9fs_evict_inode(struct inode *inode);
5152
ino_t v9fs_qid2ino(struct p9_qid *qid);
5253
void v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode,
@@ -59,18 +60,18 @@ void v9fs_inode2stat(struct inode *inode, struct p9_wstat *stat);
5960
int v9fs_uflags2omode(int uflags, int extended);
6061

6162
void v9fs_blank_wstat(struct p9_wstat *wstat);
62-
int v9fs_vfs_setattr_dotl(struct user_namespace *, struct dentry *,
63-
struct iattr *);
63+
int v9fs_vfs_setattr_dotl(struct user_namespace *mnt_userns,
64+
struct dentry *dentry, struct iattr *iattr);
6465
int v9fs_file_fsync_dotl(struct file *filp, loff_t start, loff_t end,
6566
int datasync);
6667
int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode);
6768
int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode);
6869
static inline void v9fs_invalidate_inode_attr(struct inode *inode)
6970
{
7071
struct v9fs_inode *v9inode;
72+
7173
v9inode = V9FS_I(inode);
7274
v9inode->cache_validity |= V9FS_INO_INVALID_ATTR;
73-
return;
7475
}
7576

7677
int v9fs_open_to_dotl_flags(int flags);

fs/9p/vfs_addr.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,13 @@ v9fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
247247
loff_t pos = iocb->ki_pos;
248248
ssize_t n;
249249
int err = 0;
250+
250251
if (iov_iter_rw(iter) == WRITE) {
251252
n = p9_client_write(file->private_data, pos, iter, &err);
252253
if (n) {
253254
struct inode *inode = file_inode(file);
254255
loff_t i_size = i_size_read(inode);
256+
255257
if (pos + n > i_size)
256258
inode_add_bytes(inode, pos + n - i_size);
257259
}
@@ -262,7 +264,7 @@ v9fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
262264
}
263265

264266
static int v9fs_write_begin(struct file *filp, struct address_space *mapping,
265-
loff_t pos, unsigned len, unsigned flags,
267+
loff_t pos, unsigned int len, unsigned int flags,
266268
struct page **pagep, void **fsdata)
267269
{
268270
int retval;
@@ -287,7 +289,7 @@ static int v9fs_write_begin(struct file *filp, struct address_space *mapping,
287289
}
288290

289291
static int v9fs_write_end(struct file *filp, struct address_space *mapping,
290-
loff_t pos, unsigned len, unsigned copied,
292+
loff_t pos, unsigned int len, unsigned int copied,
291293
struct page *page, void *fsdata)
292294
{
293295
loff_t last_pos = pos + copied;

fs/9p/vfs_dentry.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ static int v9fs_cached_dentry_delete(const struct dentry *dentry)
5050
static void v9fs_dentry_release(struct dentry *dentry)
5151
{
5252
struct hlist_node *p, *n;
53+
5354
p9_debug(P9_DEBUG_VFS, " dentry: %pd (%p)\n",
5455
dentry, dentry);
5556
hlist_for_each_safe(p, n, (struct hlist_head *)&dentry->d_fsdata)
@@ -74,6 +75,7 @@ static int v9fs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
7475
if (v9inode->cache_validity & V9FS_INO_INVALID_ATTR) {
7576
int retval;
7677
struct v9fs_session_info *v9ses;
78+
7779
fid = v9fs_fid_lookup(dentry);
7880
if (IS_ERR(fid))
7981
return PTR_ERR(fid);

fs/9p/vfs_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ v9fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
406406
struct inode *inode = file_inode(file);
407407
loff_t i_size;
408408
unsigned long pg_start, pg_end;
409+
409410
pg_start = origin >> PAGE_SHIFT;
410411
pg_end = (origin + retval - 1) >> PAGE_SHIFT;
411412
if (inode->i_mapping && inode->i_mapping->nrpages)

fs/9p/vfs_inode.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static const struct inode_operations v9fs_symlink_inode_operations;
4747
static u32 unixmode2p9mode(struct v9fs_session_info *v9ses, umode_t mode)
4848
{
4949
int res;
50+
5051
res = mode & 0777;
5152
if (S_ISDIR(mode))
5253
res |= P9_DMDIR;
@@ -226,6 +227,7 @@ v9fs_blank_wstat(struct p9_wstat *wstat)
226227
struct inode *v9fs_alloc_inode(struct super_block *sb)
227228
{
228229
struct v9fs_inode *v9inode;
230+
229231
v9inode = kmem_cache_alloc(v9fs_inode_cache, GFP_KERNEL);
230232
if (!v9inode)
231233
return NULL;
@@ -254,7 +256,7 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses,
254256
{
255257
int err = 0;
256258

257-
inode_init_owner(&init_user_ns,inode, NULL, mode);
259+
inode_init_owner(&init_user_ns, inode, NULL, mode);
258260
inode->i_blocks = 0;
259261
inode->i_rdev = rdev;
260262
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
@@ -443,7 +445,7 @@ static struct inode *v9fs_qid_iget(struct super_block *sb,
443445
unsigned long i_ino;
444446
struct inode *inode;
445447
struct v9fs_session_info *v9ses = sb->s_fs_info;
446-
int (*test)(struct inode *, void *);
448+
int (*test)(struct inode *inode, void *data);
447449

448450
if (new)
449451
test = v9fs_test_new_inode;
@@ -502,8 +504,10 @@ v9fs_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid,
502504
static int v9fs_at_to_dotl_flags(int flags)
503505
{
504506
int rflags = 0;
507+
505508
if (flags & AT_REMOVEDIR)
506509
rflags |= P9_DOTL_AT_REMOVEDIR;
510+
507511
return rflags;
508512
}
509513

@@ -800,7 +804,7 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
800804

801805
static int
802806
v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
803-
struct file *file, unsigned flags, umode_t mode)
807+
struct file *file, unsigned int flags, umode_t mode)
804808
{
805809
int err;
806810
u32 perm;
@@ -1087,7 +1091,7 @@ static int v9fs_vfs_setattr(struct user_namespace *mnt_userns,
10871091
fid = v9fs_fid_lookup(dentry);
10881092
use_dentry = 1;
10891093
}
1090-
if(IS_ERR(fid))
1094+
if (IS_ERR(fid))
10911095
return PTR_ERR(fid);
10921096

10931097
v9fs_blank_wstat(&wstat);
@@ -1367,7 +1371,7 @@ v9fs_vfs_mknod(struct user_namespace *mnt_userns, struct inode *dir,
13671371
char name[2 + U32_MAX_DIGITS + 1 + U32_MAX_DIGITS + 1];
13681372
u32 perm;
13691373

1370-
p9_debug(P9_DEBUG_VFS, " %lu,%pd mode: %hx MAJOR: %u MINOR: %u\n",
1374+
p9_debug(P9_DEBUG_VFS, " %lu,%pd mode: %x MAJOR: %u MINOR: %u\n",
13711375
dir->i_ino, dentry, mode,
13721376
MAJOR(rdev), MINOR(rdev));
13731377

fs/9p/vfs_inode_dotl.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static struct inode *v9fs_qid_iget_dotl(struct super_block *sb,
105105
unsigned long i_ino;
106106
struct inode *inode;
107107
struct v9fs_session_info *v9ses = sb->s_fs_info;
108-
int (*test)(struct inode *, void *);
108+
int (*test)(struct inode *inode, void *data);
109109

110110
if (new)
111111
test = v9fs_test_new_inode_dotl;
@@ -228,7 +228,7 @@ v9fs_vfs_create_dotl(struct user_namespace *mnt_userns, struct inode *dir,
228228

229229
static int
230230
v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
231-
struct file *file, unsigned flags, umode_t omode)
231+
struct file *file, unsigned int flags, umode_t omode)
232232
{
233233
int err = 0;
234234
kgid_t gid;
@@ -259,7 +259,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
259259
v9ses = v9fs_inode2v9ses(dir);
260260

261261
name = dentry->d_name.name;
262-
p9_debug(P9_DEBUG_VFS, "name:%s flags:0x%x mode:0x%hx\n",
262+
p9_debug(P9_DEBUG_VFS, "name:%s flags:0x%x mode:0x%x\n",
263263
name, flags, omode);
264264

265265
dfid = v9fs_parent_fid(dentry);
@@ -805,6 +805,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
805805
if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
806806
/* Get the latest stat info from server. */
807807
struct p9_fid *fid;
808+
808809
fid = v9fs_fid_lookup(old_dentry);
809810
if (IS_ERR(fid))
810811
return PTR_ERR(fid);
@@ -841,7 +842,7 @@ v9fs_vfs_mknod_dotl(struct user_namespace *mnt_userns, struct inode *dir,
841842
struct p9_qid qid;
842843
struct posix_acl *dacl = NULL, *pacl = NULL;
843844

844-
p9_debug(P9_DEBUG_VFS, " %lu,%pd mode: %hx MAJOR: %u MINOR: %u\n",
845+
p9_debug(P9_DEBUG_VFS, " %lu,%pd mode: %x MAJOR: %u MINOR: %u\n",
845846
dir->i_ino, dentry, omode,
846847
MAJOR(rdev), MINOR(rdev));
847848

0 commit comments

Comments
 (0)