Skip to content

Commit e4b731c

Browse files
lxbszidryomov
authored andcommitted
ceph: remove useless session parameter for check_caps()
The session parameter makes no sense any more. Signed-off-by: Xiubo Li <[email protected]> Reviewed-by: Ilya Dryomov <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 830b3c6 commit e4b731c

File tree

6 files changed

+22
-31
lines changed

6 files changed

+22
-31
lines changed

fs/ceph/addr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
13671367
folio_put(folio);
13681368

13691369
if (check_cap)
1370-
ceph_check_caps(ceph_inode(inode), CHECK_CAPS_AUTHONLY, NULL);
1370+
ceph_check_caps(ceph_inode(inode), CHECK_CAPS_AUTHONLY);
13711371

13721372
return copied;
13731373
}

fs/ceph/caps.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,8 +1898,7 @@ bool __ceph_should_report_size(struct ceph_inode_info *ci)
18981898
* CHECK_CAPS_FLUSH - we should flush any dirty caps immediately, without
18991899
* further delay.
19001900
*/
1901-
void ceph_check_caps(struct ceph_inode_info *ci, int flags,
1902-
struct ceph_mds_session *session)
1901+
void ceph_check_caps(struct ceph_inode_info *ci, int flags)
19031902
{
19041903
struct inode *inode = &ci->netfs.inode;
19051904
struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb);
@@ -1913,15 +1912,12 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
19131912
bool queue_invalidate = false;
19141913
bool tried_invalidate = false;
19151914
bool queue_writeback = false;
1916-
1917-
if (session)
1918-
ceph_get_mds_session(session);
1915+
struct ceph_mds_session *session = NULL;
19191916

19201917
spin_lock(&ci->i_ceph_lock);
19211918
if (ci->i_ceph_flags & CEPH_I_ASYNC_CREATE) {
19221919
/* Don't send messages until we get async create reply */
19231920
spin_unlock(&ci->i_ceph_lock);
1924-
ceph_put_mds_session(session);
19251921
return;
19261922
}
19271923

@@ -2851,7 +2847,7 @@ static void check_max_size(struct inode *inode, loff_t endoff)
28512847
check = 1;
28522848
spin_unlock(&ci->i_ceph_lock);
28532849
if (check)
2854-
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
2850+
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY);
28552851
}
28562852

28572853
static inline int get_used_fmode(int caps)
@@ -3140,7 +3136,7 @@ static void __ceph_put_cap_refs(struct ceph_inode_info *ci, int had,
31403136
switch (mode) {
31413137
case PUT_CAP_REFS_SYNC:
31423138
if (last)
3143-
ceph_check_caps(ci, 0, NULL);
3139+
ceph_check_caps(ci, 0);
31443140
else if (flushsnaps)
31453141
ceph_flush_snaps(ci, NULL);
31463142
break;
@@ -3255,7 +3251,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,
32553251
spin_unlock(&ci->i_ceph_lock);
32563252

32573253
if (last) {
3258-
ceph_check_caps(ci, 0, NULL);
3254+
ceph_check_caps(ci, 0);
32593255
} else if (flush_snaps) {
32603256
ceph_flush_snaps(ci, NULL);
32613257
}
@@ -3604,10 +3600,9 @@ static void handle_cap_grant(struct inode *inode,
36043600

36053601
mutex_unlock(&session->s_mutex);
36063602
if (check_caps == 1)
3607-
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY | CHECK_CAPS_NOINVAL,
3608-
session);
3603+
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY | CHECK_CAPS_NOINVAL);
36093604
else if (check_caps == 2)
3610-
ceph_check_caps(ci, CHECK_CAPS_NOINVAL, session);
3605+
ceph_check_caps(ci, CHECK_CAPS_NOINVAL);
36113606
}
36123607

