Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160625723
D48074.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48074.id.diff
View Options
diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c
--- a/sys/kern/kern_osd.c
+++ b/sys/kern/kern_osd.c
@@ -73,6 +73,9 @@
} \
} while (0)
+#define OSD_METHOD(osdm, slot, method) \
+ ((osdm).osd_methods[((slot) - 1) * (osdm).osd_nmethods + (method)])
+
static void do_osd_del(u_int type, struct osd *osd, u_int slot,
int list_locked);
@@ -139,8 +142,8 @@
osdm[type].osd_destructors[i] = destructor;
if (osdm[type].osd_nmethods != 0) {
for (m = 0; m < osdm[type].osd_nmethods; m++)
- osdm[type].osd_methods[i * osdm[type].osd_nmethods + m]
- = methods != NULL ? methods[m] : NULL;
+ OSD_METHOD(osdm[type], i + 1, m) =
+ methods != NULL ? methods[m] : NULL;
}
sx_xunlock(&osdm[type].osd_module_lock);
return (i + 1);
@@ -391,8 +394,7 @@
/* Hole in the slot map; avoid dereferencing. */
if (osdm[type].osd_destructors[i] == NULL)
continue;
- methodfun = osdm[type].osd_methods[i * osdm[type].osd_nmethods +
- method];
+ methodfun = OSD_METHOD(osdm[type], i + 1, method);
if (methodfun != NULL && (error = methodfun(obj, data)) != 0)
break;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 27, 7:47 AM (18 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34338780
Default Alt Text
D48074.id.diff (1 KB)
Attached To
Mode
D48074: kern: osd: abstract away the math for locating a slot method
Attached
Detach File
Event Timeline
Log In to Comment