Skip to content

Commit

Permalink
Compile fixes for 0.6.2. Still missing ioctl to get device model/maker.
Browse files Browse the repository at this point in the history
  • Loading branch information
lundman committed Aug 26, 2013
1 parent 3492133 commit 2ea3f3b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 16 deletions.
31 changes: 29 additions & 2 deletions cmd/zpool/zpool_vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
#include <libintl.h>
#include <libnvpair.h>
#include <limits.h>
#include <scsi/scsi.h>
#include <scsi/sg.h>
//#include <scsi/scsi.h>
//#include <scsi/sg.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
Expand Down Expand Up @@ -156,6 +156,7 @@ static const int vdev_disk_database_size =
#define INQ_REPLY_LEN 96
#define INQ_CMD_LEN 6

#ifdef __LINUX__
static boolean_t
check_sector_size_database(char *path, int *sector_size)
{
Expand Down Expand Up @@ -203,6 +204,32 @@ check_sector_size_database(char *path, int *sector_size)

return (B_FALSE);
}
#endif


#ifdef __APPLE__
// FIXME
static boolean_t
check_sector_size_database(char *path, int *sector_size)
{
char diskname[256] = {0};
int i, error = 0;

if (error < 0)
return (B_FALSE);

for (i = 0; i < vdev_disk_database_size; i++) {
if (memcmp(diskname, vdev_disk_database[i].id, 24))
continue;

*sector_size = vdev_disk_database[i].sector_size;
return (B_TRUE);
}

return (B_FALSE);
}
#endif


/*PRINTFLIKE1*/
static void
Expand Down
6 changes: 3 additions & 3 deletions include/sys/arc.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ int arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp,
uint32_t *arc_flags, const zbookmark_t *zb);
#endif
zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, const zio_prop_t *zp,
arc_done_func_t *ready, arc_done_func_t *done, void *_private,
int priority, int zio_flags, const zbookmark_t *zb);
blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress,
const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *done,
void *_private, int priority, int zio_flags, const zbookmark_t *zb);

arc_prune_t *arc_add_prune_callback(arc_prune_func_t *func, void *_private);
void arc_remove_prune_callback(arc_prune_t *p);
Expand Down
25 changes: 17 additions & 8 deletions include/sys/zpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extern const struct file_operations zpl_file_operations;
extern const struct file_operations zpl_dir_file_operations;

/* zpl_super.c */
extern void zpl_prune_sbs(int64_t bytes_to_scan, void *private);
extern void zpl_prune_sbs(int64_t bytes_to_scan, void *);

typedef struct zpl_mount_data {
const char *z_osname; /* Dataset name */
Expand Down Expand Up @@ -100,6 +100,7 @@ extern const struct inode_operations zpl_ops_shares;
}

#else
typedef int (*filldir_t)(void *, const char *, int, loff_t, uint64_t, unsigned);

typedef struct dir_context {
void *dirent;
Expand All @@ -113,41 +114,49 @@ typedef struct dir_context {
.pos = _pos, \
}

static inline bool
static inline boolean_t
dir_emit(struct dir_context *ctx, const char *name, int namelen,
uint64_t ino, unsigned type)
{
return ctx->actor(ctx->dirent, name, namelen, ctx->pos, ino, type) == 0;
}

static inline bool
static inline boolean_t
dir_emit_dot(struct file *file, struct dir_context *ctx)
{
#ifdef __APPLE__
return B_FALSE;
#else
return ctx->actor(ctx->dirent, ".", 1, ctx->pos,
file->f_path.dentry->d_inode->i_ino, DT_DIR) == 0;
#endif
}

static inline bool
static inline boolean_t
dir_emit_dotdot(struct file *file, struct dir_context *ctx)
{
#ifdef __APPLE__
return B_FALSE;
#else
return ctx->actor(ctx->dirent, "..", 2, ctx->pos,
parent_ino(file->f_path.dentry), DT_DIR) == 0;
#endif
}

static inline bool
static inline boolean_t
dir_emit_dots(struct file *file, struct dir_context *ctx)
{
if (ctx->pos == 0) {
if (!dir_emit_dot(file, ctx))
return false;
return B_FALSE;
ctx->pos = 1;
}
if (ctx->pos == 1) {
if (!dir_emit_dotdot(file, ctx))
return false;
return B_FALSE;
ctx->pos = 2;
}
return true;
return B_TRUE;
}
#endif /* HAVE_VFS_ITERATE */

Expand Down
2 changes: 1 addition & 1 deletion lib/libspl/include/sys/dkio.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct dk_geom {
*/
#define DKIOCGGEOM (DKIOC|1) /* Get geometry */
#define DKIOCINFO (DKIOC|3) /* Get info */
#define DKIOCEJECT (DKIOC|6) /* Generic 'eject' */
//#define DKIOCEJECT (DKIOC|6) /* Generic 'eject' */
#define DKIOCGVTOC (DKIOC|11) /* Get VTOC */
#define DKIOCSVTOC (DKIOC|12) /* Set VTOC & Write to Disk */

Expand Down
4 changes: 2 additions & 2 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ int zfs_arc_shrink_shift = 5;
* minimum lifespan of a prefetch block in clock ticks
* (initialized in arc_init())
*/
int zfs_arc_min_prefetch_lifespan = HZ;
int zfs_arc_min_prefetch_lifespan = hz;

/* disable arc proactive arc throttle due to low memory */
int zfs_arc_memory_throttle_disable = 1;
Expand Down Expand Up @@ -2434,7 +2434,7 @@ arc_reclaim_thread(void *dummy __unused)
}

/* reset the growth delay for every reclaim */
growtime = ddi_get_lbolt() + (arc_grow_retry * hz);
growtime = ddi_get_lbolt() + (zfs_arc_grow_retry * hz);
if (last_reclaim == ARC_RECLAIM_CONS) {
/*
* If needfree is TRUE our vm_lowmem hook
Expand Down

0 comments on commit 2ea3f3b

Please sign in to comment.