Skip to content

Commit 5bf431f

Browse files
committed
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs: [XFS] Update maintainers [XFS] use scalable vmap API [XFS] remove old vmap cache [XFS] make xfs_ino_t an unsigned long long [XFS] truncate readdir offsets to signed 32 bit values [XFS] fix compile of xfs_btree_readahead_lblock on m68k [XFS] Remove macro-to-function indirections in the mask code [XFS] Remove macro-to-function indirections in attr code [XFS] Remove several unused typedefs. [XFS] pass XFS_IGET_BULKSTAT to xfs_iget for handle operations
2 parents c2919f2 + cb7a97d commit 5bf431f

15 files changed

Lines changed: 122 additions & 203 deletions

‎MAINTAINERS‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4842,11 +4842,11 @@ S: Supported
48424842

48434843
XFS FILESYSTEM
48444844
P: Silicon Graphics Inc
4845-
P: Tim Shimmin
4845+
P: Bill O'Donnell
48464846
M: xfs-masters@oss.sgi.com
48474847
L: xfs@oss.sgi.com
48484848
W: http://oss.sgi.com/projects/xfs
4849-
T: git git://oss.sgi.com:8090/xfs/xfs-2.6.git
4849+
T: git://oss.sgi.com/xfs/xfs.git
48504850
S: Supported
48514851

48524852
XILINX SYSTEMACE DRIVER

‎fs/xfs/linux-2.6/xfs_aops.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
extern struct workqueue_struct *xfsdatad_workqueue;
2222
extern mempool_t *xfs_ioend_pool;
2323

24-
typedef void (*xfs_ioend_func_t)(void *);
25-
2624
/*
2725
* xfs_ioend struct manages large extent writes for XFS.
2826
* It can manage several multi-page bio's at once.

‎fs/xfs/linux-2.6/xfs_buf.c‎

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -165,75 +165,6 @@ test_page_region(
165165
return (mask && (page_private(page) & mask) == mask);
166166
}
167167

168-
/*
169-
* Mapping of multi-page buffers into contiguous virtual space
170-
*/
171-
172-
typedef struct a_list {
173-
void *vm_addr;
174-
struct a_list *next;
175-
} a_list_t;
176-
177-
static a_list_t *as_free_head;
178-
static int as_list_len;
179-
static DEFINE_SPINLOCK(as_lock);
180-
181-
/*
182-
* Try to batch vunmaps because they are costly.
183-
*/
184-
STATIC void
185-
free_address(
186-
void *addr)
187-
{
188-
a_list_t *aentry;
189-
190-
#ifdef CONFIG_XEN
191-
/*
192-
* Xen needs to be able to make sure it can get an exclusive
193-
* RO mapping of pages it wants to turn into a pagetable. If
194-
* a newly allocated page is also still being vmap()ed by xfs,
195-
* it will cause pagetable construction to fail. This is a
196-
* quick workaround to always eagerly unmap pages so that Xen
197-
* is happy.
198-
*/
199-
vunmap(addr);
200-
return;
201-
#endif
202-
203-
aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT);
204-
if (likely(aentry)) {
205-
spin_lock(&as_lock);
206-
aentry->next = as_free_head;
207-
aentry->vm_addr = addr;
208-
as_free_head = aentry;
209-
as_list_len++;
210-
spin_unlock(&as_lock);
211-
} else {
212-
vunmap(addr);
213-
}
214-
}
215-
216-
STATIC void
217-
purge_addresses(void)
218-
{
219-
a_list_t *aentry, *old;
220-
221-
if (as_free_head == NULL)
222-
return;
223-
224-
spin_lock(&as_lock);
225-
aentry = as_free_head;
226-
as_free_head = NULL;
227-
as_list_len = 0;
228-
spin_unlock(&as_lock);
229-
230-
while ((old = aentry) != NULL) {
231-
vunmap(aentry->vm_addr);
232-
aentry = aentry->next;
233-
kfree(old);
234-
}
235-
}
236-
237168
/*
238169
* Internal xfs_buf_t object manipulation
239170
*/
@@ -333,7 +264,7 @@ xfs_buf_free(
333264
uint i;
334265

335266
if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1))
336-
free_address(bp->b_addr - bp->b_offset);
267+
vm_unmap_ram(bp->b_addr - bp->b_offset, bp->b_page_count);
337268

