diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-22 12:52:16 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-22 12:52:16 -0700 |
commit | 3e59ddff2b8dfe42b15520c4f8f2486bd9f9708e (patch) | |
tree | 10587a53ab093fc498fa52651f8a7c1b2b99af60 /fs/ocfs2/uptodate.c | |
parent | 6bbd9b6d694ff7242d63cda2faac4bd59ee4328e (diff) | |
parent | eb35746ca5e2211569b91ebb44d55b88ec91f3b0 (diff) |
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
ocfs2: Remove overzealous BUG_ON()
ocfs2: Don't print on unknown remote blocking call
ocfs2: Remove EXPERIMENTAL dependency
ocfs2: implement directory read-ahead
ocfs2: properly update i_mtime on buffered write
ocfs2: Fix directory link count checks in ocfs2_link()
ocfs2: move nlink check in ocfs2_mknod()
ocfs2: Fix heartbeat sector calculation
[PATCH] fs/ocfs2/ioctl.c should #include "ioctl.h"
ocfs2: add ext2 attributes
configfs: Prevent duplicate subsystem names.
Diffstat (limited to 'fs/ocfs2/uptodate.c')
-rw-r--r-- | fs/ocfs2/uptodate.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c index b8a00a79332..9707ed7a320 100644 --- a/fs/ocfs2/uptodate.c +++ b/fs/ocfs2/uptodate.c @@ -206,7 +206,10 @@ static int ocfs2_buffer_cached(struct ocfs2_inode_info *oi, } /* Warning: even if it returns true, this does *not* guarantee that - * the block is stored in our inode metadata cache. */ + * the block is stored in our inode metadata cache. + * + * This can be called under lock_buffer() + */ int ocfs2_buffer_uptodate(struct inode *inode, struct buffer_head *bh) { @@ -226,6 +229,16 @@ int ocfs2_buffer_uptodate(struct inode *inode, return ocfs2_buffer_cached(OCFS2_I(inode), bh); } +/* + * Determine whether a buffer is currently out on a read-ahead request. + * ip_io_sem should be held to serialize submitters with the logic here. + */ +int ocfs2_buffer_read_ahead(struct inode *inode, + struct buffer_head *bh) +{ + return buffer_locked(bh) && ocfs2_buffer_cached(OCFS2_I(inode), bh); +} + /* Requires ip_lock */ static void ocfs2_append_cache_array(struct ocfs2_caching_info *ci, sector_t block) @@ -403,7 +416,11 @@ out_free: * * Note that this function may actually fail to insert the block if * memory cannot be allocated. This is not fatal however (but may - * result in a performance penalty) */ + * result in a performance penalty) + * + * Readahead buffers can be passed in here before the I/O request is + * completed. + */ void ocfs2_set_buffer_uptodate(struct inode *inode, struct buffer_head *bh) { |