Print this page
3742 zfs comments need cleaner, more consistent style
Submitted by:   Will Andrews <willa@spectralogic.com>
Submitted by:   Alan Somers <alans@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>
Reviewed by:    George Wilson <george.wilson@delphix.com>
Reviewed by:    Eric Schrock <eric.schrock@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/zfs_rlock.h
          +++ new/usr/src/uts/common/fs/zfs/sys/zfs_rlock.h
↓ open down ↓ 49 lines elided ↑ open up ↑
  50   50          uint_t r_cnt;           /* range reference count in tree */
  51   51          rl_type_t r_type;       /* range type */
  52   52          kcondvar_t r_wr_cv;     /* cv for waiting writers */
  53   53          kcondvar_t r_rd_cv;     /* cv for waiting readers */
  54   54          uint8_t r_proxy;        /* acting for original range */
  55   55          uint8_t r_write_wanted; /* writer wants to lock this range */
  56   56          uint8_t r_read_wanted;  /* reader wants to lock this range */
  57   57  } rl_t;
  58   58  
  59   59  /*
  60      - * Lock a range (offset, length) as either shared (READER)
  61      - * or exclusive (WRITER or APPEND). APPEND is a special type that
  62      - * is converted to WRITER that specified to lock from the start of the
  63      - * end of file.  zfs_range_lock() returns the range lock structure.
       60 + * Lock a range (offset, length) as either shared (RL_READER)
       61 + * or exclusive (RL_WRITER or RL_APPEND).  RL_APPEND is a special type that
       62 + * is converted to RL_WRITER that specified to lock from the start of the
       63 + * end of file.  Returns the range lock structure.
  64   64   */
  65   65  rl_t *zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type);
  66   66  
  67      -/*
  68      - * Unlock range and destroy range lock structure.
  69      - */
       67 +/* Unlock range and destroy range lock structure. */
  70   68  void zfs_range_unlock(rl_t *rl);
  71   69  
  72   70  /*
  73   71   * Reduce range locked as RW_WRITER from whole file to specified range.
  74   72   * Asserts the whole file was previously locked.
  75   73   */
  76   74  void zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len);
  77   75  
  78   76  /*
  79      - * AVL comparison function used to compare range locks
       77 + * AVL comparison function used to order range locks
       78 + * Locks are ordered on the start offset of the range.
  80   79   */
  81   80  int zfs_range_compare(const void *arg1, const void *arg2);
  82   81  
  83   82  #endif /* _KERNEL */
  84   83  
  85   84  #ifdef  __cplusplus
  86   85  }
  87   86  #endif
  88   87  
  89   88  #endif  /* _SYS_FS_ZFS_RLOCK_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX