mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
constify dentry argument of dentry_path()/dentry_path_raw()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
a38fd87484
commit
a2bbe66493
2 changed files with 7 additions and 7 deletions
10
fs/d_path.c
10
fs/d_path.c
|
@ -326,9 +326,9 @@ char *simple_dname(struct dentry *dentry, char *buffer, int buflen)
|
||||||
/*
|
/*
|
||||||
* Write full pathname from the root of the filesystem into the buffer.
|
* Write full pathname from the root of the filesystem into the buffer.
|
||||||
*/
|
*/
|
||||||
static char *__dentry_path(struct dentry *d, char *buf, int buflen)
|
static char *__dentry_path(const struct dentry *d, char *buf, int buflen)
|
||||||
{
|
{
|
||||||
struct dentry *dentry;
|
const struct dentry *dentry;
|
||||||
char *end, *retval;
|
char *end, *retval;
|
||||||
int len, seq = 0;
|
int len, seq = 0;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
@ -347,7 +347,7 @@ restart:
|
||||||
*retval = '/';
|
*retval = '/';
|
||||||
read_seqbegin_or_lock(&rename_lock, &seq);
|
read_seqbegin_or_lock(&rename_lock, &seq);
|
||||||
while (!IS_ROOT(dentry)) {
|
while (!IS_ROOT(dentry)) {
|
||||||
struct dentry *parent = dentry->d_parent;
|
const struct dentry *parent = dentry->d_parent;
|
||||||
|
|
||||||
prefetch(parent);
|
prefetch(parent);
|
||||||
error = prepend_name(&end, &len, &dentry->d_name);
|
error = prepend_name(&end, &len, &dentry->d_name);
|
||||||
|
@ -371,13 +371,13 @@ Elong:
|
||||||
return ERR_PTR(-ENAMETOOLONG);
|
return ERR_PTR(-ENAMETOOLONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *dentry_path_raw(struct dentry *dentry, char *buf, int buflen)
|
char *dentry_path_raw(const struct dentry *dentry, char *buf, int buflen)
|
||||||
{
|
{
|
||||||
return __dentry_path(dentry, buf, buflen);
|
return __dentry_path(dentry, buf, buflen);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(dentry_path_raw);
|
EXPORT_SYMBOL(dentry_path_raw);
|
||||||
|
|
||||||
char *dentry_path(struct dentry *dentry, char *buf, int buflen)
|
char *dentry_path(const struct dentry *dentry, char *buf, int buflen)
|
||||||
{
|
{
|
||||||
char *p = NULL;
|
char *p = NULL;
|
||||||
char *retval;
|
char *retval;
|
||||||
|
|
|
@ -300,8 +300,8 @@ char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
|
||||||
extern char *__d_path(const struct path *, const struct path *, char *, int);
|
extern char *__d_path(const struct path *, const struct path *, char *, int);
|
||||||
extern char *d_absolute_path(const struct path *, char *, int);
|
extern char *d_absolute_path(const struct path *, char *, int);
|
||||||
extern char *d_path(const struct path *, char *, int);
|
extern char *d_path(const struct path *, char *, int);
|
||||||
extern char *dentry_path_raw(struct dentry *, char *, int);
|
extern char *dentry_path_raw(const struct dentry *, char *, int);
|
||||||
extern char *dentry_path(struct dentry *, char *, int);
|
extern char *dentry_path(const struct dentry *, char *, int);
|
||||||
|
|
||||||
/* Allocation counts.. */
|
/* Allocation counts.. */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue