aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/ubd_kern.c
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2006-10-31 01:07:06 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-31 11:06:59 -0500
commit5f75a4f887a35b99878fc07ed749a90375194b63 (patch)
treed6e7780a7bd0de29daa82be0a9624685720f6d6a /arch/um/drivers/ubd_kern.c
parent7d314e346d6081e8013a96206e601a48528d8f60 (diff)
[PATCH] uml ubd driver: give better names to some functions.
To rethink locking, I needed to understand well what each function does. While doing this I renamed some: * ubd_close -> ubd_close_dev (since it pairs with ubd_open_dev) * ubd_new_disk -> ubd_disk_register (it handles registration with the block layer - one hopes this makes clearer the difference with ubd_add()) Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers/ubd_kern.c')
-rw-r--r--arch/um/drivers/ubd_kern.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 761e3f9cac2d..cdd82e896180 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -552,7 +552,7 @@ static int ubd_file_size(struct ubd *ubd_dev, __u64 *size_out)
552 return(os_file_size(file, size_out)); 552 return(os_file_size(file, size_out));
553} 553}
554 554
555static void ubd_close(struct ubd *ubd_dev) 555static void ubd_close_dev(struct ubd *ubd_dev)
556{ 556{
557 os_close_file(ubd_dev->fd); 557 os_close_file(ubd_dev->fd);
558 if(ubd_dev->cow.file == NULL) 558 if(ubd_dev->cow.file == NULL)
@@ -624,7 +624,7 @@ static int ubd_open_dev(struct ubd *ubd_dev)
624 return(err); 624 return(err);
625} 625}
626 626
627static int ubd_new_disk(int major, u64 size, int unit, 627static int ubd_disk_register(int major, u64 size, int unit,
628 struct gendisk **disk_out) 628 struct gendisk **disk_out)
629 629
630{ 630{
@@ -676,12 +676,12 @@ static int ubd_add(int n)
676 676
677 ubd_dev->size = ROUND_BLOCK(ubd_dev->size); 677 ubd_dev->size = ROUND_BLOCK(ubd_dev->size);
678 678
679 err = ubd_new_disk(MAJOR_NR, ubd_dev->size, n, &ubd_gendisk[n]); 679 err = ubd_disk_register(MAJOR_NR, ubd_dev->size, n, &ubd_gendisk[n]);
680 if(err) 680 if(err)
681 goto out; 681 goto out;
682 682
683 if(fake_major != MAJOR_NR) 683 if(fake_major != MAJOR_NR)
684 ubd_new_disk(fake_major, ubd_dev->size, n, 684 ubd_disk_register(fake_major, ubd_dev->size, n,
685 &fake_gendisk[n]); 685 &fake_gendisk[n]);
686 686
687 /* perhaps this should also be under the "if (fake_major)" above */ 687 /* perhaps this should also be under the "if (fake_major)" above */
@@ -898,7 +898,7 @@ static int ubd_open(struct inode *inode, struct file *filp)
898 /* This should no more be needed. And it didn't work anyway to exclude 898 /* This should no more be needed. And it didn't work anyway to exclude
899 * read-write remounting of filesystems.*/ 899 * read-write remounting of filesystems.*/
900 /*if((filp->f_mode & FMODE_WRITE) && !ubd_dev->openflags.w){ 900 /*if((filp->f_mode & FMODE_WRITE) && !ubd_dev->openflags.w){
901 if(--ubd_dev->count == 0) ubd_close(ubd_dev); 901 if(--ubd_dev->count == 0) ubd_close_dev(ubd_dev);
902 err = -EROFS; 902 err = -EROFS;
903 }*/ 903 }*/
904 out: 904 out:
@@ -911,7 +911,7 @@ static int ubd_release(struct inode * inode, struct file * file)
911 struct ubd *ubd_dev = disk->private_data; 911 struct ubd *ubd_dev = disk->private_data;
912 912
913 if(--ubd_dev->count == 0) 913 if(--ubd_dev->count == 0)
914 ubd_close(ubd_dev); 914 ubd_close_dev(ubd_dev);
915 return(0); 915 return(0);
916} 916}
917 917