X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fceph%2Ffile.c;h=3cdf137e9c5be0cec55242cbc79ebb1d22ae2fc0;hb=147ee65b012b3ab82e004f18d8f8a9980400358f;hp=ed72428d9c75c80a6744ccd6a996b83c1a20d333;hpb=00ca4e4c8f72f2a67466a41b12714ed8c9e10f64;p=pandora-kernel.git diff --git a/fs/ceph/file.c b/fs/ceph/file.c index ed72428d9c75..3cdf137e9c5b 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -793,17 +793,15 @@ out: static loff_t ceph_llseek(struct file *file, loff_t offset, int origin) { struct inode *inode = file->f_mapping->host; - int ret; + loff_t ret; mutex_lock(&inode->i_mutex); __ceph_do_pending_vmtruncate(inode); if (origin == SEEK_END || origin == SEEK_DATA || origin == SEEK_HOLE) { ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE); - if (ret < 0) { - offset = ret; + if (ret < 0) goto out; - } } switch (origin) { @@ -818,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) { - offset = file->f_pos; + ret = file->f_pos; goto out; } offset += file->f_pos; @@ -839,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) { - offset = -EINVAL; + ret = -EINVAL; goto out; } @@ -848,10 +846,11 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int origin) file->f_pos = offset; file->f_version = 0; } + ret = offset; out: mutex_unlock(&inode->i_mutex); - return offset; + return ret; } const struct file_operations ceph_file_fops = {