|
@@ -59,15 +59,24 @@ static loff_t gfs2_llseek(struct file *file, loff_t offset, int origin)
|
|
struct gfs2_holder i_gh;
|
|
struct gfs2_holder i_gh;
|
|
loff_t error;
|
|
loff_t error;
|
|
|
|
|
|
- if (origin == 2) {
|
|
|
|
|
|
+ switch (origin) {
|
|
|
|
+ case SEEK_END: /* These reference inode->i_size */
|
|
|
|
+ case SEEK_DATA:
|
|
|
|
+ case SEEK_HOLE:
|
|
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY,
|
|
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY,
|
|
&i_gh);
|
|
&i_gh);
|
|
if (!error) {
|
|
if (!error) {
|
|
error = generic_file_llseek_unlocked(file, offset, origin);
|
|
error = generic_file_llseek_unlocked(file, offset, origin);
|
|
gfs2_glock_dq_uninit(&i_gh);
|
|
gfs2_glock_dq_uninit(&i_gh);
|
|
}
|
|
}
|
|
- } else
|
|
|
|
|
|
+ break;
|
|
|
|
+ case SEEK_CUR:
|
|
|
|
+ case SEEK_SET:
|
|
error = generic_file_llseek_unlocked(file, offset, origin);
|
|
error = generic_file_llseek_unlocked(file, offset, origin);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ error = -EINVAL;
|
|
|
|
+ }
|
|
|
|
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|