diff options
Diffstat (limited to 'fs/coda')
| -rw-r--r-- | fs/coda/cnode.c | 4 | ||||
| -rw-r--r-- | fs/coda/coda_int.h | 2 | ||||
| -rw-r--r-- | fs/coda/coda_linux.h | 10 | ||||
| -rw-r--r-- | fs/coda/dir.c | 24 | ||||
| -rw-r--r-- | fs/coda/file.c | 6 | ||||
| -rw-r--r-- | fs/coda/inode.c | 36 | ||||
| -rw-r--r-- | fs/coda/psdev.c | 39 | ||||
| -rw-r--r-- | fs/coda/sysctl.c | 4 | ||||
| -rw-r--r-- | fs/coda/upcall.c | 14 | 
9 files changed, 72 insertions, 67 deletions
diff --git a/fs/coda/cnode.c b/fs/coda/cnode.c index 911cf30d057..7740b1c871c 100644 --- a/fs/coda/cnode.c +++ b/fs/coda/cnode.c @@ -101,7 +101,7 @@ struct inode *coda_cnode_make(struct CodaFid *fid, struct super_block *sb)  	inode = coda_iget(sb, fid, &attr);  	if (IS_ERR(inode)) -		printk("coda_cnode_make: coda_iget failed\n"); +		pr_warn("%s: coda_iget failed\n", __func__);  	return inode;  } @@ -137,7 +137,7 @@ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)  	unsigned long hash = coda_f2i(fid);  	if ( !sb ) { -		printk("coda_fid_to_inode: no sb!\n"); +		pr_warn("%s: no sb!\n", __func__);  		return NULL;  	} diff --git a/fs/coda/coda_int.h b/fs/coda/coda_int.h index b7143cf783a..381c993b142 100644 --- a/fs/coda/coda_int.h +++ b/fs/coda/coda_int.h @@ -10,7 +10,7 @@ extern int coda_hard;  extern int coda_fake_statfs;  void coda_destroy_inodecache(void); -int coda_init_inodecache(void); +int __init coda_init_inodecache(void);  int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync);  void coda_sysctl_init(void);  void coda_sysctl_clean(void); diff --git a/fs/coda/coda_linux.h b/fs/coda/coda_linux.h index cc0ea9fe5ec..d42b725b1d2 100644 --- a/fs/coda/coda_linux.h +++ b/fs/coda/coda_linux.h @@ -12,6 +12,12 @@  #ifndef _LINUX_CODA_FS  #define _LINUX_CODA_FS +#ifdef pr_fmt +#undef pr_fmt +#endif + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +  #include <linux/kernel.h>  #include <linux/param.h>  #include <linux/mm.h> @@ -40,7 +46,7 @@ extern const struct file_operations coda_ioctl_operations;  int coda_open(struct inode *i, struct file *f);  int coda_release(struct inode *i, struct file *f);  int coda_permission(struct inode *inode, int mask); -int coda_revalidate_inode(struct dentry *); +int coda_revalidate_inode(struct inode *);  int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *);  int coda_setattr(struct dentry *, struct iattr *); @@ -63,7 +69,7 @@ void coda_sysctl_clean(void);      else \          ptr = (cast)vzalloc((unsigned long) size); \      if (!ptr) \ -        printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \ +	pr_warn("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \  } while (0) diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 190effc6a6f..cd8a63238b1 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c @@ -102,7 +102,7 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, unsig  	int type = 0;  	if (length > CODA_MAXNAMLEN) { -		printk(KERN_ERR "name too long: lookup, %s (%*s)\n", +		pr_err("name too long: lookup, %s (%*s)\n",  		       coda_i2s(dir), (int)length, name);  		return ERR_PTR(-ENAMETOOLONG);  	} @@ -387,9 +387,6 @@ static int coda_readdir(struct file *coda_file, struct dir_context *ctx)  	BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);  	host_file = cfi->cfi_container; -	if (!host_file->f_op) -		return -ENOTDIR; -  	if (host_file->f_op->iterate) {  		struct inode *host_inode = file_inode(host_file);  		mutex_lock(&host_inode->i_mutex); @@ -456,23 +453,23 @@ static int coda_venus_readdir(struct file *coda_file, struct dir_context *ctx)  		ret = kernel_read(host_file, ctx->pos - 2, (char *)vdir,  				  sizeof(*vdir));  		if (ret < 0) { -			printk(KERN_ERR "coda readdir: read dir %s failed %d\n", -			       coda_f2s(&cii->c_fid), ret); +			pr_err("%s: read dir %s failed %d\n", +			       __func__, coda_f2s(&cii->c_fid), ret);  			break;  		}  		if (ret == 0) break; /* end of directory file reached */  		/* catch truncated reads */  		if (ret < vdir_size || ret < vdir_size + vdir->d_namlen) { -			printk(KERN_ERR "coda readdir: short read on %s\n", -			       coda_f2s(&cii->c_fid)); +			pr_err("%s: short read on %s\n", +			       __func__, coda_f2s(&cii->c_fid));  			ret = -EBADF;  			break;  		}  		/* validate whether the directory file actually makes sense */  		if (vdir->d_reclen < vdir_size + vdir->d_namlen) { -			printk(KERN_ERR "coda readdir: invalid dir %s\n", -			       coda_f2s(&cii->c_fid)); +			pr_err("%s: invalid dir %s\n", +			       __func__, coda_f2s(&cii->c_fid));  			ret = -EBADF;  			break;  		} @@ -566,13 +563,12 @@ static int coda_dentry_delete(const struct dentry * dentry)   * cache manager Venus issues a downcall to the kernel when this    * happens    */ -int coda_revalidate_inode(struct dentry *dentry) +int coda_revalidate_inode(struct inode *inode)  {  	struct coda_vattr attr;  	int error;  	int old_mode;  	ino_t old_ino; -	struct inode *inode = dentry->d_inode;  	struct coda_inode_info *cii = ITOC(inode);  	if (!cii->c_flags) @@ -593,8 +589,8 @@ int coda_revalidate_inode(struct dentry *dentry)  		coda_vattr_to_iattr(inode, &attr);  		if ((old_mode & S_IFMT) != (inode->i_mode & S_IFMT)) { -			printk("Coda: inode %ld, fid %s changed type!\n", -			       inode->i_ino, coda_f2s(&(cii->c_fid))); +			pr_warn("inode %ld, fid %s changed type!\n", +				inode->i_ino, coda_f2s(&(cii->c_fid)));  		}  		/* the following can happen when a local fid is replaced  diff --git a/fs/coda/file.c b/fs/coda/file.c index 380b798f844..9e83b779021 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c @@ -36,7 +36,7 @@ coda_file_read(struct file *coda_file, char __user *buf, size_t count, loff_t *p  	BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);  	host_file = cfi->cfi_container; -	if (!host_file->f_op || !host_file->f_op->read) +	if (!host_file->f_op->read)  		return -EINVAL;  	return host_file->f_op->read(host_file, buf, count, ppos); @@ -75,7 +75,7 @@ coda_file_write(struct file *coda_file, const char __user *buf, size_t count, lo  	BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);  	host_file = cfi->cfi_container; -	if (!host_file->f_op || !host_file->f_op->write) +	if (!host_file->f_op->write)  		return -EINVAL;  	host_inode = file_inode(host_file); @@ -105,7 +105,7 @@ coda_file_mmap(struct file *coda_file, struct vm_area_struct *vma)  	BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);  	host_file = cfi->cfi_container; -	if (!host_file->f_op || !host_file->f_op->mmap) +	if (!host_file->f_op->mmap)  		return -ENODEV;  	coda_inode = file_inode(coda_file); diff --git a/fs/coda/inode.c b/fs/coda/inode.c index 4dcc0d81a7a..fe3afb2de88 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c @@ -73,7 +73,7 @@ static void init_once(void *foo)  	inode_init_once(&ei->vfs_inode);  } -int coda_init_inodecache(void) +int __init coda_init_inodecache(void)  {  	coda_inode_cachep = kmem_cache_create("coda_inode_cache",  				sizeof(struct coda_inode_info), @@ -96,6 +96,7 @@ void coda_destroy_inodecache(void)  static int coda_remount(struct super_block *sb, int *flags, char *data)  { +	sync_filesystem(sb);  	*flags |= MS_NOATIME;  	return 0;  } @@ -118,12 +119,12 @@ static int get_device_index(struct coda_mount_data *data)  	int idx;  	if (data == NULL) { -		printk("coda_read_super: Bad mount data\n"); +		pr_warn("%s: Bad mount data\n", __func__);  		return -1;  	}  	if (data->version != CODA_MOUNT_VERSION) { -		printk("coda_read_super: Bad mount version\n"); +		pr_warn("%s: Bad mount version\n", __func__);  		return -1;  	} @@ -140,13 +141,13 @@ static int get_device_index(struct coda_mount_data *data)  	fdput(f);  	if (idx < 0 || idx >= MAX_CODADEVS) { -		printk("coda_read_super: Bad minor number\n"); +		pr_warn("%s: Bad minor number\n", __func__);  		return -1;  	}  	return idx;  Ebadf: -	printk("coda_read_super: Bad file\n"); +	pr_warn("%s: Bad file\n", __func__);  	return -1;  } @@ -167,19 +168,19 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)  	if(idx == -1)  		idx = 0; -	printk(KERN_INFO "coda_read_super: device index: %i\n", idx); +	pr_info("%s: device index: %i\n", __func__,  idx);  	vc = &coda_comms[idx];  	mutex_lock(&vc->vc_mutex);  	if (!vc->vc_inuse) { -		printk("coda_read_super: No pseudo device\n"); +		pr_warn("%s: No pseudo device\n", __func__);  		error = -EINVAL;  		goto unlock_out;  	}  	if (vc->vc_sb) { -		printk("coda_read_super: Device already mounted\n"); +		pr_warn("%s: Device already mounted\n", __func__);  		error = -EBUSY;  		goto unlock_out;  	} @@ -203,22 +204,23 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)  	/* get root fid from Venus: this needs the root inode */  	error = venus_rootfid(sb, &fid);  	if ( error ) { -	        printk("coda_read_super: coda_get_rootfid failed with %d\n", -		       error); +		pr_warn("%s: coda_get_rootfid failed with %d\n", +			__func__, error);  		goto error;  	} -	printk("coda_read_super: rootfid is %s\n", coda_f2s(&fid)); +	pr_info("%s: rootfid is %s\n", __func__, coda_f2s(&fid));  	/* make root inode */          root = coda_cnode_make(&fid, sb);          if (IS_ERR(root)) {  		error = PTR_ERR(root); -		printk("Failure of coda_cnode_make for root: error %d\n", error); +		pr_warn("Failure of coda_cnode_make for root: error %d\n", +			error);  		goto error;  	}  -	printk("coda_read_super: rootinode is %ld dev %s\n",  -	       root->i_ino, root->i_sb->s_id); +	pr_info("%s: rootinode is %ld dev %s\n", +		__func__, root->i_ino, root->i_sb->s_id);  	sb->s_root = d_make_root(root);  	if (!sb->s_root) {  		error = -EINVAL; @@ -245,19 +247,19 @@ static void coda_put_super(struct super_block *sb)  	sb->s_fs_info = NULL;  	mutex_unlock(&vcp->vc_mutex); -	printk("Coda: Bye bye.\n"); +	pr_info("Bye bye.\n");  }  static void coda_evict_inode(struct inode *inode)  { -	truncate_inode_pages(&inode->i_data, 0); +	truncate_inode_pages_final(&inode->i_data);  	clear_inode(inode);  	coda_cache_clear_inode(inode);  }  int coda_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)  { -	int err = coda_revalidate_inode(dentry); +	int err = coda_revalidate_inode(dentry->d_inode);  	if (!err)  		generic_fillattr(dentry->d_inode, stat);  	return err; diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index ebc2bae6c28..5c1e4242368 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c @@ -114,14 +114,14 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf,  		int size = sizeof(*dcbuf);  		if  ( nbytes < sizeof(struct coda_out_hdr) ) { -		        printk("coda_downcall opc %d uniq %d, not enough!\n", -			       hdr.opcode, hdr.unique); +			pr_warn("coda_downcall opc %d uniq %d, not enough!\n", +				hdr.opcode, hdr.unique);  			count = nbytes;  			goto out;  		}  		if ( nbytes > size ) { -		        printk("Coda: downcall opc %d, uniq %d, too much!", -			       hdr.opcode, hdr.unique); +			pr_warn("downcall opc %d, uniq %d, too much!", +				hdr.opcode, hdr.unique);  		        nbytes = size;  		}  		CODA_ALLOC(dcbuf, union outputArgs *, nbytes); @@ -136,7 +136,8 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf,  		CODA_FREE(dcbuf, nbytes);  		if (error) { -		        printk("psdev_write: coda_downcall error: %d\n", error); +			pr_warn("%s: coda_downcall error: %d\n", +				__func__, error);  			retval = error;  			goto out;  		} @@ -157,16 +158,17 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf,  	mutex_unlock(&vcp->vc_mutex);  	if (!req) { -		printk("psdev_write: msg (%d, %d) not found\n",  -			hdr.opcode, hdr.unique); +		pr_warn("%s: msg (%d, %d) not found\n", +			__func__, hdr.opcode, hdr.unique);  		retval = -ESRCH;  		goto out;  	}          /* move data into response buffer. */  	if (req->uc_outSize < nbytes) { -                printk("psdev_write: too much cnt: %d, cnt: %ld, opc: %d, uniq: %d.\n", -		       req->uc_outSize, (long)nbytes, hdr.opcode, hdr.unique); +		pr_warn("%s: too much cnt: %d, cnt: %ld, opc: %d, uniq: %d.\n", +			__func__, req->uc_outSize, (long)nbytes, +			hdr.opcode, hdr.unique);  		nbytes = req->uc_outSize; /* don't have more space! */  	}          if (copy_from_user(req->uc_data, buf, nbytes)) { @@ -240,8 +242,8 @@ static ssize_t coda_psdev_read(struct file * file, char __user * buf,  	/* Move the input args into userspace */  	count = req->uc_inSize;  	if (nbytes < req->uc_inSize) { -                printk ("psdev_read: Venus read %ld bytes of %d in message\n", -			(long)nbytes, req->uc_inSize); +		pr_warn("%s: Venus read %ld bytes of %d in message\n", +			__func__, (long)nbytes, req->uc_inSize);  		count = nbytes;          } @@ -305,7 +307,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)  	struct upc_req *req, *tmp;  	if (!vcp || !vcp->vc_inuse ) { -		printk("psdev_release: Not open.\n"); +		pr_warn("%s: Not open.\n", __func__);  		return -1;  	} @@ -354,8 +356,8 @@ static int init_coda_psdev(void)  {  	int i, err = 0;  	if (register_chrdev(CODA_PSDEV_MAJOR, "coda", &coda_psdev_fops)) { -              printk(KERN_ERR "coda_psdev: unable to get major %d\n",  -		     CODA_PSDEV_MAJOR); +		pr_err("%s: unable to get major %d\n", +		       __func__, CODA_PSDEV_MAJOR);                return -EIO;  	}  	coda_psdev_class = class_create(THIS_MODULE, "coda"); @@ -393,13 +395,13 @@ static int __init init_coda(void)  		goto out2;  	status = init_coda_psdev();  	if ( status ) { -		printk("Problem (%d) in init_coda_psdev\n", status); +		pr_warn("Problem (%d) in init_coda_psdev\n", status);  		goto out1;  	}  	status = register_filesystem(&coda_fs_type);  	if (status) { -		printk("coda: failed to register filesystem!\n"); +		pr_warn("failed to register filesystem!\n");  		goto out;  	}  	return 0; @@ -420,9 +422,8 @@ static void __exit exit_coda(void)          int err, i;  	err = unregister_filesystem(&coda_fs_type); -        if ( err != 0 ) { -                printk("coda: failed to unregister filesystem\n"); -        } +	if (err != 0) +		pr_warn("failed to unregister filesystem\n");  	for (i = 0; i < MAX_CODADEVS; i++)  		device_destroy(coda_psdev_class, MKDEV(CODA_PSDEV_MAJOR, i));  	class_destroy(coda_psdev_class); diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c index af56ad56a89..34218a8a28c 100644 --- a/fs/coda/sysctl.c +++ b/fs/coda/sysctl.c @@ -14,7 +14,7 @@  #ifdef CONFIG_SYSCTL  static struct ctl_table_header *fs_table_header; -static ctl_table coda_table[] = { +static struct ctl_table coda_table[] = {  	{  		.procname	= "timeout",  		.data		= &coda_timeout, @@ -39,7 +39,7 @@ static ctl_table coda_table[] = {  	{}  }; -static ctl_table fs_table[] = { +static struct ctl_table fs_table[] = {  	{  		.procname	= "coda",  		.mode		= 0555, diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c index 3a731976dc5..21fcf8dcb9c 100644 --- a/fs/coda/upcall.c +++ b/fs/coda/upcall.c @@ -508,8 +508,8 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,          inp->coda_ioctl.data = (char *)(INSIZE(ioctl));          /* get the data out of user space */ -        if ( copy_from_user((char*)inp + (long)inp->coda_ioctl.data, -			    data->vi.in, data->vi.in_size) ) { +	if (copy_from_user((char *)inp + (long)inp->coda_ioctl.data, +			   data->vi.in, data->vi.in_size)) {  		error = -EINVAL;  	        goto exit;  	} @@ -518,8 +518,8 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,  			    &outsize, inp);          if (error) { -	        printk("coda_pioctl: Venus returns: %d for %s\n",  -		       error, coda_f2s(fid)); +		pr_warn("%s: Venus returns: %d for %s\n", +			__func__, error, coda_f2s(fid));  		goto exit;   	} @@ -675,7 +675,7 @@ static int coda_upcall(struct venus_comm *vcp,  	mutex_lock(&vcp->vc_mutex);  	if (!vcp->vc_inuse) { -		printk(KERN_NOTICE "coda: Venus dead, not sending upcall\n"); +		pr_notice("Venus dead, not sending upcall\n");  		error = -ENXIO;  		goto exit;  	} @@ -725,7 +725,7 @@ static int coda_upcall(struct venus_comm *vcp,  	error = -EINTR;  	if ((req->uc_flags & CODA_REQ_ABORT) || !signal_pending(current)) { -		printk(KERN_WARNING "coda: Unexpected interruption.\n"); +		pr_warn("Unexpected interruption.\n");  		goto exit;  	} @@ -735,7 +735,7 @@ static int coda_upcall(struct venus_comm *vcp,  	/* Venus saw the upcall, make sure we can send interrupt signal */  	if (!vcp->vc_inuse) { -		printk(KERN_INFO "coda: Venus dead, not sending signal.\n"); +		pr_info("Venus dead, not sending signal.\n");  		goto exit;  	}  | 
