Module Name:    src
Committed By:   andvar
Date:           Sat Aug 21 22:23:33 UTC 2021

Modified Files:
        src/sys/dev/dm: dm.h dm_dev.c dm_ioctl.c dm_pdev.c dm_table.c
            dm_target.c
        src/sys/dev/dm/doc: design.txt locking.txt

Log Message:
fix typos in sys/dev/dm code comments and documentation.
also remove some trailing space in documentation.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/dm/dm.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/dm/dm_dev.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/dm/dm_ioctl.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/dm/dm_pdev.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/dm/dm_table.c
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/dm/dm_target.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/dm/doc/design.txt
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/dm/doc/locking.txt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/dm/dm.h
diff -u src/sys/dev/dm/dm.h:1.55 src/sys/dev/dm/dm.h:1.56
--- src/sys/dev/dm/dm.h:1.55	Tue Jan 21 16:27:53 2020
+++ src/sys/dev/dm/dm.h	Sat Aug 21 22:23:33 2021
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm.h,v 1.55 2020/01/21 16:27:53 tkusumi Exp $      */
+/*        $NetBSD: dm.h,v 1.56 2021/08/21 22:23:33 andvar Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -117,7 +117,7 @@ typedef struct dm_pdev {
 	struct vnode *pdev_vnode;
 	uint64_t pdev_numsec;
 	unsigned int pdev_secsize;
-	int ref_cnt; /* reference counter for users ofthis pdev */
+	int ref_cnt; /* reference counter for users of this pdev */
 
 	SLIST_ENTRY(dm_pdev) next_pdev;
 } dm_pdev_t;
@@ -137,7 +137,7 @@ typedef struct dm_dev {
 	uint64_t minor; /* Device minor number */
 	uint32_t flags; /* store communication protocol flags */
 
-	kmutex_t dev_mtx; /* mutex for generall device lock */
+	kmutex_t dev_mtx; /* mutex for general device lock */
 	kcondvar_t dev_cv; /* cv for between ioctl synchronisation */
 
 	uint32_t event_nr;

Index: src/sys/dev/dm/dm_dev.c
diff -u src/sys/dev/dm/dm_dev.c:1.18 src/sys/dev/dm/dm_dev.c:1.19
--- src/sys/dev/dm/dm_dev.c:1.18	Wed Jul  8 15:07:13 2020
+++ src/sys/dev/dm/dm_dev.c	Sat Aug 21 22:23:33 2021
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_dev.c,v 1.18 2020/07/08 15:07:13 thorpej Exp $      */
+/*        $NetBSD: dm_dev.c,v 1.19 2021/08/21 22:23:33 andvar Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_dev.c,v 1.18 2020/07/08 15:07:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_dev.c,v 1.19 2021/08/21 22:23:33 andvar Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -270,7 +270,7 @@ dm_dev_rem(const char *dm_dev_name, cons
 
 /*
  * Destroy all devices created in device-mapper. Remove all tables
- * free all allocated memmory.
+ * free all allocated memory.
  */
 int
 dm_dev_destroy(void)

Index: src/sys/dev/dm/dm_ioctl.c
diff -u src/sys/dev/dm/dm_ioctl.c:1.54 src/sys/dev/dm/dm_ioctl.c:1.55
--- src/sys/dev/dm/dm_ioctl.c:1.54	Fri Aug 20 20:25:27 2021
+++ src/sys/dev/dm/dm_ioctl.c	Sat Aug 21 22:23:33 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_ioctl.c,v 1.54 2021/08/20 20:25:27 andvar Exp $      */
+/* $NetBSD: dm_ioctl.c,v 1.55 2021/08/21 22:23:33 andvar Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.54 2021/08/20 20:25:27 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.55 2021/08/21 22:23:33 andvar Exp $");
 
 /*
  * Locking is used to synchronise between ioctl calls and between dm_table's
@@ -53,10 +53,10 @@ __KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v
  * on uint8_t argument.
  *
  * dm_table_release must be called for every table_entry from
- * dm_table_get_entry. Between these to calls tables can'tbe switched
+ * dm_table_get_entry. Between these two calls tables can't be switched
  * or destroyed.
  *
- * dm_table_head_init initialize talbe_entries SLISTS and io_cv.
+ * dm_table_head_init initialize table_entries SLISTS and io_cv.
  *
  * dm_table_head_destroy destroy cv.
  *
@@ -265,7 +265,7 @@ dm_dev_create_ioctl(prop_dictionary_t dm
 }
 
 /*
- * Get list of created device-mapper devices fromglobal list and
+ * Get list of created device-mapper devices from global list and
  * send it to kernel.
  *
  * Output dictionary:
@@ -695,7 +695,7 @@ dm_table_deps(dm_table_entry_t *table_en
 
 /*
  * Load new table/tables to device.
- * Call apropriate target init routine open all physical pdev's and
+ * Call appropriate target init routine to open all physical pdev's and
  * link them to device. For other targets mirror, strip, snapshot
  * etc. also add dependency devices to upcalls list.
  *

Index: src/sys/dev/dm/dm_pdev.c
diff -u src/sys/dev/dm/dm_pdev.c:1.22 src/sys/dev/dm/dm_pdev.c:1.23
--- src/sys/dev/dm/dm_pdev.c:1.22	Fri Dec 20 16:16:36 2019
+++ src/sys/dev/dm/dm_pdev.c	Sat Aug 21 22:23:33 2021
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_pdev.c,v 1.22 2019/12/20 16:16:36 tkusumi Exp $      */
+/*        $NetBSD: dm_pdev.c,v 1.23 2021/08/21 22:23:33 andvar Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_pdev.c,v 1.22 2019/12/20 16:16:36 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_pdev.c,v 1.23 2021/08/21 22:23:33 andvar Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -211,7 +211,7 @@ dm_pdev_destroy(void)
 }
 
 /*
- * This funcion is called from dm_dev_remove_ioctl.
+ * This function is called from dm_dev_remove_ioctl.
  * When I'm removing device from list, I have to decrement
  * reference counter. If reference counter is 0 I will remove
  * dmp from global list and from device list to. And I will CLOSE

Index: src/sys/dev/dm/dm_table.c
diff -u src/sys/dev/dm/dm_table.c:1.20 src/sys/dev/dm/dm_table.c:1.21
--- src/sys/dev/dm/dm_table.c:1.20	Fri Aug 20 20:25:27 2021
+++ src/sys/dev/dm/dm_table.c	Sat Aug 21 22:23:33 2021
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_table.c,v 1.20 2021/08/20 20:25:27 andvar Exp $      */
+/*        $NetBSD: dm_table.c,v 1.21 2021/08/21 22:23:33 andvar Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_table.c,v 1.20 2021/08/20 20:25:27 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_table.c,v 1.21 2021/08/21 22:23:33 andvar Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -141,7 +141,7 @@ dm_table_switch_tables(dm_table_head_t *
  * Destroy all table data. This function can run when there are no
  * readers on table lists.
  *
- * XXX Is it ok to call kmem_free and potentialy VOP_CLOSE with held mutex ?xs
+ * XXX Is it ok to call kmem_free and potentially VOP_CLOSE with held mutex ?xs
  */
 int
 dm_table_destroy(dm_table_head_t *head, uint8_t table_id)
@@ -274,8 +274,8 @@ dm_table_disksize(dm_table_head_t *head,
 /*
  * Return > 0 if table is at least one table entry (returns number of entries)
  * and return 0 if there is not. Target count returned from this function
- * doesn't need to be true when userspace user receive it (after return
- * there can be dm_dev_resume_ioctl), therfore this isonly informative.
+ * doesn't need to be true when userspace user receives it (after return
+ * there can be dm_dev_resume_ioctl), therefore this is only informative.
  */
 int
 dm_table_get_target_count(dm_table_head_t *head, uint8_t table_id)

Index: src/sys/dev/dm/dm_target.c
diff -u src/sys/dev/dm/dm_target.c:1.41 src/sys/dev/dm/dm_target.c:1.42
--- src/sys/dev/dm/dm_target.c:1.41	Wed Jul  8 15:07:13 2020
+++ src/sys/dev/dm/dm_target.c	Sat Aug 21 22:23:33 2021
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target.c,v 1.41 2020/07/08 15:07:13 thorpej Exp $      */
+/*        $NetBSD: dm_target.c,v 1.42 2021/08/21 22:23:33 andvar Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_target.c,v 1.41 2020/07/08 15:07:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target.c,v 1.42 2021/08/21 22:23:33 andvar Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -122,7 +122,7 @@ dm_target_lookup(const char *dm_target_n
 }
 
 /*
- * Search for name in TAIL and return apropriate pointer.
+ * Search for name in TAIL and return appropriate pointer.
  */
 static dm_target_t *
 dm_target_lookup_name(const char *dm_target_name)
@@ -148,7 +148,7 @@ dm_target_lookup_name(const char *dm_tar
 /*
  * Insert new target struct into the TAIL.
  * dm_target
- *   contains name, version, function pointer to specifif target functions.
+ *   contains name, version, function pointer to specific target functions.
  */
 int
 dm_target_insert(dm_target_t *dm_target)

Index: src/sys/dev/dm/doc/design.txt
diff -u src/sys/dev/dm/doc/design.txt:1.4 src/sys/dev/dm/doc/design.txt:1.5
--- src/sys/dev/dm/doc/design.txt:1.4	Sun Jun  4 08:52:42 2017
+++ src/sys/dev/dm/doc/design.txt	Sat Aug 21 22:23:33 2021
@@ -14,12 +14,12 @@
      mapped to physical. There are many targets linear, stripe, mirror etc.
 
      Functions available to dm device:
-     	       list available targets. They can be added with module in linux.     	       
+     	       list available targets. They can be added with module in linux.
 
   3) dm table.
-     Every device-mapper device consits from one or more tables. Table specify 
-     Start, length of logical blocks and target which is used to map them to 
-     physical blocks. 
+     Every device-mapper device consists from one or more tables.
+     Table specifies start, length of logical blocks and target which is used
+     to map them to physical blocks.
 
      {start} {length} {target} | {device} {target parameters}
      
@@ -54,7 +54,7 @@
 
       out: struct dm-ioctl
 
-      Fuction:
+      Function:
 	 sends libdevmapper ioctl protocol version to kernel and ask for kernel version.
 	 If major and minor numbers are good we can continue.
 
@@ -111,7 +111,7 @@
 
     Implementation:
        Kernel driver will find device with name from struct dm_ioctl-name/uuid.
-       Change name of selected device to string foun behind struc dm_ioctl header 
+       Change name of selected device to string found behind struct dm_ioctl header 
        in userspace buffer.
 
  7) DM_DEV_SUSPEND
@@ -161,7 +161,7 @@
        Kernel driver will find device with name from struct dm_ioctl-name/uuid.
        Table is added to the inactive slot. Every device can have more than one 
        table loaded. Tables are stored in SLIST. This ioctl also open physical 
-       device spedcified in table and add it to dm_device specific pdev list.
+       device specified in table and add it to dm_device specific pdev list.
 
  11) DM_TABLE_CLEAR
 
