Commit 1723f7f2 authored by Anton Altaparmakov's avatar Anton Altaparmakov Committed by Linus Torvalds

[PATCH] fs/buffer.c exports for NTFS

I renamed the functions to more descriptive names:

	create_buffers -> alloc_page_buffers
	__set_page_buffers -> attach_page_buffers

And I added a EXPORT_SYMBOL_GPL for alloc_page_buffers and made
attach_page_buffers static inline and moved it to <linux/buffer_head.h>.
Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1f82f7dd
...@@ -90,14 +90,6 @@ void __wait_on_buffer(struct buffer_head * bh) ...@@ -90,14 +90,6 @@ void __wait_on_buffer(struct buffer_head * bh)
wait_on_bit(&bh->b_state, BH_Lock, sync_buffer, TASK_UNINTERRUPTIBLE); wait_on_bit(&bh->b_state, BH_Lock, sync_buffer, TASK_UNINTERRUPTIBLE);
} }
static void
__set_page_buffers(struct page *page, struct buffer_head *head)
{
page_cache_get(page);
SetPagePrivate(page);
page->private = (unsigned long)head;
}
static void static void
__clear_page_buffers(struct page *page) __clear_page_buffers(struct page *page)
{ {
...@@ -1013,8 +1005,8 @@ int remove_inode_buffers(struct inode *inode) ...@@ -1013,8 +1005,8 @@ int remove_inode_buffers(struct inode *inode)
* The retry flag is used to differentiate async IO (paging, swapping) * The retry flag is used to differentiate async IO (paging, swapping)
* which may not fail from ordinary buffer allocations. * which may not fail from ordinary buffer allocations.
*/ */
static struct buffer_head * struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size,
create_buffers(struct page * page, unsigned long size, int retry) int retry)
{ {
struct buffer_head *bh, *head; struct buffer_head *bh, *head;
long offset; long offset;
...@@ -1072,6 +1064,7 @@ create_buffers(struct page * page, unsigned long size, int retry) ...@@ -1072,6 +1064,7 @@ create_buffers(struct page * page, unsigned long size, int retry)
free_more_memory(); free_more_memory();
goto try_again; goto try_again;
} }
EXPORT_SYMBOL_GPL(alloc_page_buffers);
static inline void static inline void
link_dev_buffers(struct page *page, struct buffer_head *head) link_dev_buffers(struct page *page, struct buffer_head *head)
...@@ -1084,7 +1077,7 @@ link_dev_buffers(struct page *page, struct buffer_head *head) ...@@ -1084,7 +1077,7 @@ link_dev_buffers(struct page *page, struct buffer_head *head)
bh = bh->b_this_page; bh = bh->b_this_page;
} while (bh); } while (bh);
tail->b_this_page = head; tail->b_this_page = head;
__set_page_buffers(page, head); attach_page_buffers(page, head);
} }
/* /*
...@@ -1145,7 +1138,7 @@ grow_dev_page(struct block_device *bdev, sector_t block, ...@@ -1145,7 +1138,7 @@ grow_dev_page(struct block_device *bdev, sector_t block,
/* /*
* Allocate some buffers for this page * Allocate some buffers for this page
*/ */
bh = create_buffers(page, size, 0); bh = alloc_page_buffers(page, size, 0);
if (!bh) if (!bh)
goto failed; goto failed;
...@@ -1651,7 +1644,7 @@ void create_empty_buffers(struct page *page, ...@@ -1651,7 +1644,7 @@ void create_empty_buffers(struct page *page,
{ {
struct buffer_head *bh, *head, *tail; struct buffer_head *bh, *head, *tail;
head = create_buffers(page, blocksize, 1); head = alloc_page_buffers(page, blocksize, 1);
bh = head; bh = head;
do { do {
bh->b_state |= b_state; bh->b_state |= b_state;
...@@ -1671,7 +1664,7 @@ void create_empty_buffers(struct page *page, ...@@ -1671,7 +1664,7 @@ void create_empty_buffers(struct page *page,
bh = bh->b_this_page; bh = bh->b_this_page;
} while (bh != head); } while (bh != head);
} }
__set_page_buffers(page, head); attach_page_buffers(page, head);
spin_unlock(&page->mapping->private_lock); spin_unlock(&page->mapping->private_lock);
} }
EXPORT_SYMBOL(create_empty_buffers); EXPORT_SYMBOL(create_empty_buffers);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/pagemap.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <asm/atomic.h> #include <asm/atomic.h>
...@@ -136,6 +137,8 @@ void init_buffer(struct buffer_head *, bh_end_io_t *, void *); ...@@ -136,6 +137,8 @@ void init_buffer(struct buffer_head *, bh_end_io_t *, void *);
void set_bh_page(struct buffer_head *bh, void set_bh_page(struct buffer_head *bh,
struct page *page, unsigned long offset); struct page *page, unsigned long offset);
int try_to_free_buffers(struct page *); int try_to_free_buffers(struct page *);
struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size,
int retry);
void create_empty_buffers(struct page *, unsigned long, void create_empty_buffers(struct page *, unsigned long,
unsigned long b_state); unsigned long b_state);
void end_buffer_read_sync(struct buffer_head *bh, int uptodate); void end_buffer_read_sync(struct buffer_head *bh, int uptodate);
...@@ -205,6 +208,14 @@ int nobh_truncate_page(struct address_space *, loff_t); ...@@ -205,6 +208,14 @@ int nobh_truncate_page(struct address_space *, loff_t);
* inline definitions * inline definitions
*/ */
static inline void attach_page_buffers(struct page *page,
struct buffer_head *head)
{
page_cache_get(page);
SetPagePrivate(page);
page->private = (unsigned long)head;
}
static inline void get_bh(struct buffer_head *bh) static inline void get_bh(struct buffer_head *bh)
{ {
atomic_inc(&bh->b_count); atomic_inc(&bh->b_count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment