Updated hfi1_filedata {} and confirmed its size against the original on Linux

Conflicts:
	kernel/include/hfi1/hfi.h
This commit is contained in:
Aram Santogidis
2017-08-04 16:37:47 +09:00
committed by Balazs Gerofi
parent fe4c461f2f
commit b024a486b9
3 changed files with 23 additions and 9 deletions

View File

@ -428,7 +428,8 @@ ssize_t hfi1_aio_write(void *private_data, const struct iovec *iovec, unsigned l
struct hfi1_user_sdma_pkt_q *pq = fd->pq;
struct hfi1_user_sdma_comp_q *cq = fd->cq;
int done = 0, reqs = 0;
kprintf("sizeof(struct hfi1_filedata) = %lu\n", sizeof(struct hfi1_filedata));
return 0;
hfi1_cdbg(AIOWRITE, "+");
if (!cq || !pq)
return -EIO;

View File

@ -1254,18 +1254,18 @@ struct hfi1_devdata {
//TODO: double check the order
#ifndef __HFI1_ORIG__
struct hfi1_devdata {
struct list_head list;
struct list_head list; //used
/* pointers to related structs for this device */
/* pci access data structure */
struct pci_dev *pcidev;
struct pci_dev *pcidev; //used
/* lock for sdma_map */
spinlock_t sde_map_lock;
spinlock_t sde_map_lock; //used
/* array of vl maps */
struct sdma_vl_map __rcu *sdma_map;
dma_addr_t sdma_pad_phys;
struct sdma_vl_map __rcu *sdma_map; //used
dma_addr_t sdma_pad_phys; //used
/* array of engines sized by num_sdma */
struct sdma_engine *per_sdma;
struct hfi1_pportdata *pport;
struct sdma_engine *per_sdma; //used
struct hfi1_pportdata *pport; //used
};
#endif /* __HFI1_ORIG__ */
@ -1306,13 +1306,26 @@ struct hfi1_filedata {
#endif /* __HFI1_ORIG__ */
#ifndef __HFI1_ORIG__
/* Original size on linux is 96 bytes */
/* Private data for file operations */
struct hfi1_filedata {
struct hfi1_ctxtdata *uctxt;
unsigned subctxt;
struct hfi1_user_sdma_comp_q *cq;
struct hfi1_user_sdma_pkt_q *pq;
int rec_cpu_num;
u32 tid_n_pinned;
void *handler; //struct mmu_rb_handler *handler;
void **entry_to_rb; //struct tid_rb_node **entry_to_rb;
spinlock_t tid_lock;
u32 tid_limit;
u32 tid_used;
u32 *invalid_tids;
u32 invalid_tid_idx;
spinlock_t invalid_lock;
void *mm; //struct mm_struct *mm;
};
#endif /* __HFI1_ORIG__ */
#ifdef __HFI1_ORIG__

View File

@ -3096,7 +3096,7 @@ SYSCALL_DECLARE(writev)
struct iovec *iovec = (struct iovec *)ihk_mc_syscall_arg1(ctx);
int iovcnt = ihk_mc_syscall_arg2(ctx);
void *private_data = proc->fd_priv_table[fd];
if (!private_data) hfi1_aio_write(private_data, iovec, iovcnt);
if (private_data) hfi1_aio_write(private_data, iovec, iovcnt);
return syscall_generic_forwarding(__NR_writev, ctx);
}