* [PATCH 1/4] ceph: kill ceph_osdc_writepages() "nofail" parameter
2013-02-16 16:30 [PATCH 0/4] libceph: get rid of some unneeded function parameters Alex Elder
@ 2013-02-16 16:31 ` Alex Elder
2013-02-16 16:31 ` [PATCH 2/4] ceph: kill ceph_osdc_writepages() "dosync" parameter Alex Elder
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Alex Elder @ 2013-02-16 16:31 UTC (permalink / raw)
To: ceph-devel
There is only one caller of ceph_osdc_writepages(), and it always
passes the value true as its "nofail" argument. Get rid of that
argument and replace its use in ceph_osdc_writepages() with the
constant value true.
This and a number of cleanup patches that follow resolve:
http://tracker.ceph.com/issues/4126
Signed-off-by: Alex Elder <elder@inktank.com>
---
fs/ceph/addr.c | 2 +-
include/linux/ceph/osd_client.h | 2 +-
net/ceph/osd_client.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 064d1a6..c7e401c 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -493,7 +493,7 @@ static int writepage_nounlock(struct page *page,
struct writeback_control *wbc)
page_off, len,
ci->i_truncate_seq, ci->i_truncate_size,
&inode->i_mtime,
- &page, 1, 0, 0, true);
+ &page, 1, 0, 0);
if (err < 0) {
dout("writepage setting page/mapping error %d %p\n", err, page);
SetPageError(page);
diff --git a/include/linux/ceph/osd_client.h
b/include/linux/ceph/osd_client.h
index 82bf633..afcb255 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -275,7 +275,7 @@ extern int ceph_osdc_writepages(struct
ceph_osd_client *osdc,
u32 truncate_seq, u64 truncate_size,
struct timespec *mtime,
struct page **pages, int nr_pages,
- int flags, int do_sync, bool nofail);
+ int flags, int do_sync);
/* watch/notify events */
extern int ceph_osdc_create_event(struct ceph_osd_client *osdc,
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index d9d58bb..dd01b13 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1867,7 +1867,7 @@ int ceph_osdc_writepages(struct ceph_osd_client
*osdc, struct ceph_vino vino,
u32 truncate_seq, u64 truncate_size,
struct timespec *mtime,
struct page **pages, int num_pages,
- int flags, int do_sync, bool nofail)
+ int flags, int do_sync)
{
struct ceph_osd_request *req;
int rc = 0;
@@ -1880,7 +1880,7 @@ int ceph_osdc_writepages(struct ceph_osd_client
*osdc, struct ceph_vino vino,
CEPH_OSD_FLAG_WRITE,
snapc, do_sync,
truncate_seq, truncate_size, mtime,
- nofail, 1, page_align);
+ true, 1, page_align);
if (IS_ERR(req))
return PTR_ERR(req);
@@ -1889,7 +1889,7 @@ int ceph_osdc_writepages(struct ceph_osd_client
*osdc, struct ceph_vino vino,
dout("writepages %llu~%llu (%d pages)\n", off, len,
req->r_num_pages);
- rc = ceph_osdc_start_request(osdc, req, nofail);
+ rc = ceph_osdc_start_request(osdc, req, true);
if (!rc)
rc = ceph_osdc_wait_request(osdc, req);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/4] ceph: kill ceph_osdc_writepages() "dosync" parameter
2013-02-16 16:30 [PATCH 0/4] libceph: get rid of some unneeded function parameters Alex Elder
2013-02-16 16:31 ` [PATCH 1/4] ceph: kill ceph_osdc_writepages() "nofail" parameter Alex Elder
@ 2013-02-16 16:31 ` Alex Elder
2013-02-16 16:31 ` [PATCH 3/4] ceph: kill ceph_osdc_writepages() "flags" parameter Alex Elder
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Alex Elder @ 2013-02-16 16:31 UTC (permalink / raw)
To: ceph-devel
There is only one caller of ceph_osdc_writepages(), and it always
passes 0 as its "dosync" argument. Get rid of that argument and
replace its use in ceph_osdc_writepages() with 0.
Signed-off-by: Alex Elder <elder@inktank.com>
---
fs/ceph/addr.c | 2 +-
include/linux/ceph/osd_client.h | 2 +-
net/ceph/osd_client.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index c7e401c..bef5528 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -493,7 +493,7 @@ static int writepage_nounlock(struct page *page,
struct writeback_control *wbc)
page_off, len,
ci->i_truncate_seq, ci->i_truncate_size,
&inode->i_mtime,
- &page, 1, 0, 0);
+ &page, 1, 0);
if (err < 0) {
dout("writepage setting page/mapping error %d %p\n", err, page);
SetPageError(page);
diff --git a/include/linux/ceph/osd_client.h
b/include/linux/ceph/osd_client.h
index afcb255..7a63100 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -275,7 +275,7 @@ extern int ceph_osdc_writepages(struct
ceph_osd_client *osdc,
u32 truncate_seq, u64 truncate_size,
struct timespec *mtime,
struct page **pages, int nr_pages,
- int flags, int do_sync);
+ int flags);
/* watch/notify events */
extern int ceph_osdc_create_event(struct ceph_osd_client *osdc,
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index dd01b13..ac186b7 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1867,7 +1867,7 @@ int ceph_osdc_writepages(struct ceph_osd_client
*osdc, struct ceph_vino vino,
u32 truncate_seq, u64 truncate_size,
struct timespec *mtime,
struct page **pages, int num_pages,
- int flags, int do_sync)
+ int flags)
{
struct ceph_osd_request *req;
int rc = 0;
@@ -1878,7 +1878,7 @@ int ceph_osdc_writepages(struct ceph_osd_client
*osdc, struct ceph_vino vino,
CEPH_OSD_OP_WRITE,
flags | CEPH_OSD_FLAG_ONDISK |
CEPH_OSD_FLAG_WRITE,
- snapc, do_sync,
+ snapc, 0,
truncate_seq, truncate_size, mtime,
true, 1, page_align);
if (IS_ERR(req))
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/4] ceph: kill ceph_osdc_writepages() "flags" parameter
2013-02-16 16:30 [PATCH 0/4] libceph: get rid of some unneeded function parameters Alex Elder
2013-02-16 16:31 ` [PATCH 1/4] ceph: kill ceph_osdc_writepages() "nofail" parameter Alex Elder
2013-02-16 16:31 ` [PATCH 2/4] ceph: kill ceph_osdc_writepages() "dosync" parameter Alex Elder
@ 2013-02-16 16:31 ` Alex Elder
2013-02-16 16:32 ` [PATCH 4/4] ceph: kill ceph_osdc_new_request() "num_reply" Alex Elder
2013-02-16 23:26 ` [PATCH 0/4] libceph: get rid of some unneeded function parameters Josh Durgin
4 siblings, 0 replies; 6+ messages in thread
From: Alex Elder @ 2013-02-16 16:31 UTC (permalink / raw)
To: ceph-devel
There is only one caller of ceph_osdc_writepages(), and it always
passes 0 as its "flags" argument. Get rid of that argument and
replace its use in ceph_osdc_writepages() with 0.
Signed-off-by: Alex Elder <elder@inktank.com>
---
fs/ceph/addr.c | 3 +--
include/linux/ceph/osd_client.h | 3 +--
net/ceph/osd_client.c | 6 ++----
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index bef5528..8d3240d 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -492,8 +492,7 @@ static int writepage_nounlock(struct page *page,
struct writeback_control *wbc)
&ci->i_layout, snapc,
page_off, len,
ci->i_truncate_seq, ci->i_truncate_size,
- &inode->i_mtime,
- &page, 1, 0);
+ &inode->i_mtime, &page, 1);
if (err < 0) {
dout("writepage setting page/mapping error %d %p\n", err, page);
SetPageError(page);
diff --git a/include/linux/ceph/osd_client.h
b/include/linux/ceph/osd_client.h
index 7a63100..6540e88 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -274,8 +274,7 @@ extern int ceph_osdc_writepages(struct
ceph_osd_client *osdc,
u64 off, u64 len,
u32 truncate_seq, u64 truncate_size,
struct timespec *mtime,
- struct page **pages, int nr_pages,
- int flags);
+ struct page **pages, int nr_pages);
/* watch/notify events */
extern int ceph_osdc_create_event(struct ceph_osd_client *osdc,
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index ac186b7..d4e3812 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1866,8 +1866,7 @@ int ceph_osdc_writepages(struct ceph_osd_client
*osdc, struct ceph_vino vino,
u64 off, u64 len,
u32 truncate_seq, u64 truncate_size,
struct timespec *mtime,
- struct page **pages, int num_pages,
- int flags)
+ struct page **pages, int num_pages)
{
struct ceph_osd_request *req;
int rc = 0;
@@ -1876,8 +1875,7 @@ int ceph_osdc_writepages(struct ceph_osd_client
*osdc, struct ceph_vino vino,
BUG_ON(vino.snap != CEPH_NOSNAP);
req = ceph_osdc_new_request(osdc, layout, vino, off, &len,
CEPH_OSD_OP_WRITE,
- flags | CEPH_OSD_FLAG_ONDISK |
- CEPH_OSD_FLAG_WRITE,
+ CEPH_OSD_FLAG_ONDISK | CEPH_OSD_FLAG_WRITE,
snapc, 0,
truncate_seq, truncate_size, mtime,
true, 1, page_align);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 4/4] ceph: kill ceph_osdc_new_request() "num_reply"
2013-02-16 16:30 [PATCH 0/4] libceph: get rid of some unneeded function parameters Alex Elder
` (2 preceding siblings ...)
2013-02-16 16:31 ` [PATCH 3/4] ceph: kill ceph_osdc_writepages() "flags" parameter Alex Elder
@ 2013-02-16 16:32 ` Alex Elder
2013-02-16 23:26 ` [PATCH 0/4] libceph: get rid of some unneeded function parameters Josh Durgin
4 siblings, 0 replies; 6+ messages in thread
From: Alex Elder @ 2013-02-16 16:32 UTC (permalink / raw)
To: ceph-devel
The "num_reply" parameter to ceph_osdc_new_request() is never
used inside that function, so get rid of it.
Note that ceph_sync_write() passes 2 for that argument, while all
other callers pass 1. It doesn't matter, but perhaps someone should
verify this doesn't indicate a problem.
Signed-off-by: Alex Elder <elder@inktank.com>
---
fs/ceph/addr.c | 4 ++--
fs/ceph/file.c | 2 +-
include/linux/ceph/osd_client.h | 3 +--
net/ceph/osd_client.c | 6 +++---
4 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 8d3240d..fc61371 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -315,7 +315,7 @@ static int start_read(struct inode *inode, struct
list_head *page_list, int max)
CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ,
NULL, 0,
ci->i_truncate_seq, ci->i_truncate_size,
- NULL, false, 1, 0);
+ NULL, false, 0);
if (IS_ERR(req))
return PTR_ERR(req);
@@ -837,7 +837,7 @@ get_more_pages:
snapc, do_sync,
ci->i_truncate_seq,
ci->i_truncate_size,
- &inode->i_mtime, true, 1, 0);
+ &inode->i_mtime, true, 0);
if (IS_ERR(req)) {
rc = PTR_ERR(req);
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index a1e5b81..9c4325e 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -541,7 +541,7 @@ more:
ci->i_snap_realm->cached_context,
do_sync,
ci->i_truncate_seq, ci->i_truncate_size,
- &mtime, false, 2, page_align);
+ &mtime, false, page_align);
if (IS_ERR(req))
return PTR_ERR(req);
diff --git a/include/linux/ceph/osd_client.h
b/include/linux/ceph/osd_client.h
index 6540e88..5812802 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -234,8 +234,7 @@ extern struct ceph_osd_request
*ceph_osdc_new_request(struct ceph_osd_client *,
int do_sync, u32 truncate_seq,
u64 truncate_size,
struct timespec *mtime,
- bool use_mempool, int num_reply,
- int page_align);
+ bool use_mempool, int page_align);
extern void ceph_osdc_set_request_linger(struct ceph_osd_client *osdc,
struct ceph_osd_request *req);
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index d4e3812..d3e7513 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -393,7 +393,7 @@ struct ceph_osd_request
*ceph_osdc_new_request(struct ceph_osd_client *osdc,
u32 truncate_seq,
u64 truncate_size,
struct timespec *mtime,
- bool use_mempool, int num_reply,
+ bool use_mempool,
int page_align)
{
struct ceph_osd_req_op ops[2];
@@ -1837,7 +1837,7 @@ int ceph_osdc_readpages(struct ceph_osd_client *osdc,
req = ceph_osdc_new_request(osdc, layout, vino, off, plen,
CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ,
NULL, 0, truncate_seq, truncate_size, NULL,
- false, 1, page_align);
+ false, page_align);
if (IS_ERR(req))
return PTR_ERR(req);
@@ -1878,7 +1878,7 @@ int ceph_osdc_writepages(struct ceph_osd_client
*osdc, struct ceph_vino vino,
CEPH_OSD_FLAG_ONDISK | CEPH_OSD_FLAG_WRITE,
snapc, 0,
truncate_seq, truncate_size, mtime,
- true, 1, page_align);
+ true, page_align);
if (IS_ERR(req))
return PTR_ERR(req);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 0/4] libceph: get rid of some unneeded function parameters
2013-02-16 16:30 [PATCH 0/4] libceph: get rid of some unneeded function parameters Alex Elder
` (3 preceding siblings ...)
2013-02-16 16:32 ` [PATCH 4/4] ceph: kill ceph_osdc_new_request() "num_reply" Alex Elder
@ 2013-02-16 23:26 ` Josh Durgin
4 siblings, 0 replies; 6+ messages in thread
From: Josh Durgin @ 2013-02-16 23:26 UTC (permalink / raw)
To: Alex Elder; +Cc: ceph-devel
On 02/16/2013 08:30 AM, Alex Elder wrote:
> This series eliminates some unneeded parameters from functions
> in the osd client.
>
> -Alex
>
> [PATCH 1/4] ceph: kill ceph_osdc_writepages() "nofail" parameter
> [PATCH 2/4] ceph: kill ceph_osdc_writepages() "dosync" parameter
> [PATCH 3/4] ceph: kill ceph_osdc_writepages() "flags" parameter
> [PATCH 4/4] ceph: kill ceph_osdc_new_request() "num_reply"
These all look good.
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
^ permalink raw reply [flat|nested] 6+ messages in thread