Skip to content

Commit 3965516

Browse files
Christoph HellwigLinus Torvalds
authored andcommitted
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: Christoph 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent cfaea78 commit 3965516

22 files changed

Lines changed: 25 additions & 25 deletions

File tree

‎fs/cifs/cifsfs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ extern int cifs_ioctl(struct inode *inode, struct file *filep,
103103
unsigned int command, unsigned long arg);
104104

105105
#ifdef CONFIG_CIFS_EXPERIMENTAL
106-
extern struct export_operations cifs_export_ops;
106+
extern const struct export_operations cifs_export_ops;
107107
#endif /* EXPERIMENTAL */
108108

109109
#define CIFS_VERSION "1.51"

‎fs/cifs/export.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static struct dentry *cifs_get_parent(struct dentry *dentry)
5353
return ERR_PTR(-EACCES);
5454
}
5555

56-
struct export_operations cifs_export_ops = {
56+
const struct export_operations cifs_export_ops = {
5757
.get_parent = cifs_get_parent,
5858
/* Following five export operations are unneeded so far and can default:
5959
.get_dentry =

‎fs/efs/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static const struct super_operations efs_superblock_operations = {
113113
.remount_fs = efs_remount,
114114
};
115115

116-
static struct export_operations efs_export_ops = {
116+
static const struct export_operations efs_export_ops = {
117117
.fh_to_dentry = efs_fh_to_dentry,
118118
.fh_to_parent = efs_fh_to_parent,
119119
.get_parent = efs_get_parent,

‎fs/exportfs/expfs.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static int get_name(struct dentry *dentry, char *name,
1616
static int exportfs_get_name(struct dentry *dir, char *name,
1717
struct dentry *child)
1818
{
19-
struct export_operations *nop = dir->d_sb->s_export_op;
19+
const struct export_operations *nop = dir->d_sb->s_export_op;
2020

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

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

‎fs/ext2/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ static struct dentry *ext2_fh_to_parent(struct super_block *sb, struct fid *fid,
357357
* systems, but can be improved upon.
358358
* Currently only get_parent is required.
359359
*/
360-
static struct export_operations ext2_export_ops = {
360+
static const struct export_operations ext2_export_ops = {
361361
.fh_to_dentry = ext2_fh_to_dentry,
362362
.fh_to_parent = ext2_fh_to_parent,
363363
.get_parent = ext2_get_parent,

‎fs/ext3/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ static const struct super_operations ext3_sops = {
741741
#endif
742742
};
743743

744-
static struct export_operations ext3_export_ops = {
744+
static const struct export_operations ext3_export_ops = {
745745
.fh_to_dentry = ext3_fh_to_dentry,
746746
.fh_to_parent = ext3_fh_to_parent,
747747
.get_parent = ext3_get_parent,

‎fs/ext4/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ static const struct super_operations ext4_sops = {
796796
#endif
797797
};
798798

799-
static struct export_operations ext4_export_ops = {
799+
static const struct export_operations ext4_export_ops = {
800800
.fh_to_dentry = ext4_fh_to_dentry,
801801
.fh_to_parent = ext4_fh_to_parent,
802802
.get_parent = ext4_get_parent,

‎fs/fat/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ static struct dentry *fat_get_parent(struct dentry *child)
774774
return parent;
775775
}
776776

777-
static struct export_operations fat_export_ops = {
777+
static const struct export_operations fat_export_ops = {
778778
.encode_fh = fat_encode_fh,
779779
.fh_to_dentry = fat_fh_to_dentry,
780780
.get_parent = fat_get_parent,

‎fs/gfs2/ops_export.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static struct dentry *gfs2_fh_to_parent(struct super_block *sb, struct fid *fid,
294294
}
295295
}
296296

297-
struct export_operations gfs2_export_ops = {
297+
const struct export_operations gfs2_export_ops = {
298298
.encode_fh = gfs2_encode_fh,
299299
.fh_to_dentry = gfs2_fh_to_dentry,
300300
.fh_to_parent = gfs2_fh_to_parent,

‎fs/gfs2/ops_fstype.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
extern struct file_system_type gfs2_fs_type;
1616
extern struct file_system_type gfs2meta_fs_type;
17-
extern struct export_operations gfs2_export_ops;
17+
extern const struct export_operations gfs2_export_ops;
1818

1919
#endif /* __OPS_FSTYPE_DOT_H__ */

0 commit comments

Comments
 (0)