Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christoph Hellwig and committed by
Linus Torvalds
39655164 cfaea787

+25 -25
+1 -1
fs/cifs/cifsfs.h
··· 103 103 unsigned int command, unsigned long arg); 104 104 105 105 #ifdef CONFIG_CIFS_EXPERIMENTAL 106 - extern struct export_operations cifs_export_ops; 106 + extern const struct export_operations cifs_export_ops; 107 107 #endif /* EXPERIMENTAL */ 108 108 109 109 #define CIFS_VERSION "1.51"
+1 -1
fs/cifs/export.c
··· 53 53 return ERR_PTR(-EACCES); 54 54 } 55 55 56 - struct export_operations cifs_export_ops = { 56 + const struct export_operations cifs_export_ops = { 57 57 .get_parent = cifs_get_parent, 58 58 /* Following five export operations are unneeded so far and can default: 59 59 .get_dentry =
+1 -1
fs/efs/super.c
··· 113 113 .remount_fs = efs_remount, 114 114 }; 115 115 116 - static struct export_operations efs_export_ops = { 116 + static const struct export_operations efs_export_ops = { 117 117 .fh_to_dentry = efs_fh_to_dentry, 118 118 .fh_to_parent = efs_fh_to_parent, 119 119 .get_parent = efs_get_parent,
+3 -3
fs/exportfs/expfs.c
··· 16 16 static int exportfs_get_name(struct dentry *dir, char *name, 17 17 struct dentry *child) 18 18 { 19 - struct export_operations *nop = dir->d_sb->s_export_op; 19 + const struct export_operations *nop = dir->d_sb->s_export_op; 20 20 21 21 if (nop->get_name) 22 22 return nop->get_name(dir, name, child); ··· 333 333 int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len, 334 334 int connectable) 335 335 { 336 - struct export_operations *nop = dentry->d_sb->s_export_op; 336 + const struct export_operations *nop = dentry->d_sb->s_export_op; 337 337 int error; 338 338 339 339 if (nop->encode_fh) ··· 349 349 int fh_len, int fileid_type, 350 350 int (*acceptable)(void *, struct dentry *), void *context) 351 351 { 352 - struct export_operations *nop = mnt->mnt_sb->s_export_op; 352 + const struct export_operations *nop = mnt->mnt_sb->s_export_op; 353 353 struct dentry *result, *alias; 354 354 int err; 355 355
+1 -1
fs/ext2/super.c
··· 357 357 * systems, but can be improved upon. 358 358 * Currently only get_parent is required. 359 359 */ 360 - static struct export_operations ext2_export_ops = { 360 + static const struct export_operations ext2_export_ops = { 361 361 .fh_to_dentry = ext2_fh_to_dentry, 362 362 .fh_to_parent = ext2_fh_to_parent, 363 363 .get_parent = ext2_get_parent,
+1 -1
fs/ext3/super.c
··· 741 741 #endif 742 742 }; 743 743 744 - static struct export_operations ext3_export_ops = { 744 + static const struct export_operations ext3_export_ops = { 745 745 .fh_to_dentry = ext3_fh_to_dentry, 746 746 .fh_to_parent = ext3_fh_to_parent, 747 747 .get_parent = ext3_get_parent,
+1 -1
fs/ext4/super.c
··· 796 796 #endif 797 797 }; 798 798 799 - static struct export_operations ext4_export_ops = { 799 + static const struct export_operations ext4_export_ops = { 800 800 .fh_to_dentry = ext4_fh_to_dentry, 801 801 .fh_to_parent = ext4_fh_to_parent, 802 802 .get_parent = ext4_get_parent,
+1 -1
fs/fat/inode.c
··· 774 774 return parent; 775 775 } 776 776 777 - static struct export_operations fat_export_ops = { 777 + static const struct export_operations fat_export_ops = { 778 778 .encode_fh = fat_encode_fh, 779 779 .fh_to_dentry = fat_fh_to_dentry, 780 780 .get_parent = fat_get_parent,
+1 -1
fs/gfs2/ops_export.c
··· 294 294 } 295 295 } 296 296 297 - struct export_operations gfs2_export_ops = { 297 + const struct export_operations gfs2_export_ops = { 298 298 .encode_fh = gfs2_encode_fh, 299 299 .fh_to_dentry = gfs2_fh_to_dentry, 300 300 .fh_to_parent = gfs2_fh_to_parent,
+1 -1
fs/gfs2/ops_fstype.h
··· 14 14 15 15 extern struct file_system_type gfs2_fs_type; 16 16 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; 18 18 19 19 #endif /* __OPS_FSTYPE_DOT_H__ */
+1 -1
fs/isofs/export.c
··· 207 207 fh_len > 4 ? ifid->parent_generation : 0); 208 208 } 209 209 210 - struct export_operations isofs_export_ops = { 210 + const struct export_operations isofs_export_ops = { 211 211 .encode_fh = isofs_export_encode_fh, 212 212 .fh_to_dentry = isofs_fh_to_dentry, 213 213 .fh_to_parent = isofs_fh_to_parent,
+1 -1
fs/isofs/isofs.h
··· 178 178 extern const struct inode_operations isofs_dir_inode_operations; 179 179 extern const struct file_operations isofs_dir_operations; 180 180 extern const struct address_space_operations isofs_symlink_aops; 181 - extern struct export_operations isofs_export_ops; 181 + extern const struct export_operations isofs_export_ops;
+2 -2
fs/jfs/super.c
··· 48 48 static struct kmem_cache * jfs_inode_cachep; 49 49 50 50 static const struct super_operations jfs_super_operations; 51 - static struct export_operations jfs_export_operations; 51 + static const struct export_operations jfs_export_operations; 52 52 static struct file_system_type jfs_fs_type; 53 53 54 54 #define MAX_COMMIT_THREADS 64 ··· 737 737 #endif 738 738 }; 739 739 740 - static struct export_operations jfs_export_operations = { 740 + static const struct export_operations jfs_export_operations = { 741 741 .fh_to_dentry = jfs_fh_to_dentry, 742 742 .fh_to_parent = jfs_fh_to_parent, 743 743 .get_parent = jfs_get_parent,
+1 -1
fs/ntfs/namei.c
··· 499 499 * allowing the inode number 0 which is used in NTFS for the system file $MFT 500 500 * and due to using iget() whereas NTFS needs ntfs_iget(). 501 501 */ 502 - struct export_operations ntfs_export_ops = { 502 + const struct export_operations ntfs_export_ops = { 503 503 .get_parent = ntfs_get_parent, /* Find the parent of a given 504 504 directory. */ 505 505 .fh_to_dentry = ntfs_fh_to_dentry,
+1 -1
fs/ntfs/ntfs.h
··· 69 69 extern const struct file_operations ntfs_empty_file_ops; 70 70 extern const struct inode_operations ntfs_empty_inode_ops; 71 71 72 - extern struct export_operations ntfs_export_ops; 72 + extern const struct export_operations ntfs_export_ops; 73 73 74 74 /** 75 75 * NTFS_SB - return the ntfs volume given a vfs super block
+1 -1
fs/ocfs2/export.c
··· 222 222 return ocfs2_get_dentry(sb, &parent); 223 223 } 224 224 225 - struct export_operations ocfs2_export_ops = { 225 + const struct export_operations ocfs2_export_ops = { 226 226 .encode_fh = ocfs2_encode_fh, 227 227 .fh_to_dentry = ocfs2_fh_to_dentry, 228 228 .fh_to_parent = ocfs2_fh_to_parent,
+1 -1
fs/ocfs2/export.h
··· 28 28 29 29 #include <linux/exportfs.h> 30 30 31 - extern struct export_operations ocfs2_export_ops; 31 + extern const struct export_operations ocfs2_export_ops; 32 32 33 33 #endif /* OCFS2_EXPORT_H */
+1 -1
fs/reiserfs/super.c
··· 661 661 }; 662 662 #endif 663 663 664 - static struct export_operations reiserfs_export_ops = { 664 + static const struct export_operations reiserfs_export_ops = { 665 665 .encode_fh = reiserfs_encode_fh, 666 666 .fh_to_dentry = reiserfs_fh_to_dentry, 667 667 .fh_to_parent = reiserfs_fh_to_parent,
+1 -1
fs/xfs/linux-2.6/xfs_export.c
··· 220 220 return parent; 221 221 } 222 222 223 - struct export_operations xfs_export_operations = { 223 + const struct export_operations xfs_export_operations = { 224 224 .encode_fh = xfs_fs_encode_fh, 225 225 .fh_to_dentry = xfs_fs_fh_to_dentry, 226 226 .fh_to_parent = xfs_fs_fh_to_parent,
+1 -1
fs/xfs/linux-2.6/xfs_super.h
··· 118 118 extern void xfs_blkdev_put(struct block_device *); 119 119 extern void xfs_blkdev_issue_flush(struct xfs_buftarg *); 120 120 121 - extern struct export_operations xfs_export_operations; 121 + extern const struct export_operations xfs_export_operations; 122 122 123 123 #define XFS_M(sb) ((struct xfs_mount *)((sb)->s_fs_info)) 124 124
+1 -1
include/linux/fs.h
··· 987 987 const struct super_operations *s_op; 988 988 struct dquot_operations *dq_op; 989 989 struct quotactl_ops *s_qcop; 990 - struct export_operations *s_export_op; 990 + const struct export_operations *s_export_op; 991 991 unsigned long s_flags; 992 992 unsigned long s_magic; 993 993 struct dentry *s_root;
+1 -1
mm/shmem.c
··· 2071 2071 return 1; 2072 2072 } 2073 2073 2074 - static struct export_operations shmem_export_ops = { 2074 + static const struct export_operations shmem_export_ops = { 2075 2075 .get_parent = shmem_get_parent, 2076 2076 .encode_fh = shmem_encode_fh, 2077 2077 .fh_to_dentry = shmem_fh_to_dentry,