Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39655164 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds
Browse files

exportfs: make struct export_operations const



Now that nfsd has stopped writing to the find_exported_dentry member we an
mark the export_operations const

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: Neil Brown <neilb@suse.de>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: <linux-ext4@vger.kernel.org>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Anton Altaparmakov <aia21@cantab.net>
Cc: David Chinner <dgc@sgi.com>
Cc: Timothy Shimmin <tes@sgi.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Chris Mason <mason@suse.com>
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cfaea787
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -103,7 +103,7 @@ extern int cifs_ioctl(struct inode *inode, struct file *filep,
		       unsigned int command, unsigned long arg);
		       unsigned int command, unsigned long arg);


#ifdef CONFIG_CIFS_EXPERIMENTAL
#ifdef CONFIG_CIFS_EXPERIMENTAL
extern struct export_operations cifs_export_ops;
extern const struct export_operations cifs_export_ops;
#endif /* EXPERIMENTAL */
#endif /* EXPERIMENTAL */


#define CIFS_VERSION   "1.51"
#define CIFS_VERSION   "1.51"
+1 −1
Original line number Original line Diff line number Diff line
@@ -53,7 +53,7 @@ static struct dentry *cifs_get_parent(struct dentry *dentry)
	return ERR_PTR(-EACCES);
	return ERR_PTR(-EACCES);
}
}


struct export_operations cifs_export_ops = {
const struct export_operations cifs_export_ops = {
	.get_parent = cifs_get_parent,
	.get_parent = cifs_get_parent,
/*	Following five export operations are unneeded so far and can default:
/*	Following five export operations are unneeded so far and can default:
	.get_dentry =
	.get_dentry =
+1 −1
Original line number Original line Diff line number Diff line
@@ -113,7 +113,7 @@ static const struct super_operations efs_superblock_operations = {
	.remount_fs	= efs_remount,
	.remount_fs	= efs_remount,
};
};


static struct export_operations efs_export_ops = {
static const struct export_operations efs_export_ops = {
	.fh_to_dentry	= efs_fh_to_dentry,
	.fh_to_dentry	= efs_fh_to_dentry,
	.fh_to_parent	= efs_fh_to_parent,
	.fh_to_parent	= efs_fh_to_parent,
	.get_parent	= efs_get_parent,
	.get_parent	= efs_get_parent,
+3 −3
Original line number Original line Diff line number Diff line
@@ -16,7 +16,7 @@ static int get_name(struct dentry *dentry, char *name,
static int exportfs_get_name(struct dentry *dir, char *name,
static int exportfs_get_name(struct dentry *dir, char *name,
		struct dentry *child)
		struct dentry *child)
{
{
	struct export_operations *nop = dir->d_sb->s_export_op;
	const struct export_operations *nop = dir->d_sb->s_export_op;


	if (nop->get_name)
	if (nop->get_name)
		return nop->get_name(dir, name, child);
		return nop->get_name(dir, name, child);
@@ -333,7 +333,7 @@ static int export_encode_fh(struct dentry *dentry, struct fid *fid,
int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len,
int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len,
		int connectable)
		int connectable)
{
{
 	struct export_operations *nop = dentry->d_sb->s_export_op;
	const struct export_operations *nop = dentry->d_sb->s_export_op;
	int error;
	int error;


	if (nop->encode_fh)
	if (nop->encode_fh)
@@ -349,7 +349,7 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
		int fh_len, int fileid_type,
		int fh_len, int fileid_type,
		int (*acceptable)(void *, struct dentry *), void *context)
		int (*acceptable)(void *, struct dentry *), void *context)
{
{
	struct export_operations *nop = mnt->mnt_sb->s_export_op;
	const struct export_operations *nop = mnt->mnt_sb->s_export_op;
	struct dentry *result, *alias;
	struct dentry *result, *alias;
	int err;
	int err;


+1 −1
Original line number Original line Diff line number Diff line
@@ -357,7 +357,7 @@ static struct dentry *ext2_fh_to_parent(struct super_block *sb, struct fid *fid,
 * systems, but can be improved upon.
 * systems, but can be improved upon.
 * Currently only get_parent is required.
 * Currently only get_parent is required.
 */
 */
static struct export_operations ext2_export_ops = {
static const struct export_operations ext2_export_ops = {
	.fh_to_dentry = ext2_fh_to_dentry,
	.fh_to_dentry = ext2_fh_to_dentry,
	.fh_to_parent = ext2_fh_to_parent,
	.fh_to_parent = ext2_fh_to_parent,
	.get_parent = ext2_get_parent,
	.get_parent = ext2_get_parent,
Loading