Skip to contentSkip to conversation

linux 2.6.18: constify instances of 'struct file_operations'

PATCH In review Jan Beulich 1 participant 1 message Mar 5, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/10 linux 2.6.18: constify instances of 'struct file_operations'

drivers/char/mem.c +1 -1
Index: head-2007-02-27/drivers/char/mem.c
===================================================================
@@ -787,7 +787,7 @@ static const struct file_operations mem_
 	.open		= open_mem,
 };
 #else
-extern struct file_operations mem_fops;
+extern const struct file_operations mem_fops;
 #endif
 
 static const struct file_operations kmem_fops = {
drivers/xen/blktap/blktap.c +1 -1
Index: head-2007-02-27/drivers/xen/blktap/blktap.c
===================================================================
@@ -335,7 +335,7 @@ static int blktap_ioctl(struct inode *in
                         unsigned int cmd, unsigned long arg);
 static unsigned int blktap_poll(struct file *file, poll_table *wait);
 
-static struct file_operations blktap_fops = {
+static const struct file_operations blktap_fops = {
 	.owner   = THIS_MODULE,
 	.poll    = blktap_poll,
 	.ioctl   = blktap_ioctl,
drivers/xen/char/mem.c +1 -1
Index: head-2007-02-27/drivers/xen/char/mem.c
===================================================================
@@ -194,7 +194,7 @@ static int open_mem(struct inode * inode
 	return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
 }
 
-struct file_operations mem_fops = {
+const struct file_operations mem_fops = {
 	.llseek		= memory_lseek,
 	.read		= read_mem,
 	.write		= write_mem,
drivers/xen/evtchn/evtchn.c +1 -1
Index: head-2007-02-27/drivers/xen/evtchn/evtchn.c
===================================================================
@@ -406,7 +406,7 @@ static int evtchn_release(struct inode *
 	return 0;
 }
 
-static struct file_operations evtchn_fops = {
+static const struct file_operations evtchn_fops = {
 	.owner   = THIS_MODULE,
 	.read    = evtchn_read,
 	.write   = evtchn_write,
drivers/xen/privcmd/privcmd.c +1 -1
Index: head-2007-02-27/drivers/xen/privcmd/privcmd.c
===================================================================
@@ -248,7 +248,7 @@ static int privcmd_enforce_singleshot_ma
 }
 #endif
 
-static struct file_operations privcmd_file_ops = {
+static const struct file_operations privcmd_file_ops = {
 	.ioctl = privcmd_ioctl,
 	.mmap  = privcmd_mmap,
 };
drivers/xen/tpmback/tpmback.c +1 -1
Index: head-2007-02-27/drivers/xen/tpmback/tpmback.c
===================================================================
@@ -629,7 +629,7 @@ static unsigned int vtpm_op_poll(struct 
 	return flags;
 }
 
-static struct file_operations vtpm_ops = {
+static const struct file_operations vtpm_ops = {
 	.owner = THIS_MODULE,
 	.llseek = no_llseek,
 	.open = vtpm_op_open,
drivers/xen/xenbus/xenbus_dev.c +1 -1
Index: head-2007-02-27/drivers/xen/xenbus/xenbus_dev.c
===================================================================
@@ -342,7 +342,7 @@ static unsigned int xenbus_dev_poll(stru
 	return 0;
 }
 
-static struct file_operations xenbus_dev_file_ops = {
+static const struct file_operations xenbus_dev_file_ops = {
 	.read = xenbus_dev_read,
 	.write = xenbus_dev_write,
 	.open = xenbus_dev_open,
../patches/linux-2.6.18/blktap-aio-16_03_06.patch +5 -5
Index: head-2007-02-27/../patches/linux-2.6.18/blktap-aio-16_03_06.patch
===================================================================
@@ -106,7 +106,7 @@ static unsigned int aio_queue_fd_poll(st
 +	return pollflags;
 +}
 +
-+static struct file_operations aioq_fops = {
++static const struct file_operations aioq_fops = {
 +	.release	= aio_queue_fd_close,
 +	.poll		= aio_queue_fd_poll
 +};
@@ -201,7 +201,7 @@ static int ep_events_transfer(struct eve
  		   int maxevents, long timeout);
  static int eventpollfs_delete_dentry(struct dentry *dentry);
 -static struct inode *ep_eventpoll_inode(void);
-+static struct inode *ep_eventpoll_inode(struct file_operations *fops);
++static struct inode *ep_eventpoll_inode(const struct file_operations *fops);
  static int eventpollfs_get_sb(struct file_system_type *fs_type,
  			      int flags, const char *dev_name,
  			      void *data, struct vfsmount *mnt);
@@ -221,7 +221,7 @@ asmlinkage long sys_epoll_pwait(int epfd
 -static int ep_getfd(int *efd, struct inode **einode, struct file **efile,
 -		    struct eventpoll *ep)
 +int ep_getfd(int *efd, struct inode **einode, struct file **efile,
-+		    struct eventpoll *ep, struct file_operations *fops)
++		    struct eventpoll *ep, const struct file_operations *fops)
  {
  	struct qstr this;
  	char name[32];
@@ -248,7 +248,7 @@ static int eventpollfs_delete_dentry(str
  
  
 -static struct inode *ep_eventpoll_inode(void)
-+static struct inode *ep_eventpoll_inode(struct file_operations *fops)
++static struct inode *ep_eventpoll_inode(const struct file_operations *fops)
  {
  	int error = -ENOMEM;
  	struct inode *inode = new_inode(eventpoll_mnt->mnt_sb);
@@ -288,7 +288,7 @@ static inline void eventpoll_release(str
 + */
 +struct eventpoll;
 +int ep_getfd(int *efd, struct inode **einode, struct file **efile,
-+             struct eventpoll *ep, struct file_operations *fops);
++             struct eventpoll *ep, const struct file_operations *fops);
  #else
  
  static inline void eventpoll_init_file(struct file *file) {}