git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git]
/
fs
/
ceph
/
file.c
diff --git
a/fs/ceph/file.c
b/fs/ceph/file.c
index
ce549d3
..
3cdf137
100644
(file)
--- a/
fs/ceph/file.c
+++ b/
fs/ceph/file.c
@@
-147,9
+147,9
@@
int ceph_open(struct inode *inode, struct file *file)
/* trivially open snapdir */
if (ceph_snap(inode) == CEPH_SNAPDIR) {
/* trivially open snapdir */
if (ceph_snap(inode) == CEPH_SNAPDIR) {
- spin_lock(&
inode->i
_lock);
+ spin_lock(&
ci->i_ceph
_lock);
__ceph_get_fmode(ci, fmode);
__ceph_get_fmode(ci, fmode);
- spin_unlock(&
inode->i
_lock);
+ spin_unlock(&
ci->i_ceph
_lock);
return ceph_init_file(inode, file, fmode);
}
return ceph_init_file(inode, file, fmode);
}
@@
-158,7
+158,7
@@
int ceph_open(struct inode *inode, struct file *file)
* write) or any MDS (for read). Update wanted set
* asynchronously.
*/
* write) or any MDS (for read). Update wanted set
* asynchronously.
*/
- spin_lock(&
inode->i
_lock);
+ spin_lock(&
ci->i_ceph
_lock);
if (__ceph_is_any_real_caps(ci) &&
(((fmode & CEPH_FILE_MODE_WR) == 0) || ci->i_auth_cap)) {
int mds_wanted = __ceph_caps_mds_wanted(ci);
if (__ceph_is_any_real_caps(ci) &&
(((fmode & CEPH_FILE_MODE_WR) == 0) || ci->i_auth_cap)) {
int mds_wanted = __ceph_caps_mds_wanted(ci);
@@
-168,7
+168,7
@@
int ceph_open(struct inode *inode, struct file *file)
inode, fmode, ceph_cap_string(wanted),
ceph_cap_string(issued));
__ceph_get_fmode(ci, fmode);
inode, fmode, ceph_cap_string(wanted),
ceph_cap_string(issued));
__ceph_get_fmode(ci, fmode);
- spin_unlock(&
inode->i
_lock);
+ spin_unlock(&
ci->i_ceph
_lock);
/* adjust wanted? */
if ((issued & wanted) != wanted &&
/* adjust wanted? */
if ((issued & wanted) != wanted &&
@@
-180,10
+180,10
@@
int ceph_open(struct inode *inode, struct file *file)
} else if (ceph_snap(inode) != CEPH_NOSNAP &&
(ci->i_snap_caps & wanted) == wanted) {
__ceph_get_fmode(ci, fmode);
} else if (ceph_snap(inode) != CEPH_NOSNAP &&
(ci->i_snap_caps & wanted) == wanted) {
__ceph_get_fmode(ci, fmode);
- spin_unlock(&
inode->i
_lock);
+ spin_unlock(&
ci->i_ceph
_lock);
return ceph_init_file(inode, file, fmode);
}
return ceph_init_file(inode, file, fmode);
}
- spin_unlock(&
inode->i
_lock);
+ spin_unlock(&
ci->i_ceph
_lock);
dout("open fmode %d wants %s\n", fmode, ceph_cap_string(wanted));
req = prepare_open_request(inode->i_sb, flags, 0);
dout("open fmode %d wants %s\n", fmode, ceph_cap_string(wanted));
req = prepare_open_request(inode->i_sb, flags, 0);
@@
-743,9
+743,9
@@
retry_snap:
*/
int dirty;
*/
int dirty;
- spin_lock(&
inode->i
_lock);
+ spin_lock(&
ci->i_ceph
_lock);
dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_WR);
dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_WR);
- spin_unlock(&
inode->i
_lock);
+ spin_unlock(&
ci->i_ceph
_lock);
ceph_put_cap_refs(ci, got);
ret = generic_file_aio_write(iocb, iov, nr_segs, pos);
ceph_put_cap_refs(ci, got);
ret = generic_file_aio_write(iocb, iov, nr_segs, pos);
@@
-764,9
+764,9
@@
retry_snap:
if (ret >= 0) {
int dirty;
if (ret >= 0) {
int dirty;
- spin_lock(&
inode->i
_lock);
+ spin_lock(&
ci->i_ceph
_lock);
dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_WR);
dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_WR);
- spin_unlock(&
inode->i
_lock);
+ spin_unlock(&
ci->i_ceph
_lock);
if (dirty)
__mark_inode_dirty(inode, dirty);
}
if (dirty)
__mark_inode_dirty(inode, dirty);
}
@@
-793,16
+793,15
@@
out:
static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
{
struct inode *inode = file->f_mapping->host;
static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
{
struct inode *inode = file->f_mapping->host;
-
in
t ret;
+
loff_
t ret;
mutex_lock(&inode->i_mutex);
__ceph_do_pending_vmtruncate(inode);
mutex_lock(&inode->i_mutex);
__ceph_do_pending_vmtruncate(inode);
- if (origin != SEEK_CUR || origin != SEEK_SET) {
+
+ if (origin == SEEK_END || origin == SEEK_DATA || origin == SEEK_HOLE) {
ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE);
ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE);
- if (ret < 0) {
- offset = ret;
+ if (ret < 0)
goto out;
goto out;
- }
}
switch (origin) {
}
switch (origin) {
@@
-817,7
+816,7
@@
static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
* write() or lseek() might have altered it
*/
if (offset == 0) {
* write() or lseek() might have altered it
*/
if (offset == 0) {
-
offs
et = file->f_pos;
+
r
et = file->f_pos;
goto out;
}
offset += file->f_pos;
goto out;
}
offset += file->f_pos;
@@
-838,7
+837,7
@@
static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
}
if (offset < 0 || offset > inode->i_sb->s_maxbytes) {
}
if (offset < 0 || offset > inode->i_sb->s_maxbytes) {
-
offs
et = -EINVAL;
+
r
et = -EINVAL;
goto out;
}
goto out;
}
@@
-847,10
+846,11
@@
static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
file->f_pos = offset;
file->f_version = 0;
}
file->f_pos = offset;
file->f_version = 0;
}
+ ret = offset;
out:
mutex_unlock(&inode->i_mutex);
out:
mutex_unlock(&inode->i_mutex);
- return
offs
et;
+ return
r
et;
}
const struct file_operations ceph_file_fops = {
}
const struct file_operations ceph_file_fops = {