From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [dhowells-fs:fscache-iter 40/55] fs/fscache/read_helper.c:71:18: error: 'fscache_n_cop_put_object' undeclared; did you mean
Date: Fri, 11 Sep 2020 12:52:35 +0800 [thread overview]
Message-ID: <202009111232.d2J6rtmo%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 12229 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git fscache-iter
head: f6ac6a6db767d26c3330f0cecadd4f331ee6d291
commit: 02956137643245200e02a2683c203fed2308aece [40/55] fscache: Add read helper
config: i386-randconfig-a002-20200909 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git checkout 02956137643245200e02a2683c203fed2308aece
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
>> fs/fscache/read_helper.c:61:6: warning: no previous prototype for 'fscache_put_read_request' [-Wmissing-prototypes]
61 | void fscache_put_read_request(struct fscache_read_request *rreq)
| ^~~~~~~~~~~~~~~~~~~~~~~~
fs/fscache/read_helper.c: In function 'fscache_put_read_request':
fs/fscache/read_helper.c:71:4: error: implicit declaration of function 'fscache_stat'; did you mean 'fscache_get_aux'? [-Werror=implicit-function-declaration]
71 | fscache_stat(&fscache_n_cop_put_object);
| ^~~~~~~~~~~~
| fscache_get_aux
>> fs/fscache/read_helper.c:71:18: error: 'fscache_n_cop_put_object' undeclared (first use in this function); did you mean 'fscache_cookie_put_object'?
71 | fscache_stat(&fscache_n_cop_put_object);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| fscache_cookie_put_object
fs/fscache/read_helper.c:71:18: note: each undeclared identifier is reported only once for each function it appears in
>> fs/fscache/read_helper.c:74:4: error: implicit declaration of function 'fscache_stat_d' [-Werror=implicit-function-declaration]
74 | fscache_stat_d(&fscache_n_cop_put_object);
| ^~~~~~~~~~~~~~
>> fs/fscache/read_helper.c:75:4: error: implicit declaration of function 'fscache_cookie_put'; did you mean 'fscache_cookie_valid'? [-Werror=implicit-function-declaration]
75 | fscache_cookie_put(rreq->cookie, fscache_cookie_put_ioreq);
| ^~~~~~~~~~~~~~~~~~
| fscache_cookie_valid
fs/fscache/read_helper.c: In function 'fscache_read_from_cache':
>> fs/fscache/read_helper.c:123:2: error: implicit declaration of function 'fscache_wait_for_object' [-Werror=implicit-function-declaration]
123 | fscache_wait_for_object(ioreq->cookie, ioreq->object, FSCACHE_WANT_READ);
| ^~~~~~~~~~~~~~~~~~~~~~~
>> fs/fscache/read_helper.c:123:56: error: 'FSCACHE_WANT_READ' undeclared (first use in this function); did you mean 'FSCACHE_POINT_LEAVE'?
123 | fscache_wait_for_object(ioreq->cookie, ioreq->object, FSCACHE_WANT_READ);
| ^~~~~~~~~~~~~~~~~
| FSCACHE_POINT_LEAVE
fs/fscache/read_helper.c: At top level:
fs/fscache/read_helper.c:202:6: warning: no previous prototype for 'fscache_rreq_write_to_cache' [-Wmissing-prototypes]
202 | void fscache_rreq_write_to_cache(struct fscache_read_request *rreq)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/fscache/read_helper.c: In function 'fscache_rreq_write_to_cache':
>> fs/fscache/read_helper.c:207:54: error: 'FSCACHE_WANT_WRITE' undeclared (first use in this function)
207 | fscache_wait_for_object(rreq->cookie, rreq->object, FSCACHE_WANT_WRITE);
| ^~~~~~~~~~~~~~~~~~
fs/fscache/read_helper.c: In function 'fscache_rreq_begin_cache_io':
>> fs/fscache/read_helper.c:604:11: error: implicit declaration of function 'fscache_begin_io_operation'; did you mean 'fscache_end_io_operation'? [-Werror=implicit-function-declaration]
604 | object = fscache_begin_io_operation(cookie, FSCACHE_WANT_PARAMS, rreq);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| fscache_end_io_operation
>> fs/fscache/read_helper.c:604:46: error: 'FSCACHE_WANT_PARAMS' undeclared (first use in this function)
604 | object = fscache_begin_io_operation(cookie, FSCACHE_WANT_PARAMS, rreq);
| ^~~~~~~~~~~~~~~~~~~
>> fs/fscache/read_helper.c:607:18: error: implicit declaration of function 'fscache_cookie_get'; did you mean 'fscache_cookie_valid'? [-Werror=implicit-function-declaration]
607 | rreq->cookie = fscache_cookie_get(cookie, fscache_cookie_get_ioreq);
| ^~~~~~~~~~~~~~~~~~
| fscache_cookie_valid
>> fs/fscache/read_helper.c:607:16: warning: assignment to 'struct fscache_cookie *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
607 | rreq->cookie = fscache_cookie_get(cookie, fscache_cookie_get_ioreq);
| ^
cc1: some warnings being treated as errors
# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit/?id=02956137643245200e02a2683c203fed2308aece
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs fscache-iter
git checkout 02956137643245200e02a2683c203fed2308aece
vim +71 fs/fscache/read_helper.c
60
> 61 void fscache_put_read_request(struct fscache_read_request *rreq)
62 {
63 if (refcount_dec_and_test(&rreq->usage)) {
64 fscache_rreq_clear_ioreqs(rreq);
65 if (rreq->netfs_ops->cleanup)
66 rreq->netfs_ops->cleanup(rreq);
67 fput(rreq->file);
68
69 if (rreq->cookie) {
70 fscache_end_io_operation(rreq->cookie);
> 71 fscache_stat(&fscache_n_cop_put_object);
72 rreq->object->cache->ops->put_object(
73 rreq->object, fscache_obj_put_ioreq);
> 74 fscache_stat_d(&fscache_n_cop_put_object);
> 75 fscache_cookie_put(rreq->cookie, fscache_cookie_put_ioreq);
76 }
77 kfree(rreq);
78 }
79 }
80
81 /*
82 * Allocate and partially initialise an I/O request structure.
83 */
84 static struct fscache_io_request *fscache_alloc_io_request(
85 struct fscache_read_request *rreq)
86 {
87 struct fscache_io_request *ioreq;
88
89 ioreq = kzalloc(sizeof(struct fscache_io_request), GFP_KERNEL);
90 if (ioreq) {
91 INIT_LIST_HEAD(&ioreq->rreq_link);
92 refcount_set(&ioreq->usage, 2);
93 ioreq->rreq = rreq;
94 ioreq->io_done = fscache_ioreq_terminated;
95 }
96
97 return ioreq;
98 }
99
100 /*
101 * Clear the unread part of an I/O request.
102 */
103 static void fscache_clear_unread(struct fscache_io_request *ioreq)
104 {
105 if (ioreq->transferred < ioreq->len) {
106 struct iov_iter iter;
107
108 iov_iter_xarray(&iter, WRITE, &ioreq->rreq->mapping->i_pages,
109 ioreq->start + ioreq->transferred,
110 ioreq->len - ioreq->transferred);
111 iov_iter_zero(iov_iter_count(&iter), &iter);
112 }
113 }
114
115 /*
116 * Issue a read against the cache.
117 */
118 static void fscache_read_from_cache(struct fscache_read_request *rreq,
119 struct fscache_io_request *ioreq)
120 {
121 struct iov_iter iter;
122
> 123 fscache_wait_for_object(ioreq->cookie, ioreq->object, FSCACHE_WANT_READ);
124
125 iov_iter_xarray(&iter, READ, &rreq->mapping->i_pages,
126 ioreq->start, ioreq->len);
127 ioreq->object->cache->ops->read(ioreq->object, ioreq, &iter);
128 }
129
130 /*
131 * Ask the netfs to issue a read request to the server for us.
132 *
133 * The netfs is expected to read from ioreq->pos + ioreq->transferred to
134 * ioreq->pos + ioreq->len - 1. It may not backtrack and write data into the
135 * buffer prior to the transferred point as it might clobber dirty data
136 * obtained from the cache.
137 *
138 * Alternatively, the netfs is allowed to indicate one of two things:
139 *
140 * - FSCACHE_IO_SHORT_READ: A short read - it will get called again to try and
141 * make progress.
142 *
143 * - FSCACHE_IO_CLEAR_TAIL: A short read - the rest of the buffer will be
144 * cleared.
145 */
146 static void fscache_read_from_server(struct fscache_read_request *rreq,
147 struct fscache_io_request *ioreq)
148 {
149 rreq->netfs_ops->issue_op(ioreq);
150 }
151
152 /*
153 * Deal with the completion of writing the data to the cache. We have to clear
154 * the PG_fscache bits on the pages involved and release the caller's ref.
155 *
156 * May be called in softirq mode and we inherit a ref from the caller.
157 */
158 static void fscache_rreq_unmark_after_write(struct fscache_read_request *rreq)
159 {
160 struct fscache_io_request *ioreq;
161 struct page *page;
162 pgoff_t unlocked = 0;
163 bool have_unlocked = false;
164
165 rcu_read_lock();
166
167 list_for_each_entry(ioreq, &rreq->io_requests, rreq_link) {
168 XA_STATE(xas, &rreq->mapping->i_pages, ioreq->start / PAGE_SIZE);
169
170 xas_for_each(&xas, page, (ioreq->start + ioreq->len - 1) / PAGE_SIZE) {
171 /* We might have multiple writes from the same huge
172 * page, but we mustn't unlock a page more than once.
173 */
174 if (have_unlocked && page->index <= unlocked)
175 continue;
176 unlocked = page->index;
177 unlock_page_fscache(page);
178 have_unlocked = true;
179 }
180 }
181
182 rcu_read_unlock();
183 fscache_rreq_clear_ioreqs(rreq);
184 fscache_put_read_request(rreq);
185 }
186
187 static void fscache_rreq_copy_done(struct fscache_io_request *ioreq)
188 {
189 struct fscache_read_request *rreq = ioreq->rreq;
190
191 /* If we decrement nr_io_ops to 0, the ref belongs to us. */
192 if (atomic_dec_and_test(&rreq->nr_io_ops))
193 fscache_rreq_unmark_after_write(rreq);
194
195 fscache_put_io_request(ioreq);
196 }
197
198 /*
199 * Perform any outstanding writes to the cache. We inherit a ref from the
200 * caller.
201 */
> 202 void fscache_rreq_write_to_cache(struct fscache_read_request *rreq)
203 {
204 struct fscache_io_request *ioreq, *next, *p;
205 struct iov_iter iter;
206
> 207 fscache_wait_for_object(rreq->cookie, rreq->object, FSCACHE_WANT_WRITE);
208
209 /* We don't want terminating writes trying to wake us up whilst we're
210 * still going through the list.
211 */
212 atomic_inc(&rreq->nr_io_ops);
213
214 list_for_each_entry_safe(ioreq, p, &rreq->io_requests, rreq_link) {
215 if (!test_bit(FSCACHE_IO_WRITE_TO_CACHE, &ioreq->flags)) {
216 list_del_init(&ioreq->rreq_link);
217 fscache_put_io_request(ioreq);
218 }
219 }
220
221 list_for_each_entry(ioreq, &rreq->io_requests, rreq_link) {
222 /* Amalgamate adjacent writes */
223 while (!list_is_last(&ioreq->rreq_link, &rreq->io_requests)) {
224 next = list_next_entry(ioreq, rreq_link);
225 if (next->start > ioreq->start + ioreq->len)
226 break;
227 ioreq->len += next->len;
228 list_del_init(&next->rreq_link);
229 fscache_put_io_request(next);
230 }
231
232 iov_iter_xarray(&iter, WRITE, &rreq->mapping->i_pages,
233 ioreq->start, ioreq->len);
234
235 ioreq->io_done = fscache_rreq_copy_done;
236 fscache_get_io_request(ioreq);
237 rreq->object->cache->ops->write(rreq->object, ioreq, &iter);
238 }
239
240 /* If we decrement nr_io_ops to 0, the usage ref belongs to us. */
241 if (atomic_dec_and_test(&rreq->nr_io_ops))
242 fscache_rreq_unmark_after_write(rreq);
243 }
244
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38521 bytes --]
reply other threads:[~2020-09-11 4:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202009111232.d2J6rtmo%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.