Searched refs:hmcdrv_cache_file (Results 1 - 1 of 1) sorted by relevance

/linux-4.4.14/drivers/s390/char/
H A Dhmcdrv_cache.c47 static struct hmcdrv_cache_entry hmcdrv_cache_file = { variable in typeref:struct:hmcdrv_cache_entry
66 if ((ftp->id != hmcdrv_cache_file.id) || hmcdrv_cache_get()
67 strcmp(hmcdrv_cache_file.fname, ftp->fname)) hmcdrv_cache_get()
70 if (ftp->ofs >= hmcdrv_cache_file.fsize) /* EOF ? */ hmcdrv_cache_get()
73 if ((hmcdrv_cache_file.ofs < 0) || /* has content? */ hmcdrv_cache_get()
74 time_after(jiffies, hmcdrv_cache_file.timeout)) hmcdrv_cache_get()
80 len = hmcdrv_cache_file.fsize - ftp->ofs; hmcdrv_cache_get()
86 * at offset 'hmcdrv_cache_file.ofs' in the file of interest) hmcdrv_cache_get()
88 pos = ftp->ofs - hmcdrv_cache_file.ofs; hmcdrv_cache_get()
91 ((pos + len) <= hmcdrv_cache_file.len)) { hmcdrv_cache_get()
94 hmcdrv_cache_file.content + pos, hmcdrv_cache_get()
97 hmcdrv_cache_file.fname, len, hmcdrv_cache_get()
98 hmcdrv_cache_file.fsize); hmcdrv_cache_get()
119 * (hmcdrv_cache_file.len > 0), is large enough to handle the hmcdrv_cache_do()
120 * request (hmcdrv_cache_file.len >= ftp->len) and there is a need hmcdrv_cache_do()
123 if ((ftp->len > 0) && (hmcdrv_cache_file.len >= ftp->len)) { hmcdrv_cache_do()
130 cftp.buf = hmcdrv_cache_file.content; /* and update */ hmcdrv_cache_do()
131 cftp.len = hmcdrv_cache_file.len; /* buffer data */ hmcdrv_cache_do()
133 len = func(&cftp, &hmcdrv_cache_file.fsize); /* now do */ hmcdrv_cache_do()
142 hmcdrv_cache_file.ofs = ftp->ofs; hmcdrv_cache_do()
143 hmcdrv_cache_file.timeout = jiffies + hmcdrv_cache_do()
145 memcpy(ftp->buf, hmcdrv_cache_file.content, len); hmcdrv_cache_do()
148 len = func(ftp, &hmcdrv_cache_file.fsize); hmcdrv_cache_do()
149 hmcdrv_cache_file.ofs = -1; /* invalidate content */ hmcdrv_cache_do()
156 strlcpy(hmcdrv_cache_file.fname, ftp->fname, hmcdrv_cache_do()
158 hmcdrv_cache_file.id = ftp->id; hmcdrv_cache_do()
160 ftp->id, hmcdrv_cache_file.fsize, ftp->fname); hmcdrv_cache_do()
202 hmcdrv_cache_file.id = HMCDRV_FTP_NOOP; hmcdrv_cache_cmd()
203 hmcdrv_cache_file.fsize = LLONG_MAX; hmcdrv_cache_cmd()
204 hmcdrv_cache_file.ofs = -1; hmcdrv_cache_cmd()
219 hmcdrv_cache_file.content = hmcdrv_cache_startup()
223 if (!hmcdrv_cache_file.content) { hmcdrv_cache_startup()
233 hmcdrv_cache_file.len = cachesize; hmcdrv_cache_startup()
242 if (hmcdrv_cache_file.content) { hmcdrv_cache_shutdown()
243 free_pages((unsigned long) hmcdrv_cache_file.content, hmcdrv_cache_shutdown()
245 hmcdrv_cache_file.content = NULL; hmcdrv_cache_shutdown()
248 hmcdrv_cache_file.id = HMCDRV_FTP_NOOP; hmcdrv_cache_shutdown()
249 hmcdrv_cache_file.fsize = LLONG_MAX; hmcdrv_cache_shutdown()
250 hmcdrv_cache_file.ofs = -1; hmcdrv_cache_shutdown()
251 hmcdrv_cache_file.len = 0; /* no cache */ hmcdrv_cache_shutdown()

Completed in 216 milliseconds