@@ -192,7 +192,7 @@
 
      Implementation:
        Kernel driver will find device with name from struct dm_ioctl-name/uuid.
-       DM driver will copyout dm_target_spec structures behidn struct dm_ioctl.
+       DM driver will copyout dm_target_spec structures behind struct dm_ioctl.
 
  14) DM_LIST_VERSIONS	
      
@@ -257,11 +257,11 @@
    
 	
 
-		Desing of new device-mapper ioctl interface
+		Design of new device-mapper ioctl interface
 
    Basic architecture of device-mapper -> libdevmapper ioctl interface is this. 
    Libdevmapper allocate buffer with size of data_size. At the start of this buffer 
-   dm-ioctl structure is placed. any aditional information from/to kernel are placed
+   dm-ioctl structure is placed. any additional information from/to kernel are placed
    behind end (start of data part is pointed with data_start var.) of dm-ioctl struct. 
    
    Kernel driver then after ioctl call have to copyin data from userspace to kernel.
@@ -398,7 +398,7 @@
     
     struct dm_name_list {
         uint64_t dev;
-        uint32_t next;          /* offset to the next record from                                    
+        uint32_t next;          /* offset to the next record from
                                    the _start_ of this */
         char name[0];
     };
@@ -470,6 +470,6 @@
 	<key>target_type</key>
 	<string>...</string>
 	
-	<key>aditional info</key>
+	<key>additional info</key>
 	<string>...</string>
       </dict>

