Skip to content

Commit 121d701

Browse files
committed
v1.2.1
1 parent 62b5217 commit 121d701

File tree

14 files changed

+547
-175
lines changed

14 files changed

+547
-175
lines changed

CHANGES

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
v1.2.1
2+
======
3+
- Add VOP's
4+
- Reduce diff vs other BSD's
5+
- Add patch/openbsd74.patch
6+
- Remove patch/openbsd73.patch
7+
18
v1.2.0
29
======
310
- Add VOP's

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ OpenBSD [HAMMER2](https://gitweb.dragonflybsd.org/dragonfly.git/blob/HEAD:/sys/v
33

44
## Requirements
55

6-
+ OpenBSD 7.3
6+
+ OpenBSD 7.4
77

88
+ src tree under /usr/src
99

1010
## OpenBSD build
1111

12-
1. Apply [patch/openbsd73.patch](patch/openbsd73.patch) against /usr/src.
12+
1. Apply [patch/openbsd74.patch](patch/openbsd74.patch) against /usr/src.
1313

1414
2. Run *make prep* to create symlinks under /usr/src/sys which point to this repository. Run *make unprep* to undo.
1515

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/distrib/sets/lists/comp/mi b/distrib/sets/lists/comp/mi
2-
index 85cf42336..d6c4c4035 100644
2+
index 95b91489e..f1d225c31 100644
33
--- a/distrib/sets/lists/comp/mi
44
+++ b/distrib/sets/lists/comp/mi
5-
@@ -908,6 +908,10 @@
5+
@@ -914,6 +914,10 @@
66
./usr/include/getopt.h
77
./usr/include/glob.h
88
./usr/include/grp.h
@@ -26,7 +26,7 @@ index 6454e1dc8..ce5e90f9c 100644
2626
afterinstall:
2727
ln -sf ../../sbin/sysctl ${DESTDIR}/usr/sbin
2828
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
29-
index e7ce92199..9ac03a992 100644
29+
index c22bd4b94..e154c2c33 100644
3030
--- a/sbin/sysctl/sysctl.c
3131
+++ b/sbin/sysctl/sysctl.c
3232
@@ -91,6 +91,8 @@
@@ -38,15 +38,15 @@ index e7ce92199..9ac03a992 100644
3838
#include <ddb/db_var.h>
3939

4040
#include <ctype.h>
41-
@@ -1250,6 +1252,7 @@ struct ctlname vfsgennames[] = CTL_VFSGENCTL_NAMES;
41+
@@ -1257,6 +1259,7 @@ struct ctlname vfsgennames[] = CTL_VFSGENCTL_NAMES;
4242
struct ctlname ffsname[] = FFS_NAMES;
4343
struct ctlname nfsname[] = FS_NFS_NAMES;
4444
struct ctlname fusefsname[] = FUSEFS_NAMES;
4545
+struct ctlname hammer2name[] = HAMMER2_NAMES;
4646
struct list *vfsvars;
4747
int *vfs_typenums;
4848

49-
@@ -1312,6 +1315,10 @@ vfsinit(void)
49+
@@ -1319,6 +1322,10 @@ vfsinit(void)
5050
vfsvars[cnt].list = fusefsname;
5151
vfsvars[cnt].size = FUSEFS_MAXID;
5252
}
@@ -58,7 +58,7 @@ index e7ce92199..9ac03a992 100644
5858
strlcat(&names[loc], vfc.vfc_name, sizeof names - loc);
5959
vfsname[cnt].ctl_name = &names[loc];
6060
diff --git a/sys/conf/GENERIC b/sys/conf/GENERIC
61-
index f7bb589c8..5e57732c5 100644
61+
index c10d1268f..1d83ac46f 100644
6262
--- a/sys/conf/GENERIC
6363
+++ b/sys/conf/GENERIC
6464
@@ -42,6 +42,7 @@ option MSDOSFS # MS-DOS file system
@@ -70,10 +70,10 @@ index f7bb589c8..5e57732c5 100644
7070
option SOCKET_SPLICE # Socket Splicing for TCP and UDP
7171
option TCP_ECN # Explicit Congestion Notification for TCP
7272
diff --git a/sys/conf/files b/sys/conf/files
73-
index 661140040..2bb78275c 100644
73+
index 2a05c7cd0..d03238292 100644
7474
--- a/sys/conf/files
7575
+++ b/sys/conf/files
76-
@@ -804,6 +804,23 @@ file tmpfs/tmpfs_vfsops.c tmpfs
76+
@@ -809,6 +809,23 @@ file tmpfs/tmpfs_vfsops.c tmpfs
7777
file tmpfs/tmpfs_vnops.c tmpfs
7878
file tmpfs/tmpfs_specops.c tmpfs
7979
file tmpfs/tmpfs_fifoops.c tmpfs & fifo
@@ -97,7 +97,7 @@ index 661140040..2bb78275c 100644
9797
file net/art.c
9898
file net/bpf.c bpfilter needs-count
9999
file net/bpf_filter.c bpfilter
100-
@@ -1041,6 +1058,7 @@ file lib/libkern/getsn.c
100+
@@ -1047,6 +1064,7 @@ file lib/libkern/getsn.c
101101
file lib/libkern/random.c
102102
file lib/libkern/explicit_bzero.c
103103
file lib/libkern/timingsafe_bcmp.c
@@ -122,7 +122,7 @@ index 84c00f0e4..59715d5d8 100644
122122

