Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Another slightly less rough cut at XML based configuration. There
[fs/lustre-release.git]
/
lustre
/
llite
/
dir.c
diff --git
a/lustre/llite/dir.c
b/lustre/llite/dir.c
index
189b1f1
..
0262b05
100644
(file)
--- a/
lustre/llite/dir.c
+++ b/
lustre/llite/dir.c
@@
-41,6
+41,7
@@
#include <linux/lustre_idl.h>
#include <linux/lustre_mds.h>
#include <linux/lustre_lite.h>
#include <linux/lustre_idl.h>
#include <linux/lustre_mds.h>
#include <linux/lustre_lite.h>
+#include <linux/lustre_dlm.h>
typedef struct ext2_dir_entry_2 ext2_dirent;
typedef struct ext2_dir_entry_2 ext2_dirent;
@@
-62,6
+63,8
@@
static int ll_dir_readpage(struct file *file, struct page *page)
__u64 offset;
int rc = 0;
struct ptlrpc_request *request = NULL;
__u64 offset;
int rc = 0;
struct ptlrpc_request *request = NULL;
+ struct lustre_handle lockh;
+ struct lookup_intent it = {IT_READDIR };
ENTRY;
ENTRY;
@@
-72,6
+75,11
@@
static int ll_dir_readpage(struct file *file, struct page *page)
goto readpage_out;
}
goto readpage_out;
}
+ rc = ll_lock(inode, NULL, &it, &lockh);
+ if (rc != ELDLM_OK)
+ CERROR("lock enqueue: err: %d\n", rc);
+ ldlm_lock_dump((void *)(unsigned long)lockh.addr);
+
if (Page_Uptodate(page)) {
CERROR("Explain this please?\n");
EXIT;
if (Page_Uptodate(page)) {
CERROR("Explain this please?\n");
EXIT;
@@
-80,7
+88,7
@@
static int ll_dir_readpage(struct file *file, struct page *page)
offset = page->index << PAGE_SHIFT;
buf = kmap(page);
offset = page->index << PAGE_SHIFT;
buf = kmap(page);
- rc = mdc_readpage(&sbi->ll_md
s_client, sbi->ll_mds
_conn, inode->i_ino,
+ rc = mdc_readpage(&sbi->ll_md
c
_conn, inode->i_ino,
S_IFDIR, offset, buf, &request);
kunmap(page);
ptlrpc_free_req(request);
S_IFDIR, offset, buf, &request);
kunmap(page);
ptlrpc_free_req(request);
@@
-91,6
+99,9
@@
static int ll_dir_readpage(struct file *file, struct page *page)
SetPageUptodate(page);
UnlockPage(page);
SetPageUptodate(page);
UnlockPage(page);
+ rc = ll_unlock(LCK_PR, &lockh);
+ if (rc != ELDLM_OK)
+ CERROR("ll_unlock: err: %d\n", rc);
return rc;
} /* ll_dir_readpage */
return rc;
} /* ll_dir_readpage */
@@
-119,8
+130,7
@@
int waitfor_one_page(struct page *page)
*/
static inline unsigned ext2_chunk_size(struct inode *inode)
{
*/
static inline unsigned ext2_chunk_size(struct inode *inode)
{
- //return inode->i_sb->s_blocksize;
- return PAGE_SIZE;
+ return inode->i_sb->s_blocksize;
}
static inline void ext2_put_page(struct page *page)
}
static inline void ext2_put_page(struct page *page)
@@
-337,7
+347,7
@@
static inline void ext2_set_de_type(ext2_dirent *de, struct inode *inode)
}
int
}
int
-
new_
ll_readdir (struct file * filp, void * dirent, filldir_t filldir)
+ll_readdir (struct file * filp, void * dirent, filldir_t filldir)
{
loff_t pos = filp->f_pos;
struct inode *inode = filp->f_dentry->d_inode;
{
loff_t pos = filp->f_pos;
struct inode *inode = filp->f_dentry->d_inode;
@@
-625,12
+635,14
@@
int ext2_make_empty(struct inode *inode, struct inode *parent)
if (!page)
return -ENOMEM;
if (!page)
return -ENOMEM;
+ base = kmap(page);
+ if (!base)
+ return -ENOMEM;
+
err = mapping->a_ops->prepare_write(NULL, page, 0, chunk_size);
if (err)
goto fail;
err = mapping->a_ops->prepare_write(NULL, page, 0, chunk_size);
if (err)
goto fail;
- base = page_address(page);
-
de = (struct ext2_dir_entry_2 *) base;
de->name_len = 1;
de->rec_len = cpu_to_le16(EXT2_DIR_REC_LEN(1));
de = (struct ext2_dir_entry_2 *) base;
de->name_len = 1;
de->rec_len = cpu_to_le16(EXT2_DIR_REC_LEN(1));
@@
-647,6
+659,7
@@
int ext2_make_empty(struct inode *inode, struct inode *parent)
err = ext2_commit_chunk(page, 0, chunk_size);
fail:
err = ext2_commit_chunk(page, 0, chunk_size);
fail:
+ kunmap(page);
UnlockPage(page);
page_cache_release(page);
ENTRY;
UnlockPage(page);
page_cache_release(page);
ENTRY;
@@
-700,5
+713,5
@@
not_empty:
struct file_operations ll_dir_operations = {
read: generic_read_dir,
struct file_operations ll_dir_operations = {
read: generic_read_dir,
- readdir:
new_
ll_readdir
+ readdir: ll_readdir
};
};