Index: src/sys/dev/dm/doc/locking.txt
diff -u src/sys/dev/dm/doc/locking.txt:1.3 src/sys/dev/dm/doc/locking.txt:1.4
--- src/sys/dev/dm/doc/locking.txt:1.3	Sat Dec  7 15:28:39 2019
+++ src/sys/dev/dm/doc/locking.txt	Sat Aug 21 22:23:33 2021
@@ -43,7 +43,7 @@ typedef struct dm_dev {
         int minor;
         uint32_t flags; /* store communication protocol flags */
 
-        kmutex_t dev_mtx; /* mutex for generall device lock */
+        kmutex_t dev_mtx; /* mutex for general device lock */
         kcondvar_t dev_cv; /* cv for ioctl synchronisation */
 
         uint32_t event_nr;
@@ -106,48 +106,48 @@ dm_table_head_t is used as entry for eve
 Because every table user have to get list to table list head I have implemented
 these routines to manage access to table lists. 
 
-/*                                                                                                            
- * Destroy all table data. This function can run when there are no                                            
- * readers on table lists.                                                                                    
+/*
+ * Destroy all table data. This function can run when there are no
+ * readers on table lists.
  */
 int dm_table_destroy(dm_table_head_t *, uint8_t);
 
-/*                                                                                                            
- * Return length of active table in device.                                                                   
+/*
+ * Return length of active table in device.
  */
 uint64_t dm_table_size(dm_table_head_t *);
 
-/*                                                                                                            
- * Return current active table to caller, increment io_cnt reference counter.                                 
+/*
+ * Return current active table to caller, increment io_cnt reference counter.
  */
 struct dm_table *dm_table_get_entry(dm_table_head_t *, uint8_t);
 
-/*                                                                                                            
- * Return > 0 if table is at least one table entry (returns number of entries)                                
- * and return 0 if there is not. Target count returned from this function                                     
- * doesn't need to be true when userspace user receive it (after return                                       
- * there can be dm_dev_resume_ioctl), therfore this isonly informative.                                       
+/*
+ * Return > 0 if table is at least one table entry (returns number of entries)
+ * and return 0 if there is not. Target count returned from this function
+ * doesn't need to be true when userspace user receives it (after return
+ * there can be dm_dev_resume_ioctl), therefore this is only informative.
  */
 int dm_table_get_target_count(dm_table_head_t *, uint8_t);
 
-/*                                                                                                            
- * Decrement io reference counter and wake up all callers, with table_head cv.                                
+/*
+ * Decrement io reference counter and wake up all callers, with table_head cv.
  */
 void dm_table_release(dm_table_head_t *, uint8_t s);
 
-/*                                                                                                            
- * Switch table from inactive to active mode. Have to wait until io_cnt is 0.                                 
+/*
+ * Switch table from inactive to active mode. Have to wait until io_cnt is 0.
  */
 void dm_table_switch_tables(dm_table_head_t *);
 
-/*                                                                                                            
- * Initialize table_head structures, I'm trying to keep this structure as                                     
- * opaque as possible.                                                                                        
+/*
+ * Initialize table_head structures, I'm trying to keep this structure as
+ * opaque as possible.
  */
 void dm_table_head_init(dm_table_head_t *);
 
-/*                                                                                                            
- * Destroy all variables in table_head                                                                        
+/*
+ * Destroy all variables in table_head
  */
 void dm_table_head_destroy(dm_table_head_t *);
 
@@ -172,11 +172,11 @@ is reference counter 0 and only then it 
 head->table_cv while there are other readers. dm_table_get_entry is specific in that it will return table with hold reference counter. After dm_table_get_entry 
 every caller must call dm_table_release when it doesn't want to work with it. 
 
-/*                                                                                                            
- * Function to increment table user reference counter. Return id                                              
- * of table_id table.                                                                                         
- * DM_TABLE_ACTIVE will return active table id.                                                               
- * DM_TABLE_INACTIVE will return inactive table id.                                                           
+/*
+ * Function to increment table user reference counter. Return id
+ * of table_id table.
+ * DM_TABLE_ACTIVE will return active table id.
+ * DM_TABLE_INACTIVE will return inactive table id.
  */
 static int
 dm_table_busy(dm_table_head_t *head, uint8_t table_id)
@@ -198,8 +198,8 @@ dm_table_busy(dm_table_head_t *head, uin
         return id;
 }
 
-/*                                                                                                            
- * Function release table lock and eventually wakeup all waiters.                                             
+/*
+ * Function release table lock and eventually wakeup all waiters.
  */
 static void
 dm_table_unbusy(dm_table_head_t *head)
@@ -246,16 +246,3 @@ dm_dev_unbusy.
 dm_dev_remove_ioctl routine have to remove dm_dev from global device list,
 and wait until all ioctl users from dm_dev are gone. 
 
-
-
-
-
-
-
-
-
-
-
-
-
-

Reply via email to