Skip to content

Commit 4c0ed7d

Browse files
committed
Merge tag 'pull-path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs constification updates from Al Viro: "whack-a-mole: constifying struct path *" * tag 'pull-path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: ecryptfs: constify path spufs: constify path nd_jump_link(): constify path audit_init_parent(): constify path __io_setxattr(): constify path do_proc_readlink(): constify path overlayfs: constify path fs/notify: constify path may_linkat(): constify path do_sys_name_to_handle(): constify path ->getprocattr(): attribute name is const char *, TYVM...
2 parents 1586a70 + 8856954 commit 4c0ed7d

File tree

30 files changed

+70
-70
lines changed

30 files changed

+70
-70
lines changed

arch/powerpc/platforms/cell/spufs/inode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags,
275275
return ret;
276276
}
277277

278-
static int spufs_context_open(struct path *path)
278+
static int spufs_context_open(const struct path *path)
279279
{
280280
int ret;
281281
struct file *filp;
@@ -491,7 +491,7 @@ spufs_mkgang(struct inode *dir, struct dentry *dentry, umode_t mode)
491491
return ret;
492492
}
493493

494-
static int spufs_gang_open(struct path *path)
494+
static int spufs_gang_open(const struct path *path)
495495
{
496496
int ret;
497497
struct file *filp;
@@ -536,7 +536,7 @@ static int spufs_create_gang(struct inode *inode,
536536

537537
static struct file_system_type spufs_type;
538538

539-
long spufs_create(struct path *path, struct dentry *dentry,
539+
long spufs_create(const struct path *path, struct dentry *dentry,
540540
unsigned int flags, umode_t mode, struct file *filp)
541541
{
542542
struct inode *dir = d_inode(path->dentry);

arch/powerpc/platforms/cell/spufs/spufs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ extern const struct spufs_tree_descr spufs_dir_debug_contents[];
232232
extern struct spufs_calls spufs_calls;
233233
struct coredump_params;
234234
long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status);
235-
long spufs_create(struct path *nd, struct dentry *dentry, unsigned int flags,
235+
long spufs_create(const struct path *nd, struct dentry *dentry, unsigned int flags,
236236
umode_t mode, struct file *filp);
237237
/* ELF coredump callbacks for writing SPU ELF notes */
238238
extern int spufs_coredump_extra_notes_size(void);

fs/ecryptfs/ecryptfs_kernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ ecryptfs_dentry_to_lower(struct dentry *dentry)
506506
return ((struct ecryptfs_dentry_info *)dentry->d_fsdata)->lower_path.dentry;
507507
}
508508

509-
static inline struct path *
509+
static inline const struct path *
510510
ecryptfs_dentry_to_lower_path(struct dentry *dentry)
511511
{
512512
return &((struct ecryptfs_dentry_info *)dentry->d_fsdata)->lower_path;

fs/ecryptfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
3333
struct iov_iter *to)
3434
{
3535
ssize_t rc;
36-
struct path *path;
36+
const struct path *path;
3737
struct file *file = iocb->ki_filp;
3838

3939
rc = generic_file_read_iter(iocb, to);

fs/ecryptfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode)
317317
static struct dentry *ecryptfs_lookup_interpose(struct dentry *dentry,
318318
struct dentry *lower_dentry)
319319
{
320-
struct path *path = ecryptfs_dentry_to_lower_path(dentry->d_parent);
320+
const struct path *path = ecryptfs_dentry_to_lower_path(dentry->d_parent);
321321
struct inode *inode, *lower_inode;
322322
struct ecryptfs_dentry_info *dentry_info;
323323
int rc = 0;

fs/ecryptfs/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static int ecryptfs_init_lower_file(struct dentry *dentry,
105105
struct file **lower_file)
106106
{
107107
const struct cred *cred = current_cred();
108-
struct path *path = ecryptfs_dentry_to_lower_path(dentry);
108+
const struct path *path = ecryptfs_dentry_to_lower_path(dentry);
109109
int rc;
110110

111111
rc = ecryptfs_privileged_open(lower_file, path->dentry, path->mnt,

fs/fhandle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "internal.h"
1515
#include "mount.h"
1616

17-
static long do_sys_name_to_handle(struct path *path,
17+
static long do_sys_name_to_handle(const struct path *path,
1818
struct file_handle __user *ufh,
1919
int __user *mnt_id)
2020
{

fs/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
6363
const char *, unsigned int, struct path *);
6464
int do_rmdir(int dfd, struct filename *name);
6565
int do_unlinkat(int dfd, struct filename *name);
66-
int may_linkat(struct user_namespace *mnt_userns, struct path *link);
66+
int may_linkat(struct user_namespace *mnt_userns, const struct path *link);
6767
int do_renameat2(int olddfd, struct filename *oldname, int newdfd,
6868
struct filename *newname, unsigned int flags);
6969
int do_mkdirat(int dfd, struct filename *name, umode_t mode);

fs/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ static int nd_jump_root(struct nameidata *nd)
986986
* Helper to directly jump to a known parsed path from ->get_link,
987987
* caller must have taken a reference to path beforehand.
988988
*/
989-
int nd_jump_link(struct path *path)
989+
int nd_jump_link(const struct path *path)
990990
{
991991
int error = -ELOOP;
992992
struct nameidata *nd = current->nameidata;
@@ -1178,7 +1178,7 @@ static bool safe_hardlink_source(struct user_namespace *mnt_userns,
11781178
*
11791179
* Returns 0 if successful, -ve on error.
11801180
*/
1181-
int may_linkat(struct user_namespace *mnt_userns, struct path *link)
1181+
int may_linkat(struct user_namespace *mnt_userns, const struct path *link)
11821182
{
11831183
struct inode *inode = link->dentry->d_inode;
11841184

fs/notify/fanotify/fanotify.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include "fanotify.h"
2020

21-
static bool fanotify_path_equal(struct path *p1, struct path *p2)
21+
static bool fanotify_path_equal(const struct path *p1, const struct path *p2)
2222
{
2323
return p1->mnt == p2->mnt && p1->dentry == p2->dentry;
2424
}

0 commit comments

Comments
 (0)