diff options
author | Chengguang Xu <cgxu519@icloud.com> | 2018-02-28 06:43:47 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2018-04-02 04:12:47 -0400 |
commit | 73737682e0598ae73bd4c481e478a0d75884aa8a (patch) | |
tree | 938552dc32bbe1d6bd639d40f10e919c7c7d4a2a /fs/ceph/file.c | |
parent | 79cd674aed7363a043222af3c8f97d0ea0a078cf (diff) |
ceph: change variable name to follow common rule
Variable name ci is mostly used for ceph_inode_info.
Variable name fi is mostly used for ceph_file_info.
Variable name cf is mostly used for ceph_cap_flush.
Change variable name to follow above common rules
in case of confusing.
Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r-- | fs/ceph/file.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index c80eb1d93b41..df9f435c5260 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -165,7 +165,7 @@ out: | |||
165 | */ | 165 | */ |
166 | static int ceph_init_file(struct inode *inode, struct file *file, int fmode) | 166 | static int ceph_init_file(struct inode *inode, struct file *file, int fmode) |
167 | { | 167 | { |
168 | struct ceph_file_info *cf; | 168 | struct ceph_file_info *fi; |
169 | int ret = 0; | 169 | int ret = 0; |
170 | 170 | ||
171 | switch (inode->i_mode & S_IFMT) { | 171 | switch (inode->i_mode & S_IFMT) { |
@@ -175,19 +175,19 @@ static int ceph_init_file(struct inode *inode, struct file *file, int fmode) | |||
175 | case S_IFDIR: | 175 | case S_IFDIR: |
176 | dout("init_file %p %p 0%o (regular)\n", inode, file, | 176 | dout("init_file %p %p 0%o (regular)\n", inode, file, |
177 | inode->i_mode); | 177 | inode->i_mode); |
178 | cf = kmem_cache_zalloc(ceph_file_cachep, GFP_KERNEL); | 178 | fi = kmem_cache_zalloc(ceph_file_cachep, GFP_KERNEL); |
179 | if (!cf) { | 179 | if (!fi) { |
180 | ceph_put_fmode(ceph_inode(inode), fmode); /* clean up */ | 180 | ceph_put_fmode(ceph_inode(inode), fmode); /* clean up */ |
181 | return -ENOMEM; | 181 | return -ENOMEM; |
182 | } | 182 | } |
183 | cf->fmode = fmode; | 183 | fi->fmode = fmode; |
184 | 184 | ||
185 | spin_lock_init(&cf->rw_contexts_lock); | 185 | spin_lock_init(&fi->rw_contexts_lock); |
186 | INIT_LIST_HEAD(&cf->rw_contexts); | 186 | INIT_LIST_HEAD(&fi->rw_contexts); |
187 | 187 | ||
188 | cf->next_offset = 2; | 188 | fi->next_offset = 2; |
189 | cf->readdir_cache_idx = -1; | 189 | fi->readdir_cache_idx = -1; |
190 | file->private_data = cf; | 190 | file->private_data = fi; |
191 | BUG_ON(inode->i_fop->release != ceph_release); | 191 | BUG_ON(inode->i_fop->release != ceph_release); |
192 | break; | 192 | break; |
193 | 193 | ||
@@ -278,11 +278,11 @@ int ceph_open(struct inode *inode, struct file *file) | |||
278 | struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb); | 278 | struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb); |
279 | struct ceph_mds_client *mdsc = fsc->mdsc; | 279 | struct ceph_mds_client *mdsc = fsc->mdsc; |
280 | struct ceph_mds_request *req; | 280 | struct ceph_mds_request *req; |
281 | struct ceph_file_info *cf = file->private_data; | 281 | struct ceph_file_info *fi = file->private_data; |
282 | int err; | 282 | int err; |
283 | int flags, fmode, wanted; | 283 | int flags, fmode, wanted; |
284 | 284 | ||
285 | if (cf) { | 285 | if (fi) { |
286 | dout("open file %p is already opened\n", file); | 286 | dout("open file %p is already opened\n", file); |
287 | return 0; | 287 | return 0; |
288 | } | 288 | } |
@@ -460,16 +460,16 @@ out_acl: | |||
460 | int ceph_release(struct inode *inode, struct file *file) | 460 | int ceph_release(struct inode *inode, struct file *file) |
461 | { | 461 | { |
462 | struct ceph_inode_info *ci = ceph_inode(inode); | 462 | struct ceph_inode_info *ci = ceph_inode(inode); |
463 | struct ceph_file_info *cf = file->private_data; | 463 | struct ceph_file_info *fi = file->private_data; |
464 | 464 | ||
465 | dout("release inode %p file %p\n", inode, file); | 465 | dout("release inode %p file %p\n", inode, file); |
466 | ceph_put_fmode(ci, cf->fmode); | 466 | ceph_put_fmode(ci, fi->fmode); |
467 | if (cf->last_readdir) | 467 | if (fi->last_readdir) |
468 | ceph_mdsc_put_request(cf->last_readdir); | 468 | ceph_mdsc_put_request(fi->last_readdir); |
469 | kfree(cf->last_name); | 469 | kfree(fi->last_name); |
470 | kfree(cf->dir_info); | 470 | kfree(fi->dir_info); |
471 | WARN_ON(!list_empty(&cf->rw_contexts)); | 471 | WARN_ON(!list_empty(&fi->rw_contexts)); |
472 | kmem_cache_free(ceph_file_cachep, cf); | 472 | kmem_cache_free(ceph_file_cachep, fi); |
473 | 473 | ||
474 | /* wake up anyone waiting for caps on this inode */ | 474 | /* wake up anyone waiting for caps on this inode */ |
475 | wake_up_all(&ci->i_cap_wq); | 475 | wake_up_all(&ci->i_cap_wq); |