search for: le16_to_cpu

Displaying 20 results from an estimated 429 matches for "le16_to_cpu".

2009 Jun 12
2
[PATCH 0/2] ocfs2: Adjust rightmost path in ocfs2_add_branch.v2
Hi Mark/Joel, This is the v2 of bug fix for ocfs2_add_branch. Modification from V1 to V2: 1. Create a patch which return EROFS instead of BUG in ocfs2_insert_at_leaf. 2. Use ocfs2_adjust_rightmost_records to change the root and extent blocks in the rightmost path. Regards, Tao
2009 Feb 16
3
[PATCH 0/2] ocfs2: two fixes for xattr -v2
Hi, I have fixed the problems in version 1 patches. These two patches based on the latest main line kernel. Thanks, tiger > For EAs data structure in inode/block are little different from them in > bucket. These two patches try to make them same for the most part. > > The first patch set xh_free_start and xh_name_value_len when EAs in > inode/block. xh_free_start is useful to
2009 Feb 11
2
[PATCH 0/2] ocfs2: two fixes for xattr
Hi, For EAs data structure in inode/block are little different from them in bucket. These two patches try to make them same for the most part. The first patch set xh_free_start and xh_name_value_len when EAs in inode/block. xh_free_start is useful to keep the minimum offset of the xattr name/value. But xh_name_value_len is not very useful because we don't have "hole" when EAs in
2009 Mar 18
3
[PATCH] ocfs2: Fix 2 warning during ocfs2 make.
...*de; struct buffer_head *dx_leaf_bh; diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index b4ca591..eb21dbb 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -2213,7 +2213,7 @@ static int ocfs2_get_suballoc_slot_bit(struct ocfs2_super *osb, u64 blkno, goto bail; } - if (le16_to_cpu(inode_fe->i_suballoc_slot) != OCFS2_INVALID_SLOT && + if (le16_to_cpu(inode_fe->i_suballoc_slot) != (u16)OCFS2_INVALID_SLOT && (u32)le16_to_cpu(inode_fe->i_suballoc_slot) > osb->max_slots - 1) { mlog(ML_ERROR, "inode %llu has invalid suballoc slot %u\n&q...
2006 Aug 15
0
[git patches] ocfs2 updates
..._wanted, - u16 *bit_off, - u16 *bits_found); static inline int ocfs2_block_group_set_bits(struct ocfs2_journal_handle *handle, struct inode *alloc_inode, struct ocfs2_group_desc *bg, @@ -143,6 +132,64 @@ static u32 ocfs2_bits_per_group(struct o return (u32)le16_to_cpu(cl->cl_cpg) * (u32)le16_to_cpu(cl->cl_bpc); } +/* somewhat more expensive than our other checks, so use sparingly. */ +static int ocfs2_check_group_descriptor(struct super_block *sb, + struct ocfs2_dinode *di, + struct ocfs2_group_desc *gd) +{ + unsigned int max_bits; + + if (!OCFS...
2008 Jan 29
2
[PATCH 0/2] Unwritten extent merge update, V2
The old extent merging code down underneath "ocfs2_mark_extent_written()" can't merge extents between leaf blocks. This patch resolve this. So that a large unwritten extent which has been split up with a bunch of writes can be merged together once all unwritten regions have been written to. Modification from V1 to V2: 1. Add more comments for some functions which is more complicated
2009 Dec 23
1
[PATCH] ocfs2/trivial: Use le16_to_cpu for a disk value in xattr.c
In ocfs2_value_metas_in_xattr_header, we should Use le16_to_cpu for ocfs2_extent_list.l_next_free_rec. Signed-off-by: Tao Ma <tao.ma at oracle.com> --- fs/ocfs2/xattr.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index fe34190..8c0bfa2 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c...
2009 Feb 20
1
[PATCH 1/1] ocfs2: set gap to seperate entry and value when xattr in bucket
...int ocfs2_xattr_can_be_in_inode(struct inode *inode, last += 1; } - free = min_offs - ((void *)last - xs->base) - sizeof(__u32); + free = min_offs - ((void *)last - xs->base) - OCFS2_XATTR_HEADER_GAP; if (free < 0) return 0; @@ -5060,8 +5061,8 @@ try_again: xh_free_start = le16_to_cpu(xh->xh_free_start); header_size = sizeof(struct ocfs2_xattr_header) + count * sizeof(struct ocfs2_xattr_entry); - max_free = OCFS2_XATTR_BUCKET_SIZE - - le16_to_cpu(xh->xh_name_value_len) - header_size; + max_free = OCFS2_XATTR_BUCKET_SIZE - header_size - + le16_to_cpu(xh->xh_name_...
2005 Oct 31
2
What is the history of CONFIG_EXT{2,3}_CHECK?
Can anyone tell me the history of CONFIG_EXT{2,3}_CHECK? There is code for a "check" option for mount if these options are enabled, but there's no way to enable them. TIA Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said.
2009 Feb 20
3
[PATCH 1/1] OCFS2: anti stale inode for nfs (V4)
...o: %llu\n", blkno); + + /* dirty read disk */ + status = ocfs2_read_blocks_sync(osb, blkno, 1, &inode_bh); + if (status < 0) + goto bail; + + inode_fe = (struct ocfs2_dinode *) inode_bh->b_data; + if (!OCFS2_IS_VALID_DINODE(inode_fe)) { + status = -EINVAL; + goto bail; + } + + if (le16_to_cpu(inode_fe->i_suballoc_slot) != OCFS2_INVALID_SLOT && + (u32)le16_to_cpu(inode_fe->i_suballoc_slot) > osb->max_slots -1) { + mlog(ML_ERROR, "inode %llu has invalid suballoc slot %u" + "this may be caused by file system crash", blkno, + (u32)le1...
2013 Mar 13
1
Fix unaligned accesses for SPARC
...b/drivers/gpu/drm/nouveau/nouveau_bios.h @@ -26,6 +26,8 @@ #include "nvreg.h" +#include <asm/unaligned.h> + #define DCB_MAX_NUM_ENTRIES 16 #define DCB_MAX_NUM_I2C_ENTRIES 16 #define DCB_MAX_NUM_GPIO_ENTRIES 32 @@ -33,10 +35,10 @@ #define DCB_LOC_ON_CHIP 0 -#define ROM16(x) le16_to_cpu(*(u16 *)&(x)) -#define ROM32(x) le32_to_cpu(*(u32 *)&(x)) +#define ROM16(x) le16_to_cpu(get_unaligned((u16 *)&(x))) +#define ROM32(x) le32_to_cpu(get_unaligned((u32 *)&(x))) #define ROM48(x) ({ u8 *p = &(x); (u64)ROM16(p[4]) << 32 | ROM32(p[0]); }) -#define ROM64(x) le64_...
2009 Jan 30
8
[PATCH 0/7] ocfs2: Directory indexing support
The following patches implement indexed directory support in Ocfs2, mostly according to the design doc I wrote up a while ago: http://oss.oracle.com/osswiki/OCFS2/DesignDocs/IndexedDirectories The patches have been rebased on top of 2.6.29-rc2. It should be trivial to put them into merge_window. Things are what I'd call complete now. I'd like to get these into the merge_window branch
2018 Nov 05
2
[PATCH 3/5] VSOCK: support receive mergeable rx buffer in guest
...struct virtio_vsock *vsock, unsigned int *total_len) +{ + struct virtio_vsock_pkt *pkt; + u16 num_buf; + void *page; + unsigned int len; + int i = 0; + + page = virtqueue_get_buf(vq, &len); + if (!page) + return NULL; + + *total_len = len; + vsock->rx_buf_nr--; + + pkt = page; + num_buf = le16_to_cpu(pkt->mrg_rxbuf_hdr.num_buffers); + if (!num_buf || num_buf > VIRTIO_VSOCK_MAX_MRG_BUF_NUM) + goto err; + + pkt->mergeable = true; + if (!le32_to_cpu(pkt->hdr.len)) + return pkt; + + len -= sizeof(struct virtio_vsock_pkt); + pkt->mrg_rxbuf[i].buf = page + sizeof(struct virtio_vsock_...
2018 Nov 05
2
[PATCH 3/5] VSOCK: support receive mergeable rx buffer in guest
...struct virtio_vsock *vsock, unsigned int *total_len) +{ + struct virtio_vsock_pkt *pkt; + u16 num_buf; + void *page; + unsigned int len; + int i = 0; + + page = virtqueue_get_buf(vq, &len); + if (!page) + return NULL; + + *total_len = len; + vsock->rx_buf_nr--; + + pkt = page; + num_buf = le16_to_cpu(pkt->mrg_rxbuf_hdr.num_buffers); + if (!num_buf || num_buf > VIRTIO_VSOCK_MAX_MRG_BUF_NUM) + goto err; + + pkt->mergeable = true; + if (!le32_to_cpu(pkt->hdr.len)) + return pkt; + + len -= sizeof(struct virtio_vsock_pkt); + pkt->mrg_rxbuf[i].buf = page + sizeof(struct virtio_vsock_...
2009 Apr 21
0
[PATCH] ocfs2: Fix some printk() warnings.
..._ERROR, "invalid inode %llu requested\n", blkno); + mlog(ML_ERROR, "invalid inode %llu requested\n", + (unsigned long long)blkno); status = -EINVAL; goto bail; } @@ -2216,7 +2218,8 @@ static int ocfs2_get_suballoc_slot_bit(struct ocfs2_super *osb, u64 blkno, if (le16_to_cpu(inode_fe->i_suballoc_slot) != (u16)OCFS2_INVALID_SLOT && (u32)le16_to_cpu(inode_fe->i_suballoc_slot) > osb->max_slots - 1) { mlog(ML_ERROR, "inode %llu has invalid suballoc slot %u\n", - blkno, (u32)le16_to_cpu(inode_fe->i_suballoc_slot)); + (un...
2008 Oct 28
14
[PATCH 0/13] ocfs2: xattr bucket API
When the extended attribute namespace grows to a b-tree, the leaf clusters are organized by means of 'buckets'. Each bucket is 4K in size, regardless of blocksize. Thus, a bucket may be made of more than one block. fs/ocfs2/xattr.c has a nice little abstraction to wrap this, struct ocfs2_xattr_bucket. It contains a list of buffer_heads representing these blocks, and there is even an
2015 Mar 24
2
[virtio-dev] Re: [PATCH v3] Add virtio-input driver.
Hi, > > + spin_lock_irqsave(&vi->lock, flags); > > + while ((event = virtqueue_get_buf(vi->evt, &len)) != NULL) { > > + input_event(vi->idev, > > + le16_to_cpu(event->type), > > + le16_to_cpu(event->code), > > + le32_to_cpu(event->value)); > > What happens if input layer gets an > unexpected event code or value? input layer checks it and ignores events not supported (according to the support bitmaps). > >...
2015 Mar 24
2
[virtio-dev] Re: [PATCH v3] Add virtio-input driver.
Hi, > > + spin_lock_irqsave(&vi->lock, flags); > > + while ((event = virtqueue_get_buf(vi->evt, &len)) != NULL) { > > + input_event(vi->idev, > > + le16_to_cpu(event->type), > > + le16_to_cpu(event->code), > > + le32_to_cpu(event->value)); > > What happens if input layer gets an > unexpected event code or value? input layer checks it and ignores events not supported (according to the support bitmaps). > >...
2023 Feb 20
1
[PATCH v2] ocfs2: fix non-auto defrag path not working issue
...ndex 6251748c695b..b1e32ec4a9d4 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -434,7 +434,7 @@ static int ocfs2_find_victim_alloc_group(struct inode *inode, bg = (struct ocfs2_group_desc *)gd_bh->b_data; if (vict_blkno < (le64_to_cpu(bg->bg_blkno) + - le16_to_cpu(bg->bg_bits))) { + (le16_to_cpu(bg->bg_bits) << bits_per_unit))) { *ret_bh = gd_bh; *vict_bit = (vict_blkno - blkno) >> @@ -549,6 +549,7 @@ static void ocfs2_probe_alloc_group(struct inode *inode, struct buffer_head *bh, last_free_bits++; if (last_free_bi...
2023 Feb 17
1
[PATCH] ocfs2: fix non-auto defrag path not working issue
...ndex 6251748c695b..b1e32ec4a9d4 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -434,7 +434,7 @@ static int ocfs2_find_victim_alloc_group(struct inode *inode, bg = (struct ocfs2_group_desc *)gd_bh->b_data; if (vict_blkno < (le64_to_cpu(bg->bg_blkno) + - le16_to_cpu(bg->bg_bits))) { + (le16_to_cpu(bg->bg_bits) << bits_per_unit))) { *ret_bh = gd_bh; *vict_bit = (vict_blkno - blkno) >> @@ -549,6 +549,7 @@ static void ocfs2_probe_alloc_group(struct inode *inode, struct buffer_head *bh, last_free_bits++; if (last_free_bi...