Skip to content

Commit 294d0a2

Browse files
committed
ceph: remove useless session parameter for check_caps()
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-427.18.1.el9_4 commit-author Xiubo Li <xiubli@redhat.com> commit e4b731c The session parameter makes no sense any more. Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> (cherry picked from commit e4b731c) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 234cddc commit 294d0a2

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
@@ -1430,7 +1430,7 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
14301430
folio_put(folio);
14311431

14321432
if (check_cap)
1433-
ceph_check_caps(ceph_inode(inode), CHECK_CAPS_AUTHONLY, NULL);
1433+
ceph_check_caps(ceph_inode(inode), CHECK_CAPS_AUTHONLY);
14341434

14351435
return copied;
14361436
}

fs/ceph/caps.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,8 +1903,7 @@ bool __ceph_should_report_size(struct ceph_inode_info *ci)
19031903
* CHECK_CAPS_FLUSH - we should flush any dirty caps immediately, without
19041904
* further delay.
19051905
*/
1906-
void ceph_check_caps(struct ceph_inode_info *ci, int flags,
1907-
struct ceph_mds_session *session)
1906+
void ceph_check_caps(struct ceph_inode_info *ci, int flags)
19081907
{
19091908
struct inode *inode = &ci->netfs.inode;
19101909
struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb);
@@ -1918,15 +1917,12 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
19181917
bool queue_invalidate = false;
19191918
bool tried_invalidate = false;
19201919
bool queue_writeback = false;
1921-
1922-
if (session)
1923-
ceph_get_mds_session(session);
1920+
struct ceph_mds_session *session = NULL;
19241921

19251922
spin_lock(&ci->i_ceph_lock);
19261923
if (ci->i_ceph_flags & CEPH_I_ASYNC_CREATE) {
19271924
/* Don't send messages until we get async create reply */
19281925
spin_unlock(&ci->i_ceph_lock);
1929-
ceph_put_mds_session(session);
19301926
return;
19311927
}
19321928

@@ -2876,7 +2872,7 @@ static void check_max_size(struct inode *inode, loff_t endoff)
28762872
check = 1;
28772873
spin_unlock(&ci->i_ceph_lock);
28782874
if (check)
2879-
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
2875+
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY);
28802876
}
28812877

28822878
static inline int get_used_fmode(int caps)
@@ -3170,7 +3166,7 @@ static void __ceph_put_cap_refs(struct ceph_inode_info *ci, int had,
31703166
switch (mode) {
31713167
case PUT_CAP_REFS_SYNC:
31723168
if (last)
3173-
ceph_check_caps(ci, 0, NULL);
3169+
ceph_check_caps(ci, 0);
31743170
else if (flushsnaps)
31753171
ceph_flush_snaps(ci, NULL);
31763172
break;
@@ -3280,7 +3276,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,
32803276
spin_unlock(&ci->i_ceph_lock);
32813277

32823278
if (last) {
3283-
ceph_check_caps(ci, 0, NULL);
3279+
ceph_check_caps(ci, 0);
32843280
} else if (flush_snaps) {
32853281
ceph_flush_snaps(ci, NULL);
32863282
}
@@ -3635,10 +3631,9 @@ static void handle_cap_grant(struct inode *inode,
36353631

36363632
mutex_unlock(&session->s_mutex);
36373633
if (check_caps == 1)
3638-
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY | CHECK_CAPS_NOINVAL,
3639-
session);
3634+
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY | CHECK_CAPS_NOINVAL);
36403635
else if (check_caps == 2)
3641-
ceph_check_caps(ci, CHECK_CAPS_NOINVAL, session);
3636+
ceph_check_caps(ci, CHECK_CAPS_NOINVAL);
36423637
}
36433638