123123

124124
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
125-
index e6a175e9f..f3c491bf3 100644
125+
index 765b70a09..c764d3469 100644
126126
--- a/sys/kern/vfs_vnops.c
127127
+++ b/sys/kern/vfs_vnops.c
128128
@@ -517,7 +517,8 @@ vn_ioctl(struct file *fp, u_long com, caddr_t data, struct proc *p)
@@ -136,12 +136,12 @@ index e6a175e9f..f3c491bf3 100644
136136
case VFIFO:
137137
case VCHR:
138138
diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h
139-
index 97bf9ff60..4f8b6fd6f 100644
139+
index 81fcbcfc3..a28cd44f7 100644
140140
--- a/sys/sys/malloc.h
141141
+++ b/sys/sys/malloc.h
142142
@@ -177,7 +177,11 @@
143143

144-
#define M_DRM 145 /* Direct Rendering Manager */
144+
#define M_DRM 145 /* Direct Rendering Manager */
145145

146146
-#define M_LAST 146 /* Must be last type + 1 */
147147
+#define M_HAMMER2 146 /* HAMMER2 */
@@ -163,7 +163,7 @@ index 97bf9ff60..4f8b6fd6f 100644
163163

164164
struct kmemstats {
165165
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
166-
index 40c12e976..d18fa04b4 100644
166+
index 27bec4f26..bbbfdbfc8 100644
167167
--- a/sys/sys/mount.h
168168
+++ b/sys/sys/mount.h
169169
@@ -257,6 +257,15 @@ struct fusefs_args {
@@ -207,7 +207,7 @@ index 40c12e976..d18fa04b4 100644
207207
#include <net/radix.h>
208208
#include <sys/socket.h> /* XXX for AF_MAX */
209209
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
210-
index 30787afdd..19c4fb12f 100644
210+
index 994ceb623..fe62b86a6 100644
211211
--- a/sys/sys/vnode.h
212212
+++ b/sys/sys/vnode.h
213213
@@ -67,12 +67,14 @@ enum vtagtype {

src/sys/fs/hammer2/hammer2.h

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ struct hammer2_chain {
213213
TAILQ_ENTRY(hammer2_chain) entry; /* 0-refs LRU */
214214
hammer2_mtx_t lock;
215215
hammer2_mtx_t diolk; /* xop focus interlock */
216-
struct rwlock inp_lock;
217-
char *inp_cv;
216+
hammer2_lk_t inp_lock;
217+
hammer2_lkc_t inp_cv;
218218
hammer2_chain_core_t core;
219219
hammer2_blockref_t bref;
220220
hammer2_dev_t *hmp;
@@ -440,6 +440,7 @@ struct hammer2_inode {
440440
hammer2_depend_t *depend; /* non-NULL if SIDEQ */
441441
hammer2_depend_t depend_static; /* (in-place allocation) */
442442
hammer2_mtx_t lock; /* inode lock */
443+
hammer2_mtx_t truncate_lock; /* prevent truncates */
443444
struct rrwlock vnlock; /* vnode lock */
444445
hammer2_spin_t cluster_spin; /* update cluster */
445446
hammer2_cluster_t cluster;
@@ -504,7 +505,6 @@ struct hammer2_inode {
504505
*/
505506
struct hammer2_trans {
506507
uint32_t flags;
507-
uint32_t sync_wait; /* unused */
508508
};
509509

510510
typedef struct hammer2_trans hammer2_trans_t;
@@ -616,6 +616,14 @@ struct hammer2_xop_scanlhc {
616616
hammer2_key_t lhc;
617617
};
618618

619+
struct hammer2_xop_scanall {
620+
hammer2_xop_head_t head;
621+
hammer2_key_t key_beg; /* inclusive */
622+
hammer2_key_t key_end; /* inclusive */
623+
int resolve_flags;
624+
int lookup_flags;
625+
};
626+
619627
struct hammer2_xop_lookup {
620628
hammer2_xop_head_t head;
621629
hammer2_key_t lhc;
@@ -654,6 +662,12 @@ struct hammer2_xop_fsync {
654662
int clear_directdata;
655663
};
656664

665+
struct hammer2_xop_unlinkall {
666+
hammer2_xop_head_t head;
667+
hammer2_key_t key_beg;
668+
hammer2_key_t key_end;
669+
};
670+
657671
struct hammer2_xop_flush {
658672
hammer2_xop_head_t head;
659673
};
@@ -669,12 +683,14 @@ typedef struct hammer2_xop_readdir hammer2_xop_readdir_t;
669683
typedef struct hammer2_xop_nresolve hammer2_xop_nresolve_t;
670684
typedef struct hammer2_xop_unlink hammer2_xop_unlink_t;
671685
typedef struct hammer2_xop_scanlhc hammer2_xop_scanlhc_t;
686+
typedef struct hammer2_xop_scanall hammer2_xop_scanall_t;
672687
typedef struct hammer2_xop_lookup hammer2_xop_lookup_t;
673688
typedef struct hammer2_xop_mkdirent hammer2_xop_mkdirent_t;
674689
typedef struct hammer2_xop_create hammer2_xop_create_t;
675690
typedef struct hammer2_xop_destroy hammer2_xop_destroy_t;
676691
typedef struct hammer2_xop_bmap hammer2_xop_bmap_t;
677692
typedef struct hammer2_xop_fsync hammer2_xop_fsync_t;
693+
typedef struct hammer2_xop_unlinkall hammer2_xop_unlinkall_t;
678694
typedef struct hammer2_xop_flush hammer2_xop_flush_t;
679695
typedef struct hammer2_xop_strategy hammer2_xop_strategy_t;
680696

@@ -685,12 +701,14 @@ union hammer2_xop {
685701
hammer2_xop_nresolve_t xop_nresolve;
686702
hammer2_xop_unlink_t xop_unlink;
687703
hammer2_xop_scanlhc_t xop_scanlhc;
704+
hammer2_xop_scanall_t xop_scanall;
688705
hammer2_xop_lookup_t xop_lookup;
689706
hammer2_xop_mkdirent_t xop_mkdirent;
690707
hammer2_xop_create_t xop_create;
691708
hammer2_xop_destroy_t xop_destroy;
692709
hammer2_xop_bmap_t xop_bmap;
693710
hammer2_xop_fsync_t xop_fsync;
711+
hammer2_xop_unlinkall_t xop_unlinkall;
694712
hammer2_xop_flush_t xop_flush;
695713
hammer2_xop_strategy_t xop_strategy;
696714
};
@@ -824,10 +842,10 @@ struct hammer2_pfs {
824842
hammer2_spin_t inum_spin; /* inumber lookup */
825843
hammer2_spin_t lru_spin;
826844
hammer2_spin_t list_spin;
827-
struct rwlock xop_lock[HAMMER2_IHASH_SIZE];
828-
char *xop_cv[HAMMER2_IHASH_SIZE];
829-
struct rwlock trans_lock; /* XXX temporary */
830-
char *trans_cv;
845+
hammer2_lk_t xop_lock[HAMMER2_IHASH_SIZE];
846+
hammer2_lkc_t xop_cv[HAMMER2_IHASH_SIZE];
847+
hammer2_lk_t trans_lock; /* XXX temporary */
848+
hammer2_lkc_t trans_cv;
831849
struct mount *mp;
832850
struct uuid pfs_clid;
833851
hammer2_trans_t trans;
@@ -896,6 +914,7 @@ extern hammer2_xop_desc_t hammer2_readdir_desc;
896914
extern hammer2_xop_desc_t hammer2_nresolve_desc;
897915
extern hammer2_xop_desc_t hammer2_unlink_desc;
898916
extern hammer2_xop_desc_t hammer2_scanlhc_desc;
917+
extern hammer2_xop_desc_t hammer2_scanall_desc;
899918
extern hammer2_xop_desc_t hammer2_lookup_desc;
900919
extern hammer2_xop_desc_t hammer2_delete_desc;
901920
extern hammer2_xop_desc_t hammer2_inode_mkdirent_desc;
@@ -905,6 +924,7 @@ extern hammer2_xop_desc_t hammer2_inode_create_ins_desc;
905924
extern hammer2_xop_desc_t hammer2_inode_destroy_desc;
906925
extern hammer2_xop_desc_t hammer2_bmap_desc;
907926
extern hammer2_xop_desc_t hammer2_inode_chain_sync_desc;
927+
extern hammer2_xop_desc_t hammer2_inode_unlinkall_desc;
908928
extern hammer2_xop_desc_t hammer2_inode_flush_desc;
909929
extern hammer2_xop_desc_t hammer2_strategy_read_desc;
910930

@@ -918,6 +938,8 @@ int hammer2_xop_feed(hammer2_xop_head_t *, hammer2_chain_t *, int, int);
918938
int hammer2_xop_collect(hammer2_xop_head_t *, int);
919939

920940
/* hammer2_bulkfree.c */
941+
void hammer2_bulkfree_init(hammer2_dev_t *);
942+
void hammer2_bulkfree_uninit(hammer2_dev_t *);
921943
int hammer2_bulkfree_pass(hammer2_dev_t *, hammer2_chain_t *,
922944
struct hammer2_ioc_bulkfree *);
923945

@@ -973,6 +995,7 @@ void hammer2_cluster_rehold(hammer2_cluster_t *);
973995
int hammer2_cluster_check(hammer2_cluster_t *, hammer2_key_t, int);
974996

975997
/* hammer2_flush.c */
998+
void hammer2_trans_manage_init(hammer2_pfs_t *);
976999
void hammer2_trans_init(hammer2_pfs_t *, uint32_t);
9771000
void hammer2_trans_setflags(hammer2_pfs_t *, uint32_t);
9781001
void hammer2_trans_clearflags(hammer2_pfs_t *, uint32_t);
@@ -1064,6 +1087,7 @@ int hammer2_get_dtype(uint8_t);
10641087
int hammer2_get_vtype(uint8_t);
10651088
uint8_t hammer2_get_obj_type(uint8_t);
10661089
void hammer2_time_to_timespec(uint64_t, struct timespec *);
1090+
uint64_t hammer2_timespec_to_time(const struct timespec *);
10671091
uint32_t hammer2_to_unix_xid(const struct uuid *);
10681092
void hammer2_guid_to_uuid(struct uuid *, uint32_t);
10691093
hammer2_key_t hammer2_dirhash(const char *, size_t);
@@ -1100,6 +1124,7 @@ void hammer2_xop_readdir(hammer2_xop_t *, int);
11001124
void hammer2_xop_nresolve(hammer2_xop_t *, int);
11011125
void hammer2_xop_unlink(hammer2_xop_t *, int);
11021126
void hammer2_xop_scanlhc(hammer2_xop_t *, int);
1127+
void hammer2_xop_scanall(hammer2_xop_t *, int);
11031128
void hammer2_xop_lookup(hammer2_xop_t *, int);
11041129
void hammer2_xop_delete(hammer2_xop_t *, int);
11051130
void hammer2_xop_inode_mkdirent(hammer2_xop_t *, int);
@@ -1109,6 +1134,7 @@ void hammer2_xop_inode_create_ins(hammer2_xop_t *, int);
11091134
void hammer2_xop_inode_destroy(hammer2_xop_t *, int);
11101135
void hammer2_xop_bmap(hammer2_xop_t *, int);
11111136
void hammer2_xop_inode_chain_sync(hammer2_xop_t *, int);
1137+
void hammer2_xop_inode_unlinkall(hammer2_xop_t *, int);
11121138

11131139
/* XXX no way to return multiple errnos */
11141140
static __inline int

0 commit comments

Comments
 (0)