Lines Matching refs:buflen
11 static int prepend(char **buffer, int *buflen, const char *str, int namelen) in prepend() argument
13 *buflen -= namelen; in prepend()
14 if (*buflen < 0) in prepend()
38 static int prepend_name(char **buffer, int *buflen, const struct qstr *name) in prepend_name() argument
44 *buflen -= dlen + 1; in prepend_name()
45 if (*buflen < 0) in prepend_name()
77 char **buffer, int *buflen) in prepend_path() argument
94 blen = *buflen; in prepend_path()
108 blen = *buflen; in prepend_path()
156 *buflen = blen; in prepend_path()
178 char *buf, int buflen) in __d_path() argument
180 char *res = buf + buflen; in __d_path()
183 prepend(&res, &buflen, "\0", 1); in __d_path()
184 error = prepend_path(path, root, &res, &buflen); in __d_path()
194 char *buf, int buflen) in d_absolute_path() argument
197 char *res = buf + buflen; in d_absolute_path()
200 prepend(&res, &buflen, "\0", 1); in d_absolute_path()
201 error = prepend_path(path, &root, &res, &buflen); in d_absolute_path()
215 char **buf, int *buflen) in path_with_deleted() argument
217 prepend(buf, buflen, "\0", 1); in path_with_deleted()
219 int error = prepend(buf, buflen, " (deleted)", 10); in path_with_deleted()
224 return prepend_path(path, root, buf, buflen); in path_with_deleted()
227 static int prepend_unreachable(char **buffer, int *buflen) in prepend_unreachable() argument
229 return prepend(buffer, buflen, "(unreachable)", 13); in prepend_unreachable()
258 char *d_path(const struct path *path, char *buf, int buflen) in d_path() argument
260 char *res = buf + buflen; in d_path()
277 return path->dentry->d_op->d_dname(path->dentry, buf, buflen); in d_path()
281 error = path_with_deleted(path, &root, &res, &buflen); in d_path()
293 char *dynamic_dname(struct dentry *dentry, char *buffer, int buflen, in dynamic_dname() argument
304 if (sz > sizeof(temp) || sz > buflen) in dynamic_dname()
307 buffer += buflen - sz; in dynamic_dname()
311 char *simple_dname(struct dentry *dentry, char *buffer, int buflen) in simple_dname() argument
313 char *end = buffer + buflen; in simple_dname()
315 if (prepend(&end, &buflen, " (deleted)", 11) || in simple_dname()
316 prepend(&end, &buflen, dentry->d_name.name, dentry->d_name.len) || in simple_dname()
317 prepend(&end, &buflen, "/", 1)) in simple_dname()
325 static char *__dentry_path(struct dentry *d, char *buf, int buflen) in __dentry_path() argument
332 if (buflen < 2) in __dentry_path()
338 end = buf + buflen; in __dentry_path()
339 len = buflen; in __dentry_path()
370 char *dentry_path_raw(struct dentry *dentry, char *buf, int buflen) in dentry_path_raw() argument
372 return __dentry_path(dentry, buf, buflen); in dentry_path_raw()
376 char *dentry_path(struct dentry *dentry, char *buf, int buflen) in dentry_path() argument
382 p = buf + buflen; in dentry_path()
383 if (prepend(&p, &buflen, "//deleted", 10) != 0) in dentry_path()
385 buflen++; in dentry_path()
387 retval = __dentry_path(dentry, buf, buflen); in dentry_path()
441 int buflen = PATH_MAX; in SYSCALL_DEFINE2() local
443 prepend(&cwd, &buflen, "\0", 1); in SYSCALL_DEFINE2()
444 error = prepend_path(&pwd, &root, &cwd, &buflen); in SYSCALL_DEFINE2()
452 error = prepend_unreachable(&cwd, &buflen); in SYSCALL_DEFINE2()