36443639
/*
@@ -4392,7 +4387,7 @@ unsigned long ceph_check_delayed_caps(struct ceph_mds_client *mdsc)
43924387
if (inode) {
43934388
spin_unlock(&mdsc->cap_delay_lock);
43944389
dout("check_delayed_caps on %p\n", inode);
4395-
ceph_check_caps(ci, 0, NULL);
4390+
ceph_check_caps(ci, 0);
43964391
iput(inode);
43974392
spin_lock(&mdsc->cap_delay_lock);
43984393
}
@@ -4421,7 +4416,7 @@ static void flush_dirty_session_caps(struct ceph_mds_session *s)
44214416
dout("flush_dirty_caps %llx.%llx\n", ceph_vinop(inode));
44224417
spin_unlock(&mdsc->cap_dirty_lock);
44234418
ceph_wait_on_async_create(inode);
4424-
ceph_check_caps(ci, CHECK_CAPS_FLUSH, NULL);
4419+
ceph_check_caps(ci, CHECK_CAPS_FLUSH);
44254420
iput(inode);
44264421
spin_lock(&mdsc->cap_dirty_lock);
44274422
}

fs/ceph/file.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ int ceph_renew_caps(struct inode *inode, int fmode)
314314
spin_unlock(&ci->i_ceph_lock);
315315
dout("renew caps %p want %s issued %s updating mds_wanted\n",
316316
inode, ceph_cap_string(wanted), ceph_cap_string(issued));
317-
ceph_check_caps(ci, 0, NULL);
317+
ceph_check_caps(ci, 0);
318318
return 0;
319319
}
320320
spin_unlock(&ci->i_ceph_lock);
@@ -409,7 +409,7 @@ int ceph_open(struct inode *inode, struct file *file)
409409
if ((issued & wanted) != wanted &&
410410
(mds_wanted & wanted) != wanted &&
411411
ceph_snap(inode) != CEPH_SNAPDIR)
412-
ceph_check_caps(ci, 0, NULL);
412+
ceph_check_caps(ci, 0);
413413

414414
return ceph_init_file(inode, file, fmode);
415415
} else if (ceph_snap(inode) != CEPH_NOSNAP &&
@@ -1094,7 +1094,7 @@ static void ceph_aio_complete(struct inode *inode,
10941094
loff_t endoff = aio_req->iocb->ki_pos + aio_req->total_len;
10951095
if (endoff > i_size_read(inode)) {
10961096
if (ceph_inode_set_size(inode, endoff))
1097-
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
1097+
ceph_check_caps(ci, CHECK_CAPS_AUTHONLY);
10981098
}
10991099

11001100
spin_lock(&ci->i_ceph_lock);
@@ -1423,8 +1423,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
14231423
if (write && pos > size) {
14241424
if (ceph_inode_set_size(inode, pos))
14251425
ceph_check_caps(ceph_inode(inode),
1426-
CHECK_CAPS_AUTHONLY,
1427-
NULL);
1426+
CHECK_CAPS_AUTHONLY);
14281427
}
14291428
}
14301429

@@ -1579,8 +1578,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos,
15791578
check_caps = ceph_inode_set_size(inode, pos);
15801579
if (check_caps)
15811580
ceph_check_caps(ceph_inode(inode),
1582-
CHECK_CAPS_AUTHONLY,
1583-
NULL);
1581+
CHECK_CAPS_AUTHONLY);
15841582
}
15851583

15861584
}
@@ -1908,7 +1906,7 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
19081906
if (dirty)
19091907
__mark_inode_dirty(inode, dirty);
19101908
if (ceph_quota_is_max_bytes_approaching(inode, iocb->ki_pos))
1911-
ceph_check_caps(ci, CHECK_CAPS_FLUSH, NULL);
1909+
ceph_check_caps(ci, CHECK_CAPS_FLUSH);
19121910
}
19131911

19141912
dout("aio_write %p %llx.%llx %llu~%u dropping cap refs on %s\n",
@@ -2534,8 +2532,7 @@ static ssize_t __ceph_copy_file_range(struct file *src_file, loff_t src_off,
25342532
/* Let the MDS know about dst file size change */
25352533
if (ceph_inode_set_size(dst_inode, dst_off) ||
25362534
ceph_quota_is_max_bytes_approaching(dst_inode, dst_off))
2537-
ceph_check_caps(dst_ci, CHECK_CAPS_AUTHONLY | CHECK_CAPS_FLUSH,
2538-
NULL);
2535+
ceph_check_caps(dst_ci, CHECK_CAPS_AUTHONLY | CHECK_CAPS_FLUSH);
25392536
}
25402537
/* Mark Fw dirty */
25412538
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
@@ -1223,8 +1223,7 @@ extern void ceph_remove_capsnap(struct inode *inode,
12231223
extern void ceph_flush_snaps(struct ceph_inode_info *ci,
12241224
struct ceph_mds_session **psession);
12251225
extern bool __ceph_should_report_size(struct ceph_inode_info *ci);
1226-
extern void ceph_check_caps(struct ceph_inode_info *ci, int flags,
1227-
struct ceph_mds_session *session);
1226+
extern void ceph_check_caps(struct ceph_inode_info *ci, int flags);
12281227
extern unsigned long ceph_check_delayed_caps(struct ceph_mds_client *mdsc);
12291228
extern void ceph_flush_dirty_caps(struct ceph_mds_client *mdsc);
12301229
extern int ceph_drop_caps_for_unlink(struct inode *inode);

0 commit comments

Comments
 (0)