ll_inode2fid(&fid, inode);
rc = mdc_getattr_name(sbi->ll_mdc_exp, &fid, filename,
- strlen(filename)+1, OBD_MD_FLEASIZE,
+ strlen(filename) + 1, OBD_MD_FLEASIZE,
obd_size_diskmd(sbi->ll_osc_exp, NULL),
&request);
if (rc < 0) {
/* don't drop the mmapped file to LRU */
if (mapping_mapped(inode->i_mapping))
ast_flags |= LDLM_FL_NO_LRU;
-
+
/* XXX phil: can we do this? won't it screw the file size up? */
if ((fd && (fd->fd_flags & LL_FILE_IGNORE_LOCK)) ||
(sbi->ll_flags & LL_SBI_NOLCK))
/* We need to special case any other ioctls we want to handle,
* to send them to the MDS/OST as appropriate and to properly
* network encode the arg field.
- case EXT2_IOC_SETVERSION_OLD:
- case EXT2_IOC_SETVERSION_NEW:
+ case EXT3_IOC_SETVERSION_OLD:
+ case EXT3_IOC_SETVERSION:
*/
default:
RETURN(obd_iocontrol(cmd, ll_i2obdexp(inode), 0, NULL,
inode->i_ino, inode->i_generation, inode,
offset + ((origin == 2) ? inode->i_size :
(origin == 1) ? file->f_pos : 0),
- origin == 2 ? "SEEK_END": origin == 1 ? "SEEK_CUR": "SEEK_SET");
+ origin == 2 ? "SEEK_END": origin == 1 ? "SEEK_CUR" : "SEEK_SET");
lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, LPROC_LL_LLSEEK);
if (origin == 2) { /* SEEK_END */
};
extern kmem_cache_t *ll_file_data_slab;
+struct lustre_handle;
struct ll_file_data {
struct obd_client_handle fd_mds_och;
struct ll_readahead_state fd_ras;
__u32 fd_flags;
};
-struct lustre_handle;
struct lov_stripe_md;
extern spinlock_t inode_lock;
extern kmem_cache_t *ll_async_page_slab;
extern size_t ll_async_page_slab_size;
struct ll_async_page {
- int llap_magic;
+ int llap_magic;
void *llap_cookie;
struct page *llap_page;
struct list_head llap_pending_write;
int *type)
#else
struct page *ll_nopage(struct vm_area_struct *vma, unsigned long address,
- int type)
+ int type /* unused */)
#endif
{
struct file *filp = vma->vm_file;
/* XXX change inode size without i_sem hold! there is a race condition
* with truncate path. (see ll_extent_lock) */
- down(&lli->lli_size_sem);
+ //down(&lli->lli_size_sem);
kms = lov_merge_size(lli->lli_smd, 1);
pgoff = ((address - vma->vm_start) >> PAGE_CACHE_SHIFT) + vma->vm_pgoff;
size = (kms + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
if (pgoff >= size) {
- up(&lli->lli_size_sem);
+ //up(&lli->lli_size_sem);
ll_glimpse_size(inode);
} else {
inode->i_size = kms;
- up(&lli->lli_size_sem);
+ //up(&lli->lli_size_sem);
}
/* disable VM_SEQ_READ and use VM_RAND_READ to make sure that
vma->vm_flags |= VM_RAND_READ;
page = filemap_nopage(vma, address, type);
+ LL_CDEBUG_PAGE(D_PAGE, page, "got addr %lu type %lx\n", address,
+ (long)type);
vma->vm_flags &= ~VM_RAND_READ;
vma->vm_flags |= (rand_read | seq_read);
#endif
/* return the user space pointer that maps to a file offset via a vma */
-static inline unsigned long file_to_user(struct vm_area_struct *vma,
- __u64 byte)
+static inline unsigned long file_to_user(struct vm_area_struct *vma, __u64 byte)
{
- return vma->vm_start +
- (byte - ((__u64)vma->vm_pgoff << PAGE_SHIFT));
+ return vma->vm_start + (byte - ((__u64)vma->vm_pgoff << PAGE_SHIFT));
}
* must be called with lli_size_sem held */
void ll_truncate(struct inode *inode)
{
- struct lov_stripe_md *lsm = ll_i2info(inode)->lli_smd;
struct ll_inode_info *lli = ll_i2info(inode);
+ struct lov_stripe_md *lsm = lli->lli_smd;
struct obdo oa;
int rc;
ENTRY;
rc = obd_punch(ll_i2obdexp(inode), &oa, lsm, inode->i_size,
OBD_OBJECT_EOF, NULL);
if (rc)
- CERROR("obd_truncate fails (%d) ino %lu\n", rc,
- inode->i_ino);
+ CERROR("obd_truncate fails (%d) ino %lu\n", rc, inode->i_ino);
else
obdo_to_inode(inode, &oa, OBD_MD_FLSIZE|OBD_MD_FLBLOCKS|
OBD_MD_FLATIME | OBD_MD_FLMTIME |
lli = ll_i2info(page->mapping->host);
lsm = lli->lli_smd;
- down(&lli->lli_size_sem);
+ //down(&lli->lli_size_sem);
kms = lov_merge_size(lsm, 1);
- up(&lli->lli_size_sem);
+ //up(&lli->lli_size_sem);
/* catch race with truncate */
if (((__u64)page->index << PAGE_SHIFT) >= kms)
spin_unlock(&sbi->ll_lock);
return;
}
+
int ll_writepage(struct page *page)
{
struct inode *inode = page->mapping->host;
page_cache_get(page);
if (llap->llap_write_queued) {
LL_CDEBUG_PAGE(D_PAGE, page, "marking urgent\n");
- rc = obd_set_async_flags(exp, ll_i2info(inode)->lli_smd, NULL,
+ rc = obd_set_async_flags(exp, lli->lli_smd, NULL,
llap->llap_cookie,
ASYNC_READY | ASYNC_URGENT);
} else {