
860 So.2d 5 (2003)
Stanley D. STOVALL, Appellant,
v.
Sergeant William COOPER, Michael Gallemore, Assistant Warden, and James V. Crosby, Jr., Secretary, Department of Corrections, Appellees.
No. 2D02-4606.
District Court of Appeal of Florida, Second District.
August 27, 2003.
Rehearing Denied October 10, 2003.
*6 Stanley D. Stovall, pro se.
Beverly Wood Gibson, Assistant General Counsel, Tallahassee, for Appellees.

EN BANC
KELLY, Judge.
Stanley D. Stovall appeals from the nonfinal order granting the motion to transfer venue to Leon County. We affirm.
Stovall is an inmate at Polk Correctional Institution. After exhausting his administrative remedies, Stovall filed what he has styled as a complaint for declaratory relief against two employees of the prison, Sergeant William Cooper and Michael Gallemore (assistant warden), and against the Secretary of the Florida Department of Corrections, Michael W. Moore.[1] His complaint alleges that the Department, through its employees, violated his constitutional rights. Specifically, he alleges that the appellees refused to conduct a full investigation regarding why he was deprived of an "above satisfactory" rating during one month, which would have entitled him to two additional days of gain time for that month.
Stovall filed his complaint in Polk County. The appellees moved to transfer venue to Leon County where the Department maintains its headquarters. The trial *7 court granted the motion to transfer venue, and Stovall appealed from that order.
As a threshold matter, it appears that Stovall sought the wrong remedy, something the Department noted in its motion to transfer venue but which the trial court never addressed. Reduced to its essence, Stovall's action seeks to accomplish nothing more than to secure two additional days of gain time, although Stovall vehemently denies that is what he is seeking. When alleging a deprivation of gain time, prisoners who have exhausted all administrative channels must seek their remedy in circuit court by way of a petition for an extraordinary writ. Hall v. Wainwright, 498 So.2d 670 (Fla. 1st DCA 1986). If a prisoner's sentence would have expired had the Department properly awarded gain time, habeas corpus is the proper remedy. Searcy v. Singletary, 590 So.2d 1034, 1034 n. 1 (Fla. 2d DCA 1991). Otherwise, a petition for a writ of mandamus is the proper method for review of the Department's denial of gain time. Singletary v. Powell, 602 So.2d 969 (Fla. 1st DCA 1992). Because Stovall did not allege that he is entitled to immediate release, his petition for declaratory judgment must be treated as a petition for a writ of mandamus.
The issue then becomes whether the trial court correctly transferred Stovall's petition for a writ of mandamus to Leon County. If we were to follow this court's prior case law, we would be required to hold that the trial court erred in transferring venue. This court has previously held that a petition for a writ of mandamus should be filed in the county where the prisoner is housed. See Mayberry v. State, 685 So.2d 1326 (Fla. 2d DCA 1996); Newsome v. Singletary, 637 So.2d 9, 11 n. 1 (Fla. 2d DCA 1994); Searcy, 590 So.2d at 1034 n. 1. Under these cases, venue would lie in Polk County where Stovall is incarcerated. However, we have concluded that these cases were incorrectly decided with regard to the determination of venue and that there is no basis to override the Department's privilege of having the action brought where it "resides." See § 47.011, Fla. Stat. (2001).
There is no specific venue statute applicable to petitions for writs of mandamus. Accordingly, the general venue statute, section 47.011, applies. That section provides:
47.011 Where actions may be begun. Actions shall be brought only in the county where the defendant resides, where the cause of action accrued, or where the property in litigation is located. This section shall not apply to actions against nonresidents.
"In the case of state agencies, the county of `residence' is where the agency's headquarters are located." See Dickinson v. Fla. Nat'l Org. for Women, 763 So.2d 1245, 1247 (Fla. 4th DCA 2000); see also Carlile v. Game & Fresh Water Fish Comm'n, 354 So.2d 362, 363-64 (Fla.1977). Thus, under the general venue statute, Leon County is a proper venue.
Leon County is also the proper venue in this case under common law. "It has long been the established common law of Florida that venue in civil actions brought against the state or one of its agencies or subdivisions, absent waiver or exception, properly lies in the county where the state, agency, or subdivision maintains its principal headquarters." Carlile, 354 So.2d at 363. "Absent waiver or application of an identified exception, the home venue privilege appears to be an absolute right." Jacksonville Elec. Auth. v. Clay County Util. Auth., 802 So.2d 1190, *8 1192 (Fla. 1st DCA 2002).[2]
Thus, the impact of this court's prior line of cases holding that a petition for a writ of mandamus should be filed in the county where the prisoner is housed is to effectively override both the common law home venue privilege as well as the general venue statute in cases where inmates seek mandamus relief against the Department. We have found no justification for this result and believe that this court's position on this issue in the past is erroneous.
It appears that in this court's mandamus cases, cited above, this court relied on the reasoning used in cases involving petitions for writs of habeas corpus. In habeas cases, trial courts only have the authority to rule upon petitions for writs of habeas corpus filed by a prisoner detained within the court's territorial jurisdiction. See Raley v. State, 675 So.2d 170 (Fla. 5th DCA 1996). The respondent to a habeas petition must have "actual custody and [be] in a position to physically produce the petitioner." Alachua Reg'l Juvenile Det. Ctr. v. T.O., 684 So.2d 814, 816 (Fla.1996). Because it is not a requirement that the prisoner be physically produced in a mandamus proceeding, the reasoning in habeas cases does not apply to writs of mandamus. Moreover, habeas petitions are governed by chapter 79, Florida Statutes. Section 79.09, Florida Statutes (2001), provides that "[b]efore a circuit judge the petition and the papers shall be filed with the clerk of the circuit court of the county in which the prisoner is detained." There is no comparable provision pertaining to mandamus relief.
The likely source of the error, which is perpetuated in later cases, appears to come from Searcy, which states in a footnote that a petition for writ of mandamus should be filed in the circuit court in the county in which the prisoner is housed. See Searcy, 590 So.2d at 1034 n. 1. However, in support of this position, Searcy cites Hall v. Wainwright, 498 So.2d 670 (Fla. 1st DCA 1986), which does not state this proposition. Hall only states that prisoners must seek their remedy in circuit court through the filing of an extraordinary writ. It does not state in which county the petition should be filed.[3]
*9 In contrast to cases in which a prisoner seeks habeas relief against the Department, there is no legal justification to override the general venue rules, and in particular, the Department's home venue privilege in cases in which a prisoner seeks mandamus relief against the Department. Accordingly, we recede from our earlier cases to the extent that they hold venue in a mandamus proceeding lies in the county where the prisoner is housed, and we affirm the trial court's order transferring venue to Leon County.
Affirmed.
ALTENBERND, C.J., and FULMER, WHATLEY, NORTHCUTT, CASANUEVA, SALCINES, STRINGER, DAVIS, SILBERMAN, COVINGTON, CANADY, VILLANTI, and WALLACE, JJ., Concur.
NOTES
[1]  James V. Crosby, Jr., has since replaced Michael W. Moore as Secretary of the Florida Department of Corrections.
[2]  In his appeal, Stovall argues that the "sword-wielder" exception to the home venue privilege applies. The "sword-wielder" exception to the State's home venue privilege exists where an unlawful invasion of a constitutional right is directly threatened in the county where the suit is instituted. Parties seeking relief from alleged threats to their personal and property rights by the operation of unconstitutional acts of a State agency may bring suit in the county where the alleged wrongs are threatened or alleged to have been committed. Graham v. Vann, 394 So.2d 178, 179 (Fla. 1st DCA 1981). Although Stovall has couched his grievance as a constitutional issue, he has failed to point to a specific constitutional right that has been violated. Basically, his argument is that he was not evaluated as highly as he thought he should have been according to the Department's rules. Therefore, as the State maintains, the sword-wielder exception does not apply.
[3]  This court is in conflict with other districts on this issue. The First, Third, Fourth, and Fifth Districts have stated that venue for a mandamus proceeding seeking an award of gain time is in the circuit court in Leon County under the home venue privilege. See Harris v. State, 713 So.2d 1106 (Fla. 4th DCA 1998); Barber v. State, 661 So.2d 355, 356 n. 2 (Fla. 3d DCA 1995); Singletary v. Powell, 602 So.2d 969 (Fla. 1st DCA 1992); Curry v. Wainwright, 419 So.2d 744 (Fla. 5th DCA 1982). But see Grant v. State, 837 So.2d 1075 (Fla. 4th DCA 2003) (holding that the remedy for a defendant who was not given the proper gain time is to file a petition for a writ of mandamus in the county where he is incarcerated); Ashley v. Singletary, 706 So.2d 1373 (Fla. 1st DCA 1998) (same); Green v. State, 698 So.2d 575 (Fla. 5th DCA 1997) (same).
