mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Patch] hostfs: fix a duplicated global function name
@ 2008-11-18 18:00 Américo Wang
  2008-11-19  7:53 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Américo Wang @ 2008-11-18 18:00 UTC (permalink / raw)
  To: LKML; +Cc: Jeff Dike, Andrew Morton, user-mode-linux-devel


fs/hostfs/hostfs_user.c defines do_readlink() as non-static,
and so does fs/xfs/linux-2.6/xfs_ioctl.c when CONFIG_XFS_DEBUG=y.
So rename do_readlink() in hostfs to hostfs_do_readlink().

I think it's better if XFS guys will also rename their do_readlink(),
it's not necessary to use such a general name.

Compile test only.

Signed-off-by: WANG Cong <wangcong@zeuux.org>
Cc: Jeff Dike <jdike@addtoit.com>


---
diff --git a/fs/hostfs/hostfs.h b/fs/hostfs/hostfs.h
index 6ae9011..2f34f8f 100644
--- a/fs/hostfs/hostfs.h
+++ b/fs/hostfs/hostfs.h
@@ -81,7 +81,7 @@ extern int do_rmdir(const char *file);
 extern int do_mknod(const char *file, int mode, unsigned int major,
 		    unsigned int minor);
 extern int link_file(const char *from, const char *to);
-extern int do_readlink(char *file, char *buf, int size);
+extern int hostfs_do_readlink(char *file, char *buf, int size);
 extern int rename_file(char *from, char *to);
 extern int do_statfs(char *root, long *bsize_out, long long *blocks_out,
 		     long long *bfree_out, long long *bavail_out,
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 7f34f43..3a31451 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -168,7 +168,7 @@ static char *follow_link(char *link)
 		if (name == NULL)
 			goto out;
 
-		n = do_readlink(link, name, len);
+		n = hostfs_do_readlink(link, name, len);
 		if (n < len)
 			break;
 		len *= 2;
@@ -943,7 +943,7 @@ int hostfs_link_readpage(struct file *file, struct page *page)
 	name = inode_name(page->mapping->host, 0);
 	if (name == NULL)
 		return -ENOMEM;
-	err = do_readlink(name, buffer, PAGE_CACHE_SIZE);
+	err = hostfs_do_readlink(name, buffer, PAGE_CACHE_SIZE);
 	kfree(name);
 	if (err == PAGE_CACHE_SIZE)
 		err = -E2BIG;
diff --git a/fs/hostfs/hostfs_user.c b/fs/hostfs/hostfs_user.c
index 53fd0a6..b79424f 100644
--- a/fs/hostfs/hostfs_user.c
+++ b/fs/hostfs/hostfs_user.c
@@ -377,7 +377,7 @@ int link_file(const char *to, const char *from)
 	return 0;
 }
 
-int do_readlink(char *file, char *buf, int size)
+int hostfs_do_readlink(char *file, char *buf, int size)
 {
 	int n;
 



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch] hostfs: fix a duplicated global function name
  2008-11-18 18:00 [Patch] hostfs: fix a duplicated global function name Américo Wang
@ 2008-11-19  7:53 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2008-11-19  7:53 UTC (permalink / raw)
  To: Américo Wang; +Cc: LKML, Jeff Dike, user-mode-linux-devel

On Tue, 18 Nov 2008 18:00:03 +0000 Am__rico Wang <xiyou.wangcong@gmail.com> wrote:

> 
> fs/hostfs/hostfs_user.c defines do_readlink() as non-static,
> and so does fs/xfs/linux-2.6/xfs_ioctl.c when CONFIG_XFS_DEBUG=y.
> So rename do_readlink() in hostfs to hostfs_do_readlink().

heh, yes, it's not a great choice of identifier.

> I think it's better if XFS guys will also rename their do_readlink(),
> it's not necessary to use such a general name.
> 
> Compile test only.
>
> ...
>
> diff --git a/fs/hostfs/hostfs.h b/fs/hostfs/hostfs.h
> index 6ae9011..2f34f8f 100644
> --- a/fs/hostfs/hostfs.h
> +++ b/fs/hostfs/hostfs.h
> @@ -81,7 +81,7 @@ extern int do_rmdir(const char *file);
>  extern int do_mknod(const char *file, int mode, unsigned int major,
>  		    unsigned int minor);
>  extern int link_file(const char *from, const char *to);
> -extern int do_readlink(char *file, char *buf, int size);
> +extern int hostfs_do_readlink(char *file, char *buf, int size);
>  extern int rename_file(char *from, char *to);
>  extern int do_statfs(char *root, long *bsize_out, long long *blocks_out,
>  		     long long *bfree_out, long long *bavail_out,
> diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
> index 7f34f43..3a31451 100644
> --- a/fs/hostfs/hostfs_kern.c
> +++ b/fs/hostfs/hostfs_kern.c
> @@ -168,7 +168,7 @@ static char *follow_link(char *link)
>  		if (name == NULL)
>  			goto out;
>  
> -		n = do_readlink(link, name, len);
> +		n = hostfs_do_readlink(link, name, len);
>  		if (n < len)
>  			break;
>  		len *= 2;
> @@ -943,7 +943,7 @@ int hostfs_link_readpage(struct file *file, struct page *page)
>  	name = inode_name(page->mapping->host, 0);
>  	if (name == NULL)
>  		return -ENOMEM;
> -	err = do_readlink(name, buffer, PAGE_CACHE_SIZE);
> +	err = hostfs_do_readlink(name, buffer, PAGE_CACHE_SIZE);
>  	kfree(name);
>  	if (err == PAGE_CACHE_SIZE)
>  		err = -E2BIG;
> diff --git a/fs/hostfs/hostfs_user.c b/fs/hostfs/hostfs_user.c
> index 53fd0a6..b79424f 100644
> --- a/fs/hostfs/hostfs_user.c
> +++ b/fs/hostfs/hostfs_user.c
> @@ -377,7 +377,7 @@ int link_file(const char *to, const char *from)
>  	return 0;
>  }
>  
> -int do_readlink(char *file, char *buf, int size)
> +int hostfs_do_readlink(char *file, char *buf, int size)
>  {
>  	int n;

Thanks, I'll send this in for 2.6.28 unless someone stops me soon.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-19  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-18 18:00 [Patch] hostfs: fix a duplicated global function name Américo Wang
2008-11-19  7:53 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®