36133608
/*
@@ -4333,7 +4328,7 @@ unsigned long ceph_check_delayed_caps(struct ceph_mds_client *mdsc)
43334328
if (inode) {
43344329
spin_unlock(&mdsc->cap_delay_lock);
43354330
dout("check_delayed_caps on %p\n", inode);
4336-
ceph_check_caps(ci, 0, NULL);
4331+
ceph_check_caps(ci, 0);
43374332
iput(inode);
43384333
spin_lock(&mdsc->cap_delay_lock);
43394334
}
@@ -4362,7 +4357,7 @@ static void flush_dirty_session_caps(struct ceph_mds_session *s)
43624357
dout("flush_dirty_caps %llx.%llx\n", ceph_vinop(inode));
43634358
spin_unlock(&mdsc->cap_dirty_lock);
43644359
ceph_wait_on_async_create(inode);
4365-
ceph_check_caps(ci, CHECK_CAPS_FLUSH, NULL);
4360+
ceph_check_caps(ci, CHECK_CAPS_FLUSH);
43664361
iput(inode);
43674362
spin_lock(&mdsc->cap_dirty_lock);
43684363
}

fs/ceph/file.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ int ceph_renew_caps(struct inode *inode, int fmode)
313313
spin_unlock(&ci->i_ceph_lock);
314314
dout("renew caps %p want %s issued %s updating mds_wanted\n",
315315
inode, ceph_cap_string(wanted), ceph_cap_string(issued));
316-
ceph_check_caps(ci, 0, NULL);
316+
ceph_check_caps(ci, 0);
317317
return 0;
318318
}
319319
spin_unlock(&ci->i_ceph_lock);
@@ -408,7 +408,7 @@ int ceph_open(struct inode *inode, struct file *file)
408408
if ((issued & wanted) != wanted &&
409409
(mds_wanted & wanted) != wanted &&
410410
ceph_snap(inode) != CEPH_SNAPDIR)
411-
ceph_check_caps(ci, 0, NULL);
411+
ceph_check_caps(ci, 0);
412412

413413
return ceph_init_file(inode, file, fmode);
414414
} else if (ceph_snap(inode) != CEPH_NOSNAP &&
@@ -1092,7 +1092,7 @@ static void ceph_aio_complete(struct inode *inode,
10921092
loff_t endoff = aio_req->iocb->ki_pos + aio_req->total_len;
10931093
if (endoff > i_size_read(inode)) {
10941094
if (ceph_inode_set_size(inode, endoff))
1095-
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
1095+
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY);
10961096
}
10971097

10981098
spin_lock(&ci->i_ceph_lock);
@@ -1421,8 +1421,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
14211421
if (write && pos > size) {
14221422
if (ceph_inode_set_size(inode, pos))
14231423
ceph_check_caps(ceph_inode(inode),
1424-
CHECK_CAPS_AUTHONLY,
1425-
NULL);
1424+
CHECK_CAPS_AUTHONLY);
14261425
}
14271426
}
14281427

@@ -1577,8 +1576,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos,
15771576
check_caps = ceph_inode_set_size(inode, pos);
15781577
if (check_caps)
15791578
ceph_check_caps(ceph_inode(inode),
1580-
CHECK_CAPS_AUTHONLY,
1581-
NULL);
1579+
CHECK_CAPS_AUTHONLY);
15821580
}
15831581

15841582
}
@@ -1906,7 +1904,7 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
19061904
if (dirty)
19071905
__mark_inode_dirty(inode, dirty);
19081906
if (ceph_quota_is_max_bytes_approaching(inode, iocb->ki_pos))
1909-
ceph_check_caps(ci, CHECK_CAPS_FLUSH, NULL);
1907+
ceph_check_caps(ci, CHECK_CAPS_FLUSH);
19101908
}
19111909

19121910
dout("aio_write %p %llx.%llx %llu~%u dropping cap refs on %s\n",
@@ -2521,8 +2519,7 @@ static ssize_t __ceph_copy_file_range(struct file *src_file, loff_t src_off,
25212519
/* Let the MDS know about dst file size change */
25222520
if (ceph_inode_set_size(dst_inode, dst_off) ||
25232521
ceph_quota_is_max_bytes_approaching(dst_inode, dst_off))
2524-
ceph_check_caps(dst_ci, CHECK_CAPS_AUTHONLY | CHECK_CAPS_FLUSH,
2525-
NULL);
2522+
ceph_check_caps(dst_ci, CHECK_CAPS_AUTHONLY | CHECK_CAPS_FLUSH);
25262523
}
25272524
/* Mark Fw dirty */
25282525
spin_lock(&dst_ci->i_ceph_lock);

fs/ceph/inode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,7 @@ static void ceph_do_invalidate_pages(struct inode *inode)
19091909
mutex_unlock(&ci->i_truncate_mutex);
19101910
out:
19111911
if (check)
1912-
ceph_check_caps(ci, 0, NULL);
1912+
ceph_check_caps(ci, 0);
19131913
}
19141914

19151915
/*
@@ -1969,7 +1969,7 @@ void __ceph_do_pending_vmtruncate(struct inode *inode)
19691969
mutex_unlock(&ci->i_truncate_mutex);
19701970

19711971
if (wrbuffer_refs == 0)
1972-
ceph_check_caps(ci, 0, NULL);
1972+
ceph_check_caps(ci, 0);
19731973

19741974
wake_up_all(&ci->i_cap_wq);
19751975
}
@@ -1991,7 +1991,7 @@ static void ceph_inode_work(struct work_struct *work)
19911991
__ceph_do_pending_vmtruncate(inode);
19921992

19931993
if (test_and_clear_bit(CEPH_I_WORK_CHECK_CAPS, &ci->i_work_mask))
1994-
ceph_check_caps(ci, 0, NULL);
1994+
ceph_check_caps(ci, 0);
19951995

19961996
if (test_and_clear_bit(CEPH_I_WORK_FLUSH_SNAPS, &ci->i_work_mask))
19971997
ceph_flush_snaps(ci, NULL);

fs/ceph/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static long ceph_ioctl_lazyio(struct file *file)
253253
spin_unlock(&ci->i_ceph_lock);
254254
dout("ioctl_layzio: file %p marked lazy\n", file);
255255

256-
ceph_check_caps(ci, 0, NULL);
256+
ceph_check_caps(ci, 0);
257257
} else {
258258
dout("ioctl_layzio: file %p already lazy\n", file);
259259
}

fs/ceph/super.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,8 +1200,7 @@ extern void ceph_remove_capsnap(struct inode *inode,
12001200
extern void ceph_flush_snaps(struct ceph_inode_info *ci,
12011201
struct ceph_mds_session **psession);
12021202
extern bool __ceph_should_report_size(struct ceph_inode_info *ci);
1203-
extern void ceph_check_caps(struct ceph_inode_info *ci, int flags,
1204-
struct ceph_mds_session *session);
1203+
extern void ceph_check_caps(struct ceph_inode_info *ci, int flags);
12051204
extern unsigned long ceph_check_delayed_caps(struct ceph_mds_client *mdsc);
12061205
extern void ceph_flush_dirty_caps(struct ceph_mds_client *mdsc);
12071206
extern int ceph_drop_caps_for_unlink(struct inode *inode);

0 commit comments

Comments
 (0)