338269
for (i = 0; i < bp->b_page_count; i++) {
339270
struct page *page = bp->b_pages[i];
@@ -455,10 +386,8 @@ _xfs_buf_map_pages(
455386
bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset;
456387
bp->b_flags |= XBF_MAPPED;
457388
} else if (flags & XBF_MAPPED) {
458-
if (as_list_len > 64)
459-
purge_addresses();
460-
bp->b_addr = vmap(bp->b_pages, bp->b_page_count,
461-
VM_MAP, PAGE_KERNEL);
389+
bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count,
390+
-1, PAGE_KERNEL);
462391
if (unlikely(bp->b_addr == NULL))
463392
return -ENOMEM;
464393
bp->b_addr += bp->b_offset;
@@ -1743,8 +1672,6 @@ xfsbufd(
17431672
count++;
17441673
}
17451674

1746-
if (as_list_len > 0)
1747-
purge_addresses();
17481675
if (count)
17491676
blk_run_address_space(target->bt_mapping);
17501677

‎fs/xfs/linux-2.6/xfs_export.c‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,26 @@ xfs_nfs_get_inode(
126126
if (ino == 0)
127127
return ERR_PTR(-ESTALE);
128128

129-
error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0);
130-
if (error)
129+
/*
130+
* The XFS_IGET_BULKSTAT means that an invalid inode number is just
131+
* fine and not an indication of a corrupted filesystem. Because
132+
* clients can send any kind of invalid file handle, e.g. after
133+
* a restore on the server we have to deal with this case gracefully.
134+
*/
135+
error = xfs_iget(mp, NULL, ino, XFS_IGET_BULKSTAT,
136+
XFS_ILOCK_SHARED, &ip, 0);
137+
if (error) {
138+
/*
139+
* EINVAL means the inode cluster doesn't exist anymore.
140+
* This implies the filehandle is stale, so we should
141+
* translate it here.
142+
* We don't use ESTALE directly down the chain to not
143+
* confuse applications using bulkstat that expect EINVAL.
144+
*/
145+
if (error == EINVAL)
146+
error = ESTALE;
131147
return ERR_PTR(-error);
132-
if (!ip)
133-
return ERR_PTR(-EIO);
148+
}
134149

135150
if (ip->i_d.di_gen != generation) {
136151
xfs_iput_new(ip, XFS_ILOCK_SHARED);

‎fs/xfs/xfs_acl.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
* Access Control Lists
2323
*/
2424
typedef __uint16_t xfs_acl_perm_t;
25-
typedef __int32_t xfs_acl_type_t;
2625
typedef __int32_t xfs_acl_tag_t;
2726
typedef __int32_t xfs_acl_id_t;
2827

‎fs/xfs/xfs_ag.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ typedef struct xfs_perag
231231
#define XFS_FSB_TO_AGNO(mp,fsbno) \
232232
((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog))
233233
#define XFS_FSB_TO_AGBNO(mp,fsbno) \
234-
((xfs_agblock_t)((fsbno) & XFS_MASK32LO((mp)->m_sb.sb_agblklog)))
234+
((xfs_agblock_t)((fsbno) & xfs_mask32lo((mp)->m_sb.sb_agblklog)))
235235
#define XFS_AGB_TO_DADDR(mp,agno,agbno) \
236236
((xfs_daddr_t)XFS_FSB_TO_BB(mp, \
237237
(xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno)))

0 commit comments

Comments